Android-Universal-Image-Loader icon indicating copy to clipboard operation
Android-Universal-Image-Loader copied to clipboard

java.lang.NoClassDefFoundError: com.nostra13.universalimageloader.core.ImageLoaderConfiguration$Builder

Open iAviatorJose opened this issue 10 years ago • 10 comments

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)

iAviatorJose avatar Jan 03 '15 14:01 iAviatorJose

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);

}

iAviatorJose avatar Jan 03 '15 14:01 iAviatorJose

Helllo, could you find any solution to this problem? I have the same issue and should solve this. Thank you

gerdave avatar Jan 15 '15 10:01 gerdave

I also need solution to this issue.

ShreyashPromact avatar Jul 20 '15 10:07 ShreyashPromact

hehe,me too.

404map avatar Nov 18 '15 07:11 404map

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.

kenneth2008 avatar Nov 18 '15 09:11 kenneth2008

i also need solution

bipinbharti1357 avatar Feb 04 '16 06:02 bipinbharti1357

Remove any jar file which name included UniversalImageLoader. Reinstall by Gradle

kenneth2008 avatar Feb 04 '16 08:02 kenneth2008

add

@Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }

in your Application

javalue avatar Mar 28 '16 06:03 javalue

nice feedback answer 💯

mintheinwin avatar Nov 17 '16 08:11 mintheinwin

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.

skywalkerlw avatar Dec 18 '16 11:12 skywalkerlw