I am getting this following exception in my project
i am using Android Studio 0.8.9
and the following compile statement:
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
java.lang.NoClassDefFoundError: com.nostra13.universalimageloader.core.ImageLoaderConfiguration$Builder
at com.mypurpleslate.purpleslate.BeepApplication.initImageLoader(BeepApplication.java:306)
at com.mypurpleslate.purpleslate.BeepApplication.onCreate(BeepApplication.java:252)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1020)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4924)
at android.app.ActivityThread.access$1500(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5633)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:896)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:712)
at dalvik.system.NativeStart.main(Native Method)
These Exception Occurs in the first line of the below function in
the Subclass of MultidexApplication.
public static void initImageLoader(Context context) {
// This configuration tuning is custom. You can tune every option, you may tune some of them,
// or you can create default configuration by
// ImageLoaderConfiguration.createDefault(this);
// method.
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
.threadPriority(Thread.NORM_PRIORITY - 2)
.denyCacheImageMultipleSizesInMemory()
.diskCacheFileNameGenerator(new Md5FileNameGenerator())
.tasksProcessingOrder(QueueProcessingType.LIFO) // Remove for release app
.build();
// Initialize ImageLoader with configuration.
ImageLoader.getInstance().init(config);
}
Helllo, could you find any solution to this problem? I have the same issue and should solve this.
Thank you
I also need solution to this issue.
hehe,me too.
As the experience in using another library, try to remove any .jar file or remove any included model as library. Only the Universal Image Loader.
Reason: AndroidStudio think the jar file is the library he need, not the Gradle one.
i also need solution
Remove any jar file which name included UniversalImageLoader.
Reinstall by Gradle
add
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
in your Application
nice feedback answer
馃挴
it's typically a problem of 64k methods issue: https://developer.android.com/studio/build/multidex.html
And yes, @javalue have provided a perfect solution.
Most helpful comment
add
in your Application