Skip to content

java.lang.UnsatisfiedLinkError Google Play Console Crash #2292

Closed

Description

@MarvinFrankenfeld

Steps to Reproduce

We have some App Crashes in Google Play in java.lang.UnsatisfiedLinkError at mono.MonoPackageManager.LoadApplication that we don't know how to explain as in backtrace we can not see any relation to our code

Expected Behavior

App loads without any problems during startup

Actual Behavior

App crashes with java.lang.UnsatisfiedLinkError

java.lang.UnsatisfiedLinkError:
at java.lang.Runtime.loadLibrary (Runtime.java:367)
at java.lang.System.loadLibrary (System.java:1076)
at mono.MonoPackageManager.LoadApplication (MonoPackageManager.java:34)
at mono.MonoRuntimeProvider.attachInfo (MonoRuntimeProvider.java:22)
at android.app.ActivityThread.installProvider (ActivityThread.java:5459)
at android.app.ActivityThread.installContentProviders (ActivityThread.java:5011)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:4951)
at android.app.ActivityThread.-wrap1 (ActivityThread.java)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1560)
at android.os.Handler.dispatchMessage (Handler.java:111)
at android.os.Looper.loop (Looper.java:207)
at android.app.ActivityThread.main (ActivityThread.java:5765)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:679)

Version Information

Microsoft Visual Studio Professional 2017
Version 15.8.5
VisualStudio.15.Release/15.8.5+28010.2036
Microsoft .NET Framework
Version 4.7.03056

Installierte Version: Professional

Visual C++ 2017 00369-60000-00001-AA603
Microsoft Visual C++ 2017

Allgemeine Azure-Tools 1.10
Bietet allgemeine Dienste für die Verwendung durch Azure Mobile Services und Microsoft Azure-Tools.

Application Insights-Tools für Visual Studio-Paket 8.13.10627.1
Application Insights-Tools für Visual Studio

ASP.NET and Web Tools 2017 15.8.05085.0
ASP.NET and Web Tools 2017

ASP.NET Core Razor Language Services 15.8.31590
Provides languages services for ASP.NET Core Razor.

ASP.NET Web Frameworks and Tools 2017 5.2.60618.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 15.8.05023.0
Azure App Service Tools v3.0.0

Azure Functions und Webauftragstools 15.8.05023.0
Azure Functions und Webauftragstools

C#-Tools 2.9.0-beta8-63208-01
C#-Komponenten, die in der IDE verwendet werden. Je nach Projekttyp und Einstellungen kann eine andere Compilerversion verwendet werden.

Dotfuscator Professional Edition 4.33.0.6680-ece88ab84
Dotfuscator for Visual Studio. Copyright (C) 2002-2017 PreEmptive Solutions LLC

Extensibility Message Bus 1.1.49 (remotes/origin/d15-8@ee674f3)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

JavaScript-Sprachdienst 2.0
JavaScript-Sprachdienst

Microsoft Azure-Tools 2.9
Microsoft Azure-Tools für Microsoft Visual Studio 2017 – v2.9.10730.2

Microsoft Continuous Delivery Tools für Visual Studio 0.4
Die Konfiguration von Azure DevOps-Pipelines von der Visual Studio-IDE aus wird vereinfacht.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++-Assistenten 1.0
Microsoft Visual C++-Assistenten

Microsoft Visual Studio-Tools für Container 1.1
Jetzt können Sie Ihre ASP.NET Core-Anwendung in der Zielumgebung entwickeln, ausführen und überprüfen. Drücken Sie F5, um die Anwendung direkt in einem Container mit Debugfunktionen auszuführen, oder STRG+F5 zum Bearbeiten und Aktualisieren Ihrer Anwendung, ohne den Container erneut erstellen zu müssen.

MLGen Package Extension 1.0
MLGen Package Visual Studio Extension Detailed Info

Mono Debugging for Visual Studio 4.11.11-pre (8fb558f)
Support for debugging Mono processes with Visual Studio.

NuGet-Paket-Manager 4.6.0
NuGet-Paket-Manager in Visual Studio. Weitere Informationen zu NuGet finden Sie unter "http://docs.nuget.org/".

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

ResourcePackage-Erweiterung 1.0
Detaillierte Informationen zur ResourcePackage-Erweiterung von Visual Studio

ResourcePackage-Erweiterung 1.0
Detaillierte Informationen zur ResourcePackage-Erweiterung von Visual Studio

SQL Server Data Tools 15.1.61808.07020
Microsoft SQL Server Data Tools

Test Adapter for Boost.Test 1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Testadapter für Google Test 1.0
Ermöglicht die Verwendung von Visual Studio-Testtools mit Komponententests, die für Google Test geschrieben wurden. Die Nutzungsbedingungen und Drittanbieterhinweise stehen im Installationsverzeichnis der Erweiterung zur Verfügung.

TypeScript-Tools 15.8.20822.2001
TypeScript-Tools für Microsoft Visual Studio

VC-Paket für Microsoft Visual Studio 1.0
VC-Paket für Microsoft Visual Studio

Visual Basic-Tools 2.9.0-beta8-63208-01
Visual Basic-Komponenten, die in der IDE verwendet werden. Je nach Projekttyp und Einstellungen kann eine andere Version des Compilers verwendet werden.

Visual C++ für plattformübergreifende Mobile-Entwicklung 15.0.27924.00
Visual C++ für plattformübergreifende Mobile-Entwicklung

Visual C++ für plattformübergreifende Mobile-Entwicklung (iOS) 15.0.27825.00
Visual C++ für plattformübergreifende Mobile-Entwicklung (iOS)

Visual F# Tools 10.2 für F# 4.5 15.8.0.0. Commit Hash: 55a3dc3231c95c77f81ee53f7d29152029da7408.
Microsoft Visual F# Tools 10.2 für F# 4.5

Visual Studio-Tools für CMake 1.0
Visual Studio-Tools für CMake

Visual Studio-Tools für Container 1.0
Visual Studio-Tools für Container

Visual Studio Code-Debugadapter-Hostpaket 1.0
Interopebene zum Hosten der Visual Studio Code-Adapter in Visual Studio

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

Xamarin 4.11.0.776 (d15-8@1ae9b59d7)
Visual Studio-Erweiterung, um Entwicklung für Xamarin.iOS und Xamarin.Android zu ermöglichen.

Xamarin Designer 4.15.9 (d000f568b)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 1.1.116 (9619170)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 9.0.0.19 (HEAD/a8a3b0ec7)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK 12.0.0.15 (84552a4)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Log File

