4

We have built an application and recently we have added com.google.android.gms.analytics.CampaignTrackingReceiver the default receiver in the manifest to auto capture the install sources medium etc.

We have a strange issue here. Every time we download the application, it crashes for the first time. Below is the logs.

Caused by java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.analytics.CampaignTrackingReceiver" on path: DexPathList[[zip file "/data/app/YOURPACKAGENAME--w6LGEcDlZ0B12LlUiobEQ==/base.apk"],nativeLibraryDirectories=[/data/app/YOURPACKAGENAME--w6LGEcDlZ0B12LlUiobEQ==/lib/arm, /data/app/YOURPACKAGENAME--w6LGEcDlZ0B12LlUiobEQ==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at android.app.ActivityThread.handleReceiver(ActivityThread.java:3229) at android.app.ActivityThread.-wrap17(Unknown Source) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1722) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:176) at android.app.ActivityThread.main(ActivityThread.java:6656) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

Below is the google, firebase related libraries added in build.gradle.

compile project(':react-native-firebase')

compile "com.google.android.gms:play-services-base:16.0.1"

compile "com.google.firebase:firebase-core:16.0.4"

compile "com.google.firebase:firebase-analytics:16.0.4"

apply plugin: 'com.google.gms.google-services'

All firebase events have been tracked as expected. How to solve the above crash?

Pruthvi
  • 590
  • 4
  • 22

1 Answers1

1

Most likely your production build is being stripped of some classes by your Proguard config.

Se if adding this in your proguard-pro file works:

-keep class com.google.android.gms.analytics { *; }
sebastianf182
  • 9,844
  • 3
  • 34
  • 66