MultiImagePicker
MultiImagePicker copied to clipboard
java.lang.NoClassDefFoundError
Unable to start image picker.
java.lang.NoClassDefFoundError: de.greenrobot.event.EventBus
at net.yazeed44.imagepicker.util.Picker.startActivity(Picker.java:58)
at com.goldenedge.gephotolab.MainActivity.onCreate(MainActivity.java:221)
at android.app.Activity.performCreate(Activity.java:4510)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1050)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2048)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2111)
at android.app.ActivityThread.access$600(ActivityThread.java:134)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1251)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4666)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
at dalvik.system.NativeStart.main(Native Method)
Here is code
@Override
public void onClick(View arg0) {
switch (arg0.getId()) {
case R.id.btnSelect:
new Picker.Builder(this, new MyPickListener()) // Here error arose
.build()
.startActivity();
break;
}
}
class MyPickListener implements Picker.PickListener
{
@Override
public void onPickedSuccessfully(final String[] paths){
}
@Override
public void onCancel() {
}
}
new Picker.Builder(this, new MyPickListener())
Did you call this inside activity ?
yes it is inside the MainActivity when user click the btnSelect
case R.id.btnSelect: new Picker.Builder(this, new MyPickListener()) // Here error arose .build() .startActivity(); break;
Seems like bug in event bus library
What's the phone + android version ?
It is android 4.0.4 , Qmobile A8 (a local mobile brand in Pakistan)
Default Project is working fine. But I am unable to add it my own application. Any tips?
"Default Project is working fine" You mean my sample ?
yes
public void startActivity() { EventBus.getDefault().postSticky(new OnPublishPickOptionsEvent(this)); // Error comes here in library Intent intent = new Intent(this.context, PickerActivity.class); this.context.startActivity(intent); }
Could you try your code on another device or emulator ?
Unable access Picker Class private void initUsingColorAccent(final TypedValue typedValue) { mContext.getTheme().resolveAttribute(R.attr.colorAccent, typedValue, true); mImageBackgroundColorWhenChecked = mFabBackgroundColor = typedValue.data; }
Caused by: java.lang.NoClassDefFoundError: net.yazeed44.imagepicker.library.R$attr
at net.yazeed44.imagepicker.util.Picker$Builder.initUsingColorAccent(Picker.java:185)
at net.yazeed44.imagepicker.util.Picker$Builder.init(Picker.java:155)
at net.yazeed44.imagepicker.util.Picker$Builder.
I also had this bug. Just make sure you imported cwac-cam2 correctly