java.lang.NoClassDefFoundError using Donwloader
See original GitHub issueI am using a custom downloader por Picasso.
private PicassoCache (Context context) {
Downloader downloader = new OkHttpDownloader(context, Integer.MAX_VALUE);
Picasso.Builder builder = new Picasso.Builder(context);
builder.downloader(downloader);
picassoInstance = builder.build();
}
gradle
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.squareup.okio:okio:1.10.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.0.2'
But no matter what I do, I always have this error:
stack=java.lang.NoClassDefFoundError: Failed resolution of: Lcom/squareup/okhttp/OkHttpClient;
at com.squareup.picasso.OkHttpDownloader.defaultOkHttpClient(OkHttpDownloader.java:31)
at com.squareup.picasso.OkHttpDownloader.<init>(OkHttpDownloader.java:76)
at com.squareup.picasso.OkHttpDownloader.<init>(OkHttpDownloader.java:65)
at ni.com.spiralni.help.utils.PicassoCache.<init>(PicassoCache.java:27)
at ni.com.spiralni.help.utils.PicassoCache.getPicassoInstance(PicassoCache.java:43)
at ni.com.spiralni.help.utils.ImageUtils.setImageFromWebStorage(ImageUtils.java:34)
at ni.com.spiralni.help.adapter.SearchResultListRVAdapter.onBindViewHolder(SearchResultListRVAdapter.java:45)
at ni.com.spiralni.help.adapter.SearchResultListRVAdapter.onBindViewHolder(SearchResultListRVAdapter.java:24)
Is there any issue with this integration?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
java.lang.NoClassDefFoundError for a jar file downloaded at ...
The downloading of the jtapi.jar is initiated by the application itself. It downloads a new file for 1 of 2 reasons: (1) The...
Read more >java.lang.NoClassDefFoundError - Download JAR files
Here you can download the dependencies for the java class java.lang.NoClassDefFoundError. Use this engine to looking through the maven repository.
Read more >3 ways to solve java.lang.NoClassDefFoundError in Java J2EE
NoClassDefFoundError in Java comes when Java Virtual Machine is not able to find a particular class at runtime which was available at compile...
Read more >How do I resolve a java.lang.NoClassDefFoundError error ...
So, in order to create the REST connection pool with the ODRESTAdmin.jar (which depends on jaxb-api.jar) with Java 11+, you need to download...
Read more >Caused By: java.lang.NoClassDefFoundError: org/apache ...
NoClassDefFoundError : org/apache/log4j/Logger error in Java application. In most cases, this issue will go away as soon as you add the log4j.jar file...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Upon using OkHttp3Downloader, the issue solved for me.
Thanks,
I did try changing to OkHttp3Downloader and using
compile 'com.squareup.okhttp3:okhttp:3.4.1'and the problem persists.
After tried a lot of combinations I found this:
Thanks for your time.