amplitude / amplitude/Amplitude-ReactNative

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

Aperta
#157 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
87
Fork
21
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.