Skip to content

MonoRuntime error with binding android process #10312

@mattiaferrari02

Description

@mattiaferrari02

Android framework version

net9.0-android

Affected platform version

.NET 9.0.100

Description

I have a MAUI app that uses a native android library created with https://github.com/CommunityToolkit/Maui.NativeLibraryInterop
A dependency of my native java binding exposes an android process with a <provider /> in its manifest.
If i try to run the code without any addition I get a runtime error UnsatisfiedLinkError to native OnCreate() because the android process of the dependency is not initialized by the mono runtime.

The solution that I found was to copy the provider and adding it the android manifest of my MAUI android app. By doing this and looking at the merged manifest of my APK i see that a new provider is created for the mono runtime intialization of that process and the UnsatisfiedLinkError is resolved.

The problem now is that due to security checks of the dependency that I am using there cannot be more than one provider declaring its process, so the checks fail and the dependency won't work.

So is there a way to initialize the runtime without adding anything to the merged manifest or at least like skipping the provider being wrapped in the mono runtime?

Steps to Reproduce

no repro

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    need-attentionA xamarin-android contributor needs to review

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions