Skip to content

monodroid failed to create directory after install with adb #123028

@pumaprod

Description

@pumaprod

After having migrated our application from Xamarin -> .net8 -> .net9, we are still able to debug the app when running in Visual Studio.
However, using the same csproj, when we take the debug build from our gitlab CI/CD pipeline and install it using adb install into an emulator, the application crashes.

The application contains a number of native libraries (c++) which continue to work without any problems in the release build, as well as the debug build installed from Visual Studio.

When I inspected the logcat output, I discovered this :

01-09 09:13:26.712 11619 11619 W monodroid: Failed to create directory '/data/user/0/com.appname.debug/files/.override/x86_64'. No such file or directory
01-09 09:13:26.712 11619 11619 W monodroid: Creating public update directory: /data/user/0/com.appname.debug/files/.__override__/x86_64
01-09 09:13:26.713 11619 11619 W appname.debug: Attempt to remove non-JNI local reference
01-09 09:13:26.714 11619 11619 W monodroid: runtime args empty
01-09 09:13:26.714 11619 11619 W monodroid-assembly: Unable to open app library directory '/data/user/0/com.appname.debug/files/.override/x86_64': No such file or directory
01-09 09:13:26.714 11619 11619 F monodroid: No assemblies found in '/data/user/0/com.appname.debug/files/.override/x86_64' or ''. Assuming this is part of Fast Deployment. Exiting...
01-09 09:13:26.714 11619 11619 F monodroid: ALL entries in APK named lib/x86_64/ MUST be STORED. Gradle's minification may COMPRESS such entries.
01-09 09:13:26.715 11619 11619 F monodroid: Abort at monodroid-glue.cc:740:3 ('MonoDomain *xamarin::android::internal::MonodroidRuntime::create_domain(JNIEnv *, jstring_array_wrapper &, bool, bool)')

If I copy the signed debug apk, created directly by Visual Studio (as opposed to dotnet build), the same happens.

Some information :
Emulator : Android 15.0 - API 35, x86_64, Google Apis, 1280x800 mdpi
Microsoft Visual Studio Community 2022 (64-bit) v17.14.16
Microsoft .NET Framework Version 4.8.09037
ASP Net and Web tools v17.14.122.59099

Android Debug Bridge version 1.0.41
Version 34.0.5-10900879
Installed as C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe

I insist on the fact that the debug version runs without any problems from within Visual Studio, but not when installed with adb.

What is Visual Studio doing differently to adb ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions