dotnet / dotnet/android

Facing issues when adding platform-specific DLLs (Android) to a .NET MAUI app and referencing them in the project file.

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

Description

### Android framework version

net9.0-android

### Affected platform version

VS 2022

### Description

Basically, I am building a .NET MAUI Android app using a Kotlin Multiplatform (KMM) SDK.

Step 1

I created a KMM sample SDK and generated the AAR for Android.

Step 2

Everything works fine when I follow the approach below for Android

I created:

an Android binding library

Android

For Android, I added the AAR to the Android binding project, generated the DLL, and referenced it in the MAUI Android app like this:


..\..\AndroidBindingNewSDK\AndroidBindingNewSDK\bin\Debug\net9.0-android\AndroidBindingNewSDK.dll

Problem Statement

Android

For Android, when I add both the DLL and the AAR directly to the MAUI app, I still encounter an issue:


libs\AndroidBindingNewSDK.dll


false

Goal

My goal is to distribute only DLLs and make them work correctly for Android, without requiring the client to reference the original AAR file.

### Steps to Reproduce

Step 1

I created a KMM sample SDK and generated the AAR for Android.

Step 2

Everything works fine when I follow the approach below for Android

I created:

an Android binding library

Android

For Android, I added the AAR to the Android binding project, generated the DLL, and referenced it in the MAUI Android app like this:


..\..\AndroidBindingNewSDK\AndroidBindingNewSDK\bin\Debug\net9.0-android\AndroidBindingNewSDK.dll

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