aws-amplify / aws-sdk-android

AWS SDK for Android. For more information, see our web site:
https://docs.amplify.aws
Other
1.02k stars 548 forks source link

Crash: java.lang.SecurityException Package android does not belong to 10347 #3580

Open n0vah opened 1 month ago

n0vah commented 1 month ago

Describe the bug Some users on Android 11 and usually on background have crash SecurityException in EventRecorder.isNetworkAvailable

Stack trace

Fatal Exception: java.lang.SecurityException: Package android does not belong to 10347
       at android.os.Parcel.createExceptionOrNull(Parcel.java:2373)
       at android.os.Parcel.createException(Parcel.java:2357)
       at android.os.Parcel.readException(Parcel.java:2340)
       at android.os.Parcel.readException(Parcel.java:2282)
       at android.net.IConnectivityManager$Stub$Proxy.getNetworkCapabilities(IConnectivityManager.java:2543)
       at android.net.ConnectivityManager.getNetworkCapabilities(ConnectivityManager.java:1415)
       at com.amazonaws.mobileconnectors.pinpoint.internal.event.EventRecorder.isNetworkAvailable(EventRecorder.java:698)
       at com.amazonaws.mobileconnectors.pinpoint.internal.event.EventRecorder.access$100(EventRecorder.java:77)
       at com.amazonaws.mobileconnectors.pinpoint.internal.event.EventRecorder$1.run(EventRecorder.java:255)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:923)

Which AWS service(s) are affected?

Screenshots image

Environment Information (please complete the following information):

mattcreaser commented 1 month ago

Thank you for the report @n0vah. We will have a look at this issue.

tylerjroach commented 2 weeks ago

This appears to be an Android 11 bug. We will look to try/catch around the Android ConnectivityManager to avoid this crash. https://issuetracker.google.com/issues/175055271?pli=1