Activity

  1. added
    Area: App Runtime
    on Oct 15, 2018
  2. added this to the d16-0 milestone on Oct 15, 2018
  3. added
    bug
    need-info
    on Oct 15, 2018
  4. jonathanpeppers commented on Oct 15, 2018

    @jonathanpeppers
    Member

    @MarvinFrankenfeld can you give some information on the device models and API levels you are seeing this on?

    Can you reproduce it yourself? (Maybe not)

  5. MarvinFrankenfeld commented on Oct 15, 2018

    @MarvinFrankenfeld
    Author

    Lenovo TB3-X70F (TB3-X70F), Android 6.0
    Lenovo TAB3 X70L (TB3-X70L), Android 6.0
    Cubot MAX (x6069_cubot_5365u), Android 6.0

    We have bought the Cubot MAX to check if we can reproduce it, but App is running fine.

    We have no idea how to reproduce or even get close to the problem.

  6. jonathanpeppers commented on Oct 15, 2018

    @jonathanpeppers
    Member

    @MarvinFrankenfeld the crash you are getting means that the app can't load libmonodroid.so: https://github.com/xamarin/xamarin-android/blob/91a39725b1932b87103d2fed6228083e08a216b4/src/Xamarin.Android.Build.Tasks/Resources/MonoPackageManager.java#L49

    If you open up the APK file in 7zip (or some zip tool), you should see this file inside in several locations such as:

    • lib\armeabi-v7a\libmonodroid.so
    • lib\x86\libmonodroid.so

    Do you see this file for each Android architecture your app supports?

  7. MarvinFrankenfeld commented on Oct 16, 2018

    @MarvinFrankenfeld
    Author

    @jonathanpeppers we only support armeabi-v7a and there we can see the file

  8. jonathanpeppers commented on Oct 16, 2018

    @jonathanpeppers
    Member

    @MarvinFrankenfeld a quick google search of the devices listed show they are 64-bit devices.

    They are supposed to also support armeabi-v7a, but hey... Android is Android. Apparently if any 64-bit so file is loaded, you could get this error if only the 32-bit version is present for other so files? Example here: realm/realm-java#2507

    An idea is to add arm64-v8a support in your app, and see if these crashes go away... I saw some people recommending this when Googling for this issue.

  9. MarvinFrankenfeld commented on Oct 25, 2018

    @MarvinFrankenfeld
    Author

    @jonathanpeppers Adding 64-bit support in our App is not an option at the moment as we have our own .so files and building them for 64-bit would mean a lot of additional testing. If the app crashes because the phone is not able to do the 32-bit conversion correctly it should be Xamarin's responsibility to handle the exception and avoid crashes as libmonodroid.so is shipped by Xamarin. Is there any other possible solution to avoid the crashes?

  10. jonathanpeppers commented on Oct 25, 2018

    @jonathanpeppers
    Member

    @MarvinFrankenfeld if loadLibrary fails like this with libmonodroid.so, it's going to fail on your 32-bit sos as well... I'm not sure there is an exception that can possibly be handled here and your app be able to start, as mono isn't running yet.

    I think we need more info to know what is going on. But I am not sure what to try, @grendello do you have any ideas?

    A couple thoughts:

    • From what I've read, this would happen if the process loaded a 64-bit library before libmonodroid.so.
    • So what would cause this to happen? A rooted device? A non-standard flavor of Android? Some extension?
    • Could the language/country of the device matter?
  11. MarvinFrankenfeld commented on Nov 7, 2018

    @MarvinFrankenfeld
    Author

    @jonathanpeppers Language is always german, the app is available in Germany, Switzerland, Austria, Liechtenstein. The crashes always happen in Android 6. Maybe that is an useful hint?

  12. MarvinFrankenfeld commented on Nov 20, 2018

    @MarvinFrankenfeld
    Author

    @jonathanpeppers any news on this one?

  13. elvis824 commented on Dec 12, 2018

    @elvis824

    I've got a slightly different issue. but I'm wondering if it is also related to this one. App crash in my case happens only on Android Oreo devices (8.0 and 8.1) and it complains about my custom BackupAgent.

    The stacktrace is as follows:

    java.lang.UnsatisfiedLinkError:
    at mono.android.Runtime.register (Native Method)
    at md5f3dc63ecaad575af71bd7a9b1622f75b.n. (n.java:20)
    at java.lang.Class.newInstance (Native Method)
    at android.app.ActivityThread.handleCreateBackupAgent (ActivityThread.java:3431)
    at android.app.ActivityThread.-wrap3 (Unknown Source)
    at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1813)
    at android.os.Handler.dispatchMessage (Handler.java:105)
    at android.os.Looper.loop (Looper.java:180)
    at android.app.ActivityThread.main (ActivityThread.java:6944)
    at java.lang.reflect.Method.invoke (Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:835)

    I'm using Xamarin.Android with Visual Studio for my development, and the app is targeting for Android Pie (API 28).

    The class n in the stacktrace is my implementation of BackupAgent. This happens once everyday or every 2 days, and it seems (not 100% sure yet) that Auto Backup is still running without problem with the error.

    The problem has been around for almost a month, and I tried a couple of things but they don't seem to make any difference:

    1. Releasing with and without arm64-v8a
      • This eliminates the cause from mono library for 64-bit support
    2. Releasing with and without obfuscation
      • I'm using Dotfuscator Community Edition
      • Same crash reports but just the class name is revealed
    3. Installing the app through Play Store and locally with signed APK
      • This suggests that there is nothing to do with the installation method

    I hope this could add value to the investigation.

  14. MarvinFrankenfeld commented on Dec 29, 2018

    @MarvinFrankenfeld
    Author

    @jonathanpeppers , any news here? Still seeing crashes. It happens multiple times per user so this is influencing the android vital's multi-crash rate in a bad way. We are out of knowledge here on how to fix the issue.

  15. 17 remaining items

  16. jonathanpeppers commented on Jun 12, 2019

    @jonathanpeppers
    Member

    @MarvinFrankenfeld could you try with Visual Studio 2019 16.1 and let us know if you're still seeing this?

  17. MarvinFrankenfeld commented on Jun 13, 2019

    @MarvinFrankenfeld
    Author

    @jonathanpeppers we haven't upgraded to VS 2019 yet. This crash happens randomly in productive app in Google Play for some barely known devices. Sadly we are not able to reproduce this crash on a local device, so we cannot easily test whether the crash will be resolved with VS 2019. How is VS2019 supposed to help in this crash anyway? Shouldn't the app run the same way on the phone regardless of using VS 2017 or VS 2019?

  18. jonathanpeppers commented on Jun 13, 2019

    @jonathanpeppers
    Member

    Mainly seeing what we can do to move this forward--there are quite a few changes in Mono/Xamarin.Android in VS 2019.

    @MarvinFrankenfeld looking through the history your app is 32-bit only, and these were 64-bit devices? Since Google Play is requiring 64-bit support in apps now, have you added that to your app?

    Since the crash is on startup, on the very first loadLibrary call, it seems like this could be solved if your app had a 64-bit slice?

  19. jonathanpeppers commented on Jul 17, 2019

    @jonathanpeppers
    Member

    @MarvinFrankenfeld closing since we haven't had activity on this.

    Let me know if you get a chance to try VS 2019, add 64-bit support to your app, or have a way to reproduce it... We would love to track this down if we knew what was going on, thanks!

  20. dationguyen commented on Sep 19, 2019

    @dationguyen

    @jonathanpeppers I am facing this issue with VS 2019, Xamarin.Android 9.4.1.0
    App crash after user update from play store.

  21. jonathanpeppers commented on Sep 19, 2019

    @jonathanpeppers
    Member

    @dationguyen file a new issue? See if you can get adb logcat output or if you can get it to happen on your device/emulator.

    The problem with this issue before, was that nobody had reproduced it. We only had a report from Google Play and not much to go one otherwise 😞

  22. malexandersalazar commented on Sep 19, 2019

    @malexandersalazar
  23. dationguyen commented on Sep 20, 2019

    @dationguyen

    @jonathanpeppers I think it may relate to cache files when updating the app. if the user cleans the app data. it will back to work.

  24. tipa commented on Dec 11, 2019

    @tipa

    I am starting to see these crash reports since my last app update, when I switched to .aab bundles? Anyone else seeing this issue? Affected devices are Galaxy A50, Galaxy J4+, LG G6, Galaxy S10

  25. jonathanpeppers commented on Dec 12, 2019

    @jonathanpeppers
    Member

    @tipa can you file a new issue with new information? This was opened in Oct 2018, when App Bundle support didn't exist yet in Xamarin.Android.

  26. tipa commented on Dec 12, 2019

    @tipa

    Sure, filed a new issue here: #4028

  27. ghost locked as resolved and limited conversation to collaborators on Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area: App Runtimebugneed-info

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions