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

After Updating okhttp to okhttp3 the OkHttpDownloader wont work for Picasso #1256

Closed
ArslanAli7 opened this issue Jan 10, 2016 · 6 comments
Closed

Comments

@ArslanAli7
Copy link

Hello @JakeWharton i have upgraded my project to okhttp3 using
compile 'com.squareup.okhttp3:okhttp:3.0.0-RC1'
,now for image downloading i am using picasso 2.5.2, but for all of the sudden okhttp Downloader is not recognizable by picasso any more, do i need to upgrade picasso library as well in order for it to work with okhttp3,currently i am using gradle build system and do not know much about how to add snapshot to your project,maybe you can help me out here,this is the exception i am getting :
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/squareup/okhttp/OkHttpClient;
at com.squareup.picasso.OkHttpDownloader.defaultOkHttpClient(OkHttpDownloader.java:31)
at com.squareup.picasso.OkHttpDownloader.(OkHttpDownloader.java:76)
at utils.Global.onCreate(Global.java:33)

@JakeWharton
Copy link
Collaborator

You can either use https://github.com/JakeWharton/picasso2-okhttp3-downloader, the latest SNAPSHOT built from master, or just wait until the next release. I would recommend using my standalone Downloader for now, though.

@JakeWharton
Copy link
Collaborator

The Picasso upgrade to OkHttp 3 was #1251.

@ArslanAli7
Copy link
Author

thanks a lot mate,for now, i have integrated the latest snapshot and will update the code with the next release.

@iman2420
Copy link

There is a jar version for this artifact

ghost pushed a commit to facebook/fresco that referenced this issue Jun 13, 2016
Summary:
Current version of Picasso does not support OkHttp3, that cause runtime error.
Added temporary fix according to this: square/picasso#1256
Closes #1291

Reviewed By: oprisnik

Differential Revision: D3424317

Pulled By: kirwan

fbshipit-source-id: c4ab21a1b6fddbb10f6aee25adac73d4747ae4b9
@zenith22
Copy link

zenith22 commented Dec 4, 2017

I am facing this issue on Android 4.4 only, others Android 5+ are working fine.
My server has disabled the support for TLS 1.1 and below, it only supports TLS 1.2 now.
For Android 4.4 i have made the fix as given here.

@JakeWharton
Is the issue related to TLS settings on my server? Why does it work on Android 5+ without making the mentioned OkHttp3Downloader changes?
Could you please confirm.

@pavithra19
Copy link

@zenith22 I tried the solution using the link in your comment. but we are not able to add headers in that solution. Is there any alternative way?

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

5 participants