mixpanel / mixpanel-android

Official Android Tracking Library for Mixpanel Analytics
http://mixpanel.com/
Apache License 2.0
1.02k stars 365 forks source link

how to disable install track #754

Closed yangcheng closed 2 years ago

yangcheng commented 3 years ago

Hi, I am using a mixpanel for my app but I don't need to use installrefer for my case, however, if I remove implementation 'com.android.installreferrer:installreferrer:2.2' from my build.gradle, I got errors when I try to call mixpanel API to just capture event. Is there a way to use mixpanel API without adding installreferrer:installreferrer dependency ?

I am tried 5.9 and 6.0-beta-1, all have same issue. Thanks

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:253)
    at com.mixpanel.android.mpmetrics.MixpanelAPI ai.dongmi.barbell.manager.EventTrackingManager$mixpanel$2.invoke() (EventTrackingManager.kt:30)
    at java.lang.Object ai.dongmi.barbell.manager.EventTrackingManager$mixpanel$2.invoke() (EventTrackingManager.kt:29)
    at java.lang.Object kotlin.SynchronizedLazyImpl.getValue() (LazyJVM.kt:74)
    at com.mixpanel.android.mpmetrics.MixpanelAPI ai.dongmi.barbell.manager.EventTrackingManager.getMixpanel() (EventTrackingManager.kt:29)
zihejia commented 3 years ago

hi @yangcheng , thanks for bringing it up! Is there any concern not to include implementation 'com.android.installreferrer:installreferrer:2.2'? We are actually considering deprecating the install track feature and we'd like to get any feedback.

yangcheng commented 3 years ago

sorry for late reply, we had a national holiday last week. I don't have concerns, I'd prefer a framework where I only include what I actually use. so if I don't use installrefer, then I should be allowed not to include it but still able to capture normal event

Is there any concern not to include implementation 'com.android.installreferrer:installreferrer:2.2'

The only concern is the error message. I am not sure if it's a real error or just a FYI warning.

zihejia commented 2 years ago

Hi @yangcheng , we have released v6.0.0 which no longer contains this feature anymore so it should be good. I'm closing this one now.

yangcheng commented 2 years ago

thanks! ugprading now