Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANR due to Mixpanel#getInstance #831

Open
arunsudharsan opened this issue Mar 15, 2024 · 1 comment
Open

ANR due to Mixpanel#getInstance #831

arunsudharsan opened this issue Mar 15, 2024 · 1 comment

Comments

@arunsudharsan
Copy link

at jdk.internal.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:194)
  at java.util.concurrent.FutureTask.awaitDone (FutureTask.java:447)
  at java.util.concurrent.FutureTask.get (FutureTask.java:190)
  at com.mixpanel.android.mpmetrics.PersistentIdentity.getTimeEvents (PersistentIdentity.java:292)
  at com.mixpanel.android.mpmetrics.MixpanelAPI.<init> (MixpanelAPI.java:158)
  at com.mixpanel.android.mpmetrics.MixpanelAPI.<init> (MixpanelAPI.java:123)
  at com.mixpanel.android.mpmetrics.MixpanelAPI.getInstance (MixpanelAPI.java:505)
  at com.mixpanel.android.mpmetrics.MixpanelAPI.getInstance (MixpanelAPI.java:278)
  at com.meesho.supply.di.modules.AnalyticsModule.provideSupplierMixpanelApi (AnalyticsModule.java:38)
  at com.meesho.supply.di.modules.AnalyticsModule_ProvideSupplierMixpanelApiFactory.provideSupplierMixpanelApi (AnalyticsModule_ProvideSupplierMixpanelApiFactory.java:45)
  at com.meesho.supply.main.DaggerSupplyApplication_HiltComponents_SingletonC$SingletonCImpl.supplierMixpanelMixpanelAPI (DaggerSupplyApplication_HiltComponents_SingletonC.java:8358)
  at com.meesho.supply.main.DaggerSupplyApplication_HiltComponents_SingletonC$SingletonCImpl$SwitchingProvider.get0 (DaggerSupplyApplication_HiltComponents_SingletonC.java:9240)
  at com.meesho.supply.main.DaggerSupplyApplication_HiltComponents_SingletonC$SingletonCImpl$SwitchingProvider.get (DaggerSupplyApplication_HiltComponents_SingletonC.java:10187)
  at dagger.internal.DoubleCheck.get (DoubleCheck.java:47)
  at com.meesho.supply.main.DaggerSupplyApplication_HiltComponents_SingletonC$SingletonCImpl.provideSupplierMixpanelDispatcher (DaggerSupplyApplication_HiltComponents_SingletonC.java:8362)
  at com.meesho.supply.main.DaggerSupplyApplication_HiltComponents_SingletonC$SingletonCImpl.mapOfByteAndDispatcher (DaggerSupplyApplication_HiltComponents_SingletonC.java:8402)
  at com.meesho.supply.main.DaggerSupplyApplication_HiltComponents_SingletonC$SingletonCImpl$SwitchingProvider.get0 (DaggerSupplyApplication_HiltComponents_SingletonC.java:9225)
  at com.meesho.supply.main.DaggerSupplyApplication_HiltComponents_SingletonC$SingletonCImpl$SwitchingProvider.get (DaggerSupplyApplication_HiltComponents_SingletonC.java:10187)
  at dagger.internal.SingleCheck.get (SingleCheck.java:49)
  at com.meesho.supply.main.DaggerSupplyApplication_HiltComponents_SingletonC$SingletonCImpl.injectSupplyApplication2 (DaggerSupplyApplication_HiltComponents_SingletonC.java:9181)
  at com.meesho.supply.main.DaggerSupplyApplication_HiltComponents_SingletonC$SingletonCImpl.injectSupplyApplication (DaggerSupplyApplication_HiltComponents_SingletonC.java:9104)
  at com.meesho.supply.main.Hilt_SupplyApplication.hiltInternalInject (Hilt_SupplyApplication.java:52)
  at com.meesho.supply.main.Hilt_SupplyApplication.onCreate (Hilt_SupplyApplication.java:43)
  at com.meesho.supply.main.SupplyApplication.onCreate (SupplyApplication.kt:92)
  at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1261)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:7311)

We are also facing this issue during the init.

Upon debugging found that the method PersistentIdentity.getTimeEvents() is utilized for retrieving a map containing event names mapped to their respective start times, represented in milliseconds since epoch. This map is subsequently stored within the variable mEventTimings.

Mixpanel#getInstance is suggested to be called from the main thread as per the doc :
"The best practice is to call getInstance, and use the returned MixpanelAPI, object from a single thread (probably the main UI thread of your application)."
But this blocking IO call is happening on the main thread.

Screenshot 2024-03-15 at 2 26 19 PM
@arunsudharsan arunsudharsan changed the title ANR on Mixpanel#getInstance ANR due to Mixpanel#getInstance Mar 15, 2024
@RngNoah
Copy link

RngNoah commented Apr 8, 2024

I also encountered this problem, the version I am using is 7.3.1. Is anyone dealing with this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants