Hi @DylanVann ,
I used this library in my app and it's work well on debug mode but, after create release apk and install on device app crashed without any error when I navigate to page include fast image. (I comment fast image on that pages and app works without any problem)
Can you help me to fix this? Are you any Verbose mode for see some logs in release mode and find problem?
Also this is my react and react-native and fast image version:
"react": "16.3.1",
"react-native": "0.55.1",
"react-native-fast-image": "^4.0.0",
"react-native-image-progress": "^1.1.0",
Update: I see my logcat and find this error:
628 E AndroidRuntime: Caused by: java.lang.RuntimeException: Unable to instantiate GlideModule implementation for class com.dylanvann.fastimage.OkHttpProgressGlideModule
04-10 13:55:13.679 628 628 E AndroidRuntime: at com.bumptech.glide.module.ManifestParser.parseModule(ManifestParser.java:53)
04-10 13:55:13.679 628 628 E AndroidRuntime: at com.bumptech.glide.module.ManifestParser.parse(ManifestParser.java:30)
04-10 13:55:13.679 628 628 E AndroidRuntime: at com.bumptech.glide.Glide.parseGlideModules(Glide.java:187)
04-10 13:55:13.679 628 628 E AndroidRuntime: at com.bumptech.glide.Glide.get(Glide.java:166)
04-10 13:55:13.679 628 628 E AndroidRuntime: at com.bumptech.glide.RequestManager.<init>(RequestManager.java:62)
04-10 13:55:13.679 628 628 E AndroidRuntime: at com.bumptech.glide.RequestManager.<init>(RequestManager.java:53)
04-10 13:55:13.679 628 628 E AndroidRuntime: at com.bumptech.glide.manager.RequestManagerRetriever.getApplicationManager(RequestManagerRetriever.java:73)
04-10 13:55:13.679 628 628 E AndroidRuntime: at com.bumptech.glide.manager.RequestManagerRetriever.get(RequestManagerRetriever.java:95)
04-10 13:55:13.679 628 628 E AndroidRuntime: at com.bumptech.glide.Glide.with(Glide.java:657)
04-10 13:55:13.679 628 628 E AndroidRuntime: at com.dylanvann.fastimage.FastImageViewManager.setSrc(FastImageViewManager.java:153)
04-10 13:55:13.679 628 628 E AndroidRuntime: ... 23 more
04-10 13:55:13.679 628 628 E AndroidRuntime: Caused by: java.lang.InstantiationException: java.lang.Class<com.dylanvann.fastimage.OkHttpProgressGlideModule> has no zero argument constructor
04-10 13:55:13.679 628 628 E AndroidRuntime: at java.lang.Class.newInstance(Native Method)
04-10 13:55:13.679 628 628 E AndroidRuntime: at com.bumptech.glide.module.ManifestParser.parseModule(ManifestParser.java:51)
Maybe Related:
I also try to add below lines to /android/app/proguard-rules.pro file (based on #96) but It's not working for me:
-keep public class com.dylanvann.fastimage.* { public *; }
-dontwarn com.dylanvann.fastimage.**
@hawkup, @DylanVann guys are you any suggestion?
I to add below lines to /android/app/proguard-rules.pro file (based on #110) and It's working for me:
-keep public class com.dylanvann.fastimage.* {*;}
-keep public class com.dylanvann.fastimage.** {*;}
@DylanVann Please add this note or other setting that required to ReadMe file.
/CC: @barghi
Done, thanks for figuring this out @mnlbox
https://github.com/DylanVann/react-native-fast-image/blob/master/README.md#proguard
I to add below lines to /android/app/proguard-rules.pro file (based on #110) and It's not working for me:
-keep public class com.dylanvann.fastimage.* {;}
-keep public class com.dylanvann.fastimage.* {*;}
I have added the following lines in my app and seems the issue is gone:
-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 *;
}
I am not sure may be the docs shall be updated here.
I can confirm what @oneroman posted works.
Most helpful comment
I have added the following lines in my app and seems the issue is gone:
I am not sure may be the docs shall be updated here.