RuntimeException: Unable to instantiate receiver com.google.android.gms.measurement.AppMeasurementIn

NielsCupNielsCup NLMember ✭✭✭
edited May 2017 in Xamarin.Android

Hi, I encounter the error below on first startup when installing our Android app from the Google Play store. I can reproduce this error if I download the app from the store on my Samsung S7. The app crashes the first time it is opened, if I open it again the app runs fine. I have multidex and proguard enabled. If I disable proguard the error is gone so I suppose there is something missing in our proguard configuration. I have tried several configurations and currently it looks like below. Is there anything missing in my configuration file, or could this error be caused by something else?

Error:

textjava.lang.RuntimeException: Unable to instantiate receiver com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver" on path: DexPathList[[zip file "/data/app/com.rapp.planning-1/base.apk"],nativeLibraryDirectories=[/data/app/com.rapp.planning-1/lib/arm, /vendor/lib, /system/lib]]
    at android.app.ActivityThread.handleReceiver(ActivityThread.java:3100)
    at android.app.ActivityThread.access$1800(ActivityThread.java:181)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1553)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:6134)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
    Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver" on path: DexPathList[[zip file "/data/app/com.rapp.planning-1/base.apk"],nativeLibraryDirectories=[/data/app/com.rapp.planning-1/lib/arm, /vendor/lib, /system/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    at android.app.ActivityThread.handleReceiver(ActivityThread.java:3095)

Proguard configuration:

# Custom Proguard configurations.

-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
    public static final *** NULL;
}

-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
    @com.google.android.gms.common.annotation.KeepName *;
}

-keepnames class * implements android.os.Parcelable {
    public static final ** CREATOR;
}

-keepclassmembers class * implements android.os.Parcelable {
    static ** CREATOR;
}

-keep public class com.google.android.gms.* { public *; }
-dontwarn com.google.android.gms.**
-keepnames class com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver

Best Answer

Answers

Sign In or Register to comment.