I’m trying to integrate a native Android SDK into a .NET MAUI app (targeting net9.0-android) using native library interop/android binding, and I feel like I’m hitting a wall with dependency management.
I have a native Android SDK (distributed via private Maven repo, with multiple modules and transitive dependencies). I created a wrapper library on the Android side (Kotlin/Java) to simplify the API surface. Then I’m consuming that through a MAUI binding / interop approach (AndroidLibrary, AndroidGradleProject, etc.).
The goal is to call a few high-level methods from MAUI (init, start flow, handle result).
Wrapper builds fine in Android (Gradle) and binding generates usable C# types, so MAUI can actually call into the native layer. The issue is that the moment I try to actually run it, I get missing classes (NoClassDefFoundError), missing resources (AAPT errors like themes, attrs, etc.), version conflicts between dependencies
In a pure Android app, everything works out of the box since Gradle resolves all transitive dependencies, but in MAUI I have to manually add AARs/JARs, transitive dependencies are not automatically resolved, AARs don’t carry dependency metadata
And I’m afraid that I basically have to reconstruct the dependency graph manually - which, according to gradlew :dependencies is more than 1000 packages.
I’ve tried already tried adding dependencies via AndroidLibrary tag, also using AndroidMavenLibrary, then manually downloading AARs and adding them (from private Maven repo)
Is this just the expected reality when doing native Android SDK integration in MAUI? Is there a recommended production approach I’m missing? Should I bundle everything into a single “fat” AAR on the Android side? Or keep manually adding dependencies in MAUI?
Has anyone successfully integrated a complex Android SDK (with UI + transitive deps) into MAUI without going insane?