Fabulous: System.DllNotFoundException: 'libmono-native.so'

Created on 2 Aug 2019  ·  14Comments  ·  Source: fsprojects/Fabulous

I try to run the Squeaky.App in VS 2019 but I get this error: message
System.DllNotFoundException
Message=libmono-native.so

external

Most helpful comment

@huayh Could you please use English in your future comments? It's the language we all use in this repo, so it will be easier for everyone this understand your comments. Thanks :)

@Pipsy @saguoran @huayh When searching for the specific error message you gave, I only found something about an invalid installation of the Mono Shared Runtime.
This seems to fit nicely your description:

  • After updating Visual Studio (and Xamarin has been updated too)
  • Only in Debug (which has the Shared Runtime enabled by default)
  • And on a real device

I think the Mono Shared Runtime was installed by a previous version of Visual Studio, but with the update, the runtime has become incompatible but haven't been replaced on your phones.

Could you try to either:

  • Uninstall everything named "Mono ..." as well as your app made with Fabulous from your phones, and try to debug once again?
  • Go in the options of your Android project and disable Shared Runtime for the Debug | Any CPU configuration? (not really a solution, but this will confirm the issue comes indeed from the Shared Runtime)

All 14 comments

@Pipsy100 Can you provide more information on this error?

  • The complete stack trace
  • Where and how it fails?
  • On which platform? (iOS, Android, Debug, Release?)
  • The version numbers of Visual Studio and Xamarin (can be found in the About dialog of Visual Studio - just paste the entire thing)
  • The version number of Fabulous.XamarinForms
  • The steps you used to create this project

Thanks

I got the same Error when debugging my project with the real android 5.1.1 device. There's no problem on Emulator API 28. Here is the message.

08-13 00:02:05.019 W/linker  (12573): /data/app/com.smartcoder.dongey-1/lib/x86_64/libmono-native.so: unused DT entry: type 0x6ffffffe arg 0x1fa0
08-13 00:02:05.020 W/linker  (12573): /data/app/com.smartcoder.dongey-1/lib/x86_64/libmono-native.so: unused DT entry: type 0x6fffffff arg 0x1
08-13 00:02:05.020 D/Mono    (12573): DllImport error loading library 'libmono-native.so': 'dlopen failed: library "libmonosgen-2.0.so" not found'.
08-13 00:02:05.021 W/linker  (12573): /data/app/com.smartcoder.dongey-1/lib/x86_64/libmono-native.so: unused DT entry: type 0x6ffffffe arg 0x1fa0
08-13 00:02:05.022 W/linker  (12573): /data/app/com.smartcoder.dongey-1/lib/x86_64/libmono-native.so: unused DT entry: type 0x6fffffff arg 0x1
08-13 00:02:05.024 D/Mono    (12573): DllImport error loading library 'libmono-native.so': 'dlopen failed: library "libmonosgen-2.0.so" not found'.
08-13 00:02:05.024 W/linker  (12573): /data/app/com.smartcoder.dongey-1/lib/x86_64/libmono-native.so: unused DT entry: type 0x6ffffffe arg 0x1fa0
08-13 00:02:05.025 W/linker  (12573): /data/app/com.smartcoder.dongey-1/lib/x86_64/libmono-native.so: unused DT entry: type 0x6fffffff arg 0x1
08-13 00:02:05.025 D/Mono    (12573): DllImport error loading library 'libmono-native.so': 'dlopen failed: library "libmonosgen-2.0.so" not found'.
08-13 00:02:05.025 W/Mono    (12573): DllImport unable to load library 'dlopen failed: library "libmonosgen-2.0.so" not found'.
**System.DllNotFoundException:** 'libmono-native.so'
Microsoft Visual Studio Enterprise 2019
Version 16.2.0
VisualStudio.16.Release/16.2.0+29123.88
Microsoft .NET Framework
Version 4.7.03190

Installed Version: Enterprise

Visual C++ 2019   00435-60000-00000-AA242
Microsoft Visual C++ 2019

Application Insights Tools for Visual Studio Package   9.1.00611.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2019   16.2.290.48383
ASP.NET and Web Tools 2019

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

Azure App Service Tools v3.0.0   16.2.290.48383
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools   16.2.290.48383
Azure Functions and Web Jobs Tools

C# Tools   3.2.0-beta4-19359-03+15b43b33901c88f68ef43f8314b5a2457716780d
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus   1.2.0 (d16-2@8b56e20)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

GitHub.VisualStudio   2.9.1.7781
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.20626.2

Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

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

Microsoft Library Manager   1.0
Install client-side libraries easily to any web project

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

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers   1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   16.2.6 (4cfc7c3)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   5.2.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

ResourcePackage Extension   1.0
ResourcePackage Visual Studio Extension Detailed Info

ResourcePackage Extension   1.0
ResourcePackage Visual Studio Extension Detailed Info

