picasso: Error 504 when get image
Couldn’t get picture from pixabay.com.
Picasso.get().load("https://cdn.pixabay.com/photo/2018/05/03/00/54/blue-butterfly-flower-3370200_150.jpg").into(view);
This code returned error HTTP 504.
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 31
- Comments: 23
This is due to some network security mechanism in Android Pie. Found a solution here: https://stackoverflow.com/questions/51902629/how-to-allow-all-network-connection-types-http-and-https-in-android-9-pie
Uninstalling the app and installing it again, is crazy but works!
android:usesCleartextTraffic=“true” try to add this in your manifest file if you are running in Android 9 or above. Default value in Android P is “false”setting this to true indicates that the app intends to use clear network traffic.
I have the same problem, but only on old device - Lg LS620 (android 4.4.2). Picasso version ‘com.squareup.picasso:picasso:2.71828’.
Tested urls: https://vignette.wikia.nocookie.net/jamesbond/images/d/dc/James_Bond_%28Pierce_Brosnan%29_-_Profile.jpg/revision/latest?cb=20130506224906 https://ksassets.timeincuk.net/wp/uploads/sites/55/2017/08/GettyImages-496903944-920x584.jpg
P.S. Small images load perfect.
I’m finding de same problem @R12rus with old devices Samsung 4.4.2 and the same version 2.71828 with “https”
I tried with this code but not works, maybe I’m wrong on something
Any ideas, How can We fix this? @JakeWharton // Sorry to mention you
Thanks so much!
Thanks man i’ve been trying to solve it for 5 hours LOL
Hi there, everyone!
<application … android:usesCleartextTraffic=“true”> worked for me too!
<application … android:usesCleartextTraffic=“true”> worked for me
I had the same error and i found out that there was a problem with the self-signed certificate from the server.
So my solution was to add a custom SSLSocketFactory to allow all certificates.
@Marcelo-Petrucelli How does allowing cleartext work when both of those URLs are https?