Skip to content

Provide better error reporting around UnsatisfiedLinkError #5149

Closed

Description

@jonpryor

Context: xamarin/Xamarin.Forms#12218

"Sometimes," an app launch crashes with an UnsatisfiedLinkError, e.g.

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)

Part of what's irksome about these crashes is we don't know why they happen. Historically, the most probable cause is that "something went wrong" around the App installation, and e.g. libmonodroid.so wasn't extracted from the .apk (out of disk space?).

Feature request: update MonoPackageManager.LoadApplication() to catch UnsatifisedLinkError (and others), and do some "diagnostics" so that we can get a better understanding of how it's failing.

  • What library is being loaded?
  • Can we probe the filesystem to see if it exists?
  • Any other "sanity checks"?

Then, with said diagnostic information, can we:

  1. "Somehow ensure" that we can send this diagnostic information to the Google Play Console?
  2. Provide a more "actionable" error message to the user? Perhaps simply deleting & reinstalling the app would be sufficient?

I suspect (2) will need to wait until after we have (1).

Activity

  1. jonpryor commented on Sep 24, 2020

    @jonpryor
    ContributorAuthor

    @jonathanpeppers is helping to investigate this, and as part of that submitted an app to the Google Play Store which deliberately crashes.

    The Google Play Console crash logs are the same as those described in xamarin/Xamarin.Forms#12218: an exception type, exception stack trace, but no message content, no adb logcat, nothing else.

    While we further explore what, if anything, can be done from the Google Play Console side of things, I tried asking for thoughts on #android-dev on freenode.net. The main suggestion: use an actual dedicated crash reporter framework, such as Firebase Crashlytics.

    In the (potential) absence of any Good way to make the Google Play Console useful, maybe we should instead ensure that Xamarin.Android works sanely/properly with Firebase Crashlytics and others, and then direct our customers to use crash reporters to help diagnose app crashes.

  2. added this to the Under Consideration milestone on Sep 29, 2020
  3. jonathanpeppers commented on Oct 26, 2020

    @jonathanpeppers
    Member

    Using the latest Xamarin.Firebase.Crashlytics, I was able to get crash reports of UnsatisfiedLinkError on startup.

    There were a couple manual steps we could improve:

    1. Add <PackageReference Include="Xamarin.Google.Dagger" Version="2.25.2.1" />, filed: Xamarin.Firebase.Crashlytics Java.Lang.NoSuchMethodError xamarin/GooglePlayServicesComponents#393
    2. Add <string name="com.crashlytics.android.build_id">1</string> to strings.xml
    3. Reorder the content providers so crashlytics runs first: jonathanpeppers/xamarin-crashes@84756c9

    After this, I was able to see my addition of System.loadLibrary("ibrokeyou");:

    image

  4. added
    enhancement
    and removed on Dec 1, 2022
  5. added a commit that references this issue on Aug 11, 2026
    04e2fc9
  6. locked and limited conversation to collaborators on Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions