safe_device icon indicating copy to clipboard operation
safe_device copied to clipboard

ANR triggered by main thread waiting for too long (AGAIN)

Open TheManuz opened this issue 1 year ago • 3 comments

This is similar to #37 , but the cause is LocationsAssistant.java, not an external package.

This happened on version 1.1.5, but looking at the commits for version 1.1.6, I'm sure this happens on 1.1.6 too.

I detected this through Crashlytics logs (sadly on my production app!).

This is the stacktrace:

main (timed waiting):tid=1 systid=28436 
       at jdk.internal.misc.Unsafe.park(Native method)
       at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:717)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1074)
       at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:276)
       at com.google.android.gms.internal.location.zzey.zza(com.google.android.gms:play-services-location@@21.1.0:3)
       at com.google.android.gms.internal.location.zzbb.getLocationAvailability(com.google.android.gms:play-services-location@@21.1.0:11)
       at com.xamdesign.safe_device.MockLocation.LocationAssistant.checkLocationAvailability(LocationAssistant.java:519)
       at com.xamdesign.safe_device.MockLocation.LocationAssistant.acquireLocation(LocationAssistant.java:468)
       at com.xamdesign.safe_device.MockLocation.LocationAssistant.access$000(LocationAssistant.java:41)
       at com.xamdesign.safe_device.MockLocation.LocationAssistant$1.run(LocationAssistant.java:462)
       at android.os.Handler.handleCallback(Handler.java:942)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:240)
       at android.os.Looper.loop(Looper.java:351)
       at android.app.ActivityThread.main(ActivityThread.java:8423)
       at java.lang.reflect.Method.invoke(Native method)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)

TheManuz avatar Apr 10 '24 08:04 TheManuz

I found this problem too. Only on Android devices. We had to remove this package from our app, unnafortunately...

       at jdk.internal.misc.Unsafe.park(Native method)
       at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:717)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1074)
       at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:276)
       at com.google.android.gms.internal.location.zzey.zza(unavailable:15)
       at com.google.android.gms.internal.location.zzbb.getLocationAvailability(unavailable:57)
       at com.xamdesign.safe_device.MockLocation.LocationAssistant.checkLocationAvailability(LocationAssistant.java:18)
       at com.xamdesign.safe_device.MockLocation.LocationAssistant.acquireLocation(LocationAssistant.java:166)
       at com.xamdesign.safe_device.MockLocation.LocationAssistant.access$000(LocationAssistant.java)
       at com.xamdesign.safe_device.MockLocation.LocationAssistant$1.run(LocationAssistant.java:2)
       at android.os.Handler.handleCallback(Handler.java:942)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:201)
       at android.os.Looper.loop(Looper.java:288)
       at android.app.ActivityThread.main(ActivityThread.java:8010)
       at java.lang.reflect.Method.invoke(Native method)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:566)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:957)

fdornelasx avatar Apr 10 '24 19:04 fdornelasx

Hello, did you try build release apk and try again ?

can you share your device info ?

did you try other one device ?

ufukhawk avatar Apr 22 '24 23:04 ufukhawk

Didn't happened on my device, it happened in my production app, and I've got the log through Crashlytics.

Devices involved:

  • OnePlus Nord2 5G
  • Redmi Note 9S
  • Redmi Note 9 Pro
  • Oppo A53s
  • Samsung Galaxy A22 5G

Android versions involved:

  • Android 12
  • Android 13

TheManuz avatar Apr 23 '24 07:04 TheManuz

safe_device: ^1.1.8

ufukhawk avatar Aug 20 '24 07:08 ufukhawk

Still happening on safe_device 1.1.8

rpekarek-tc avatar Sep 20 '24 19:09 rpekarek-tc