Open nilTheDev opened 3 years ago
I got the answer to the issue here. Android by default does not allow http
connection anymore. To make it work android:usesCleartextTraffic="true"
this line should be included in the manifest. May I go on and add it to the documentation?
I got same error Failed to connect or obtain data, status code: -1
with android:usesCleartextTraffic="true"
and found out another solution here:
https://medium.com/@mustafayanik/how-to-fix-android-glide-ssl-exception-ab9b2c4dbada
Maybe it's just a workaround solution, but it works for me.
It's an old URL, a simple fix is to just change the url in the example to https.
It's not really something you should fix otherwise, everyone should use https.
Glide Version: 4.12.0
Integration libraries: N/A
Device/Android Version: Pixel_3a_API_28_x86 (Emulator)
Issue details / Repro steps / Use case background:
It's my first time with Glide. Haven't tried any other image loading library ever.
I have tried the first example the
README
provides. But it didn't work.It shows nothing on the screen. And the logs aren't of much help to me.
I guess the
Cleartext HTTP traffic to goo.gl not permitted
log is the root cause of the problem. It has something to do withhttp
andhttps
.After some research, I converted the
url
intouri
with thehttps
scheme.And it worked perfectly.
I am wondering whether this issue is specific to my build environment? If so then what's the problem exactly? Or it happens with other developers as well? If so then why does the documentation use this as the first example?
Glide load line /
GlideModule
(if any) / list Adapter code (if any):Layout XML:
Stack trace / LogCat: