dotnet / dotnet/android

MonoRuntime error with binding android process

Open
#10,312 15 comments 0 reactions 0 assignees View on GitHub
need-attention
Dominant language
C#
Stars
2.1k
Forks
579
Avg merge
1d 19h
Merged PRs (30d)
252

Description

### 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 `` 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

```shell

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.