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

[android] App crashing in release mode as soon as we enable proguard #157

Open
vinitraj10 opened this issue Mar 17, 2023 · 2 comments
Open

Comments

@vinitraj10
Copy link

The build works fine in the debug mode, but as soon as we enable the proguard, we have started getting the following exception and app is crashing right away, can someone suggest the right proguard rules to avoid this issue.

java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
  at com.amplitude.reactnative.AmplitudeReactNativeModule.setServerZone(Unknown Source:7)
  at java.lang.reflect.Method.invoke(Native Method)
  at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source:148)
  at com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source:147)
  at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
  at android.os.Handler.handleCallback(Handler.java:873)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source:0)
  at android.os.Looper.loop(Looper.java:193)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(Unknown Source:37)
  at java.lang.Thread.run(Thread.java:764)

I have tried adding below proguard rules on top of what mentioned in the documentation to avoid any obfuscation of classes which might be stopping to invoke this method

-keep class com.amplitude.** {*;}

But it does not seems to be working.

@farellsujanto
Copy link

Do you have -keep class com.google.android.gms.ads.** { *; } in your proguard rules?

@vinitraj10
Copy link
Author

Yes i have explicitly added this rule to my pro-guard rules.

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

2 participants