Rejecting re-init on previously-failed class java.lang.Class<com.mixpanel.android.mpmetrics.InstallReferrerPlay>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/android/installreferrer/api/InstallReferrerStateListener; #746
Description
simple app with mixpanel shows the exception written below in the log (app doesn't crash).
app is only using: implementation "com.mixpanel.android:mixpanel-android:5.9.1"
the exception is shown on multiple Android 9 devices (OnePlus 6T, and Samsung Galaxy 9). Android 10 pixel device did not show the exception in the log.
this adds risk to our main app in case we upgrade from mixpanel 4.9.0 to 5.9.1 as we are not sure the implications of such a problem on various devices.
MainActivity code:
package ;
import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
import com.mixpanel.android.mpmetrics.MixpanelAPI;
public class MainActivity extends Activity {
@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String projectToken = ;
MixpanelAPI mixpanel = MixpanelAPI.getInstance(this, projectToken);
LinearLayout layout = new LinearLayout(this);
setContentView(layout);
}
}
Stack Trace in log:
I/emptyandroidap: Rejecting re-init on previously-failed class java.lang.Class<com.mixpanel.android.mpmetrics.InstallReferrerPlay>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/android/installreferrer/api/InstallReferrerStateListener;
at com.mixpanel.android.mpmetrics.MixpanelAPI com.mixpanel.android.mpmetrics.MixpanelAPI.getInstance(android.content.Context, java.lang.String) (MixpanelAPI.java:536)
at void com.appdome.emptyandroidapp.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:22)
at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7149)
at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7140)
at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1288)
at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:3017)
at android.app.Activity android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.app.servertransaction.PendingTransactionActions, android.content.Intent) (ActivityThread.java:3172)
at void android.app.servertransaction.LaunchActivityItem.execute(android.app.ClientTransactionHandler, android.os.IBinder, android.app.servertransaction.PendingTransactionActions) (LaunchActivityItem.java:78)
at void android.app.servertransaction.TransactionExecutor.executeCallbacks(android.app.servertransaction.ClientTransaction) (TransactionExecutor.java:108)
at void android.app.servertransaction.TransactionExecutor.execute(android.app.servertransaction.ClientTransaction) (TransactionExecutor.java:68)
at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1906)
at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
at void android.os.Looper.loop() (Looper.java:193)
at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6863)
at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:537)
at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:858)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.android.installreferrer.api.InstallReferrerStateListener" on path: DexPathList[[zip file "/data/app/com.appdome.emptyandroidapp-VGDro4zyNKp0250HvrB2zg==/base.apk"],nativeLibraryDirectories=[/data/app/com.appdome.emptyandroidapp-VGDro4zyNKp0250HvrB2zg==/lib/arm64, /system/lib64]]
at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:169)
at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
at com.mixpanel.android.mpmetrics.MixpanelAPI com.mixpanel.android.mpmetrics.MixpanelAPI.getInstance(android.content.Context, java.lang.String) (MixpanelAPI.java:536)
at void com.appdome.emptyandroidapp.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:22)
at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7149)
at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7140)
at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1288)
at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:3017)
at android.app.Activity android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.app.servertransaction.PendingTransactionActions, android.content.Intent) (ActivityThread.java:3172)
at void android.app.servertransaction.LaunchActivityItem.execute(android.app.ClientTransactionHandler, android.os.IBinder, android.app.servertransaction.PendingTransactionActions) (LaunchActivityItem.java:78)
at void android.app.servertransaction.TransactionExecutor.executeCallbacks(android.app.servertransaction.ClientTransaction) (TransactionExecutor.java:108)
at void android.app.servertransaction.TransactionExecutor.execute(android.app.servertransaction.ClientTransaction) (TransactionExecutor.java:68)
at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1906)
at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
at void android.os.Looper.loop() (Looper.java:193)
at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6863)
at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:537)
at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:858)
Activity