Snapshot Debugging Extension   1.0
Snapshot Debugging Visual Studio Extension Detailed Info

SQL Server Data Tools   16.0.61906.28070
Microsoft SQL Server Data Tools

TypeScript Tools   16.0.10627.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   3.2.0-beta4-19359-03+15b43b33901c88f68ef43f8314b5a2457716780d
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.4 for F# 4.6   16.2.0-beta.19321.1+a24d94ecf97d0d69d4fbe6b8b10cd1f97737fff4
Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

VSShortcutsManager Extension   1.0
VSShortcutsManager Visual Studio Extension Detailed Info

Xamarin   16.2.0.90 (d16-2@ba267630e)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   16.2.0.325 (remotes/origin/d16-2@f10cfbf83)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   16.3.117 (59a59e8)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   9.4.0.51 (d16-2/9fa7775)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: mono/mono/2019-02@e6f5369c2d2
    Java.Interop: xamarin/java.interop/d16-2@d64ada5
    LibZipSharp: grendello/LibZipSharp/d16-2@caa0c74
    LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
    ProGuard: xamarin/proguard/master@905836d
    SQLite: xamarin/sqlite/3.27.1@8212a2d
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-2@6f6c969


Xamarin.iOS and Xamarin.Mac SDK   12.14.0.110 (a8bcecc)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

在DEBUG模式下,我也有相同的问题,在升级VS2019 版本到16.2.0之后出现的。出问题的手机Android 版本是5.0.2 ,在另外一台版本为7.1.1的Android手机上则没有问题。Release模式下没有问题。有什么解决方法?

Seems like a compatibility problem with Android 5.0.

Seems like a compatibility problem with Android 5.0.

我看也是如此,但是我们的app需要兼容android 5.0 ,虽然是debug模式下有问题,但是这样影响开发效率。
谢谢!

@huayh Could you please use English in your future comments? It's the language we all use in this repo, so it will be easier for everyone this understand your comments. Thanks :)

@Pipsy @saguoran @huayh When searching for the specific error message you gave, I only found something about an invalid installation of the Mono Shared Runtime.
This seems to fit nicely your description:

  • After updating Visual Studio (and Xamarin has been updated too)
  • Only in Debug (which has the Shared Runtime enabled by default)
  • And on a real device

I think the Mono Shared Runtime was installed by a previous version of Visual Studio, but with the update, the runtime has become incompatible but haven't been replaced on your phones.

Could you try to either:

  • Uninstall everything named "Mono ..." as well as your app made with Fabulous from your phones, and try to debug once again?
  • Go in the options of your Android project and disable Shared Runtime for the Debug | Any CPU configuration? (not really a solution, but this will confirm the issue comes indeed from the Shared Runtime)

@huayh Could you please use English in your future comments? It's the language we all use in this repo, so it will be easier for everyone this understand your comments. Thanks :)

@Pipsy @saguoran @huayh When searching for the specific error message you gave, I only found something about an invalid installation of the Mono Shared Runtime.
This seems to fit nicely your description:

  • After updating Visual Studio (and Xamarin has been updated too)
  • Only in Debug (which has the Shared Runtime enabled by default)
  • And on a real device

I think the Mono Shared Runtime was installed by a previous version of Visual Studio, but with the update, the runtime has become incompatible but haven't been replaced on your phones.

Could you try to either:

  • Uninstall everything named "Mono ..." as well as your app made with Fabulous from your phones, and try to debug once again?
  • Go in the options of your Android project and disable Shared Runtime for the Debug | Any CPU configuration? (not really a solution, but this will confirm the issue comes indeed from the Shared Runtime)

@TimLariviere I apologize for my comments in Chinese,Because my English level is not so good.
I'll try the solution you provide to see if it can solve the problem.Thanks!

I disable Shared Runtime option,it seems ok at android 5.0 .
thank you @TimLariviere .

thank you TimLariviere!

Thank you TimLariviere, it worked for me. But why does it work? 😅

@Yaromi82

I think the Mono Shared Runtime was installed by a previous version of Visual Studio, but with the update, the runtime has become incompatible but haven't been replaced on your phones.

@Happypig375

@Yaromi82

I think the Mono Shared Runtime was installed by a previous version of Visual Studio, but with the update, the runtime has become incompatible but haven't been replaced on your phones.

@Happypig375 How to solve this issue, every time I debug any new Xamarin Project from VS 2019 on Android 5.1 I need to uncheck the "Use Shared runTime" option.

Closing since a workaround is known, and a fix should be available on the latest Visual Studio version.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SergejDK picture SergejDK  ·  5Comments

TimLariviere picture TimLariviere  ·  8Comments

praeclarum picture praeclarum  ·  7Comments

slang25 picture slang25  ·  6Comments

Happypig375 picture Happypig375  ·  4Comments