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

App crashed on release mode #180

Closed
mnlbox opened this issue Apr 9, 2018 · 6 comments
Closed

App crashed on release mode #180

mnlbox opened this issue Apr 9, 2018 · 6 comments

Comments

@mnlbox
Copy link

mnlbox commented Apr 9, 2018

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:

@mnlbox
Copy link
Author

mnlbox commented Apr 10, 2018

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?

@mnlbox
Copy link
Author

mnlbox commented Apr 10, 2018

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

@DylanVann
Copy link
Owner

Done, thanks for figuring this out @mnlbox

https://github.com/DylanVann/react-native-fast-image/blob/master/README.md#proguard

@cgaof
Copy link

cgaof commented Nov 29, 2018

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.** {
;}

@oneroman
Copy link

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.

@saghul
Copy link

saghul commented Dec 6, 2018

I can confirm what @oneroman posted works.

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