Facing issues when adding platform-specific DLLs (iOS and Android) to a .NET MAUI app and referencing them in the project file.
- Dominant language
- C#
- Stars
- 2.9k
- Forks
- 576
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Basically, I am building a .NET MAUI iOS and Android app using a Kotlin Multiplatform (KMM) SDK.
Step 1
I created a KMM sample SDK and generated the .xcframework for iOS and AAR for Android.
Step 2
Everything works fine when I follow the approach below for both Android and iOS.
I created:
an iOS binding library
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
```
iOS
For iOS, I added the .xcframework to the iOS binding project, generated the ApiDef, built the DLL, and referenced it in the MAUI iOS app like this:
```
..\..\iOSBindingRDMobileSDK\iOSBindingRDMobileSDK\bin\Debug\net9.0-ios\iOSBindingRDMobileSDK.dll
```
Problem Statement
However, I do not want to share the binding projects with the client.
I want to provide only the DLLs, and the client should be able to use them directly.
Current Behavior
iOS
When I add only the DLL to the MAUI app, I get a clang linker error.
If I add both the DLL and the .xcframework to the MAUI app, everything works correctly.
```
libs\iOSBindingRDMobileSDK.dll
Framework
True
True
```
My question is: Is there a way to make iOS work using only the DLL, without requiring the .xcframework?
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
```
Android error:
invalid file path 'C:\b\net9.0-android\lp\161.stamp'
Goal
My goal is to distribute only DLLs and make them work correctly for both Android and iOS, without requiring the client to reference the original AAR or .xcframework files.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.