xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

[Bug] Google Play reports java.lang.UnsatisfiedLinkError crashes #12218

Closed holecekp closed 3 years ago

holecekp commented 4 years ago

Description

I have looked into the Crashes and ANRs section of the Google Play Console and found 10 crash reports there. For 6 of them, the stack trace is as follows:

java.lang.UnsatisfiedLinkError
  at java.lang.Runtime.loadLibrary0 (Runtime.java:1067)
  at java.lang.Runtime.loadLibrary0 (Runtime.java:1007)
  at java.lang.System.loadLibrary (System.java:1667)
  at mono.MonoPackageManager.LoadApplication (Unknown Source:195)
  at mono.MonoRuntimeProvider.attachInfo (Unknown Source:41)
  at android.app.ActivityThread.installProvider (ActivityThread.java:6983)
  at android.app.ActivityThread.installContentProviders (ActivityThread.java:6528)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6445)
  at android.app.ActivityThread.access$1300 (ActivityThread.java:219)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1859)
  at android.os.Handler.dispatchMessage (Handler.java:107)
  at android.os.Looper.loop (Looper.java:214)
  at android.app.ActivityThread.main (ActivityThread.java:7356)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:930)

there are other 4 similar crash reports with slightly different stack trace:

java.lang.UnsatisfiedLinkError: 
  at java.lang.Runtime.loadLibrary0 (Runtime.java:1011)
  at java.lang.System.loadLibrary (System.java:1657)
  at mono.MonoPackageManager.LoadApplication (Unknown Source:221)
  at mono.MonoRuntimeProvider.attachInfo (Unknown Source:41)
  at android.app.ActivityThread.installProvider (ActivityThread.java:6239)
  at android.app.ActivityThread.installContentProviders (ActivityThread.java:5805)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:5722)
  at android.app.ActivityThread.-wrap1 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1656)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:164)
  at android.app.ActivityThread.main (ActivityThread.java:6494)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:438)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:807)

Total occurrences: 10 Number of affected users: 4 (but my application has less than 100 instals, so 4 affected users are a serious number!) OS: Android 10, Android 8.1 Device: Google Pixel 3 XL, LGE Nexus 5X Xamarin.Forms version:

I am using Microsoft AppCenter.Crashes and there is no report there. Maybe the crash happened at startup before AppCenter has been loaded.

One more important fact - Google Play Console applies a filter called "Installed from: Google Play" on the page with the crash listings. To see these crashes, I had to deactivate this filter. I am not sure what this filter means. I distribute this package only through Google Play (I have version for AppGallery but it has a different package name). I am the only person who has access to the source codes and the resulting AAB package. So there is no other way to acquire it besides Google Play. Could this option mean that the user uninstalled the app? Or maybe that the installation has not been completed because of the crash? I am just guessing.

Steps to Reproduce

I am not able to reproduce the crashes. It probably affects only some devices. I am testing each version before releasing it thoroughly:

I have found no problems. Because the crashes are either random or connected to a specific set of devices, I am not able to reproduce the bug, nor create a repro project for it.

I have found a similar issue form 2018 : https://github.com/xamarin/Xamarin.Forms/issues/3785 The issue has not been solved. It was closed because no repro project was provided. But the issue mentioned a very old Android version so maybe it is a different case.

Basic Information

jonpryor commented 4 years ago

@holecekp: Does the Google Play Console provide any adb logcat output around the crash? Or any other information? Or does the Google Play Console only provide the unhandled exception stack trace?

holecekp commented 4 years ago

Unfortunately, no other information is available (only the error message, stack trace, device, OS Version, application version and dates).

holecekp commented 4 years ago

I have tried to investigate if the crash happens during app usage, installation, or update. My conclusion is that the error probably affects new installations.

I am using Microsoft AppCenter.Crashes. It does not contain any information about these crashes. So the crash probably happened before AppCenter was loaded (startup, or installation)

According to the crash reports, the devices that crashed were Google Pixel 3 XL and LGE Nexus 5X in case of my app. I looked at the usage statistics in Google Play Console. These two devices were not listed among active devices the days before the crashes. So this rules out updates. It must have been new installations.

The Google Play contains also statistics on installation and uninstallation events. You can filter by dates and devices. The two crashing devices are not there. So probably, only successful installation events are recorded.

I also checked that these two devices are not among the devices that were used for automatic pre-release testing. They were not, so it must have been devices of real useres that tried to download the app.

Based on these facts, I think that some users are not able to install the application at all.

holecekp commented 3 years ago

These errors are discussed also in the xamarin-android repo. I am closing this issue, because the conclusion is that these errors are form a unofficial pirated versions of the application (https://github.com/xamarin/xamarin-android/issues/4028#issuecomment-726484167). In my case, someone extracted the APKs from a device and uploaded it to apkpure.com.