Closed vladp closed 6 years ago
wanted to check to see if others are successful in following this article https://futurestud.io/tutorials/glide-module-example-accepting-self-signed-https-certificates, or there other alternatives (for me, the recommendation there, causes the above error in the release mode)
It definitely seems like a proguard issue. It looks like your proguard config for Glide's classes at least matches what I'd expect.
It's probably that one of the other rules is causing some optimization or change that Glide doesn't expect. You could try adding rules to keep the generated class explicitly, though that isn't usually necessary.
The exception is thrown for one of the causes here: https://github.com/bumptech/glide/blob/914996cac11108ec1a02c21a10af53ebc4980d7f/library/src/main/java/com/bumptech/glide/Glide.java#L294. You might be able to narrow down which one by looking at the deobfuscated cause of the exception.
@sjudd thank you for the follow up. Indeed, my proguard caused this.
after some trial/error, I removed
-repackageclasses ''
and I now passed that error.
Have you changed annotationProcessor
dependency:
implementation 'com.github.bumptech.glide:glide:4.10.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'
Have you added proguard rules as follow:
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
Hope it will helps you. Thank you.
Glide Version: 4.7.1 Integration libraries: Okhttp 3.11.0 (via retrofit 2.4.0)
Device/Android Version: Android emulator API 27 (not testing on any particular device yet)
Issue details / Repro steps / Use case background: I am using self-signed certificates. To implement this, I have a custom OkHTTP client that manages these self signed certiciates explicity for the HTTPS connection. I am also using React-native (you will see it in pro-guard rules).
My code is following the exact example here (as was suggested in other replies on this subject):
https://futurestud.io/tutorials/glide-module-example-accepting-self-signed-https-certificates
I am getting an error, in Release mode only (in debug I do not get this)
If I disable the Module code, and use just Glide (not GlideApp that is generated by the annotation) -- I stop getting the error, but then, obviously I do not get any images -- as Glide cannot negotiate a connection to my backend without the custom OkHttpClient.
My Module code:
Pro-guard.rules
Gradle dependencies section:
Versions