Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
iAviatorJose opened this issue Jan 3, 2015 · 10 comments

Comments

@iAviatorJose
Copy link

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 iAviatorJose changed the title Hi Sergey, java.lang.NoClassDefFoundError: com.nostra13.universalimageloader.core.ImageLoaderConfiguration$Builder Jan 3, 2015
@iAviatorJose
Copy link
Author

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

}

@gerdave
Copy link

gerdave commented Jan 15, 2015

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

@ShreyashPromact
Copy link

I also need solution to this issue.

@404map
Copy link

404map commented Nov 18, 2015

hehe,me too.

@kenneth2008
Copy link

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.

@Robbypatel1357
Copy link

i also need solution

@kenneth2008
Copy link

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

@javalue
Copy link

javalue commented Mar 28, 2016

add

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

in your Application

@mintheinwin
Copy link

nice feedback answer
💯

@skywalkerlw
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants