[Bug] .AAR/.JAR Binding works on Compile but doesn't work on Runtime
See original GitHub issueDescription
Steps to Reproduce
- Add .jar/.aar reference in project
<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
<EmbeddedJar Include="..\Lib\Android\myjavalib.jar" />
</ItemGroup>
- Build project. Now it can reference in src/Android/MainActivity.cs
- Run project on device or emulator
Expected Behavior
Should be able to reference to class as in compile time
Actual Behavior
Couldn’t run an application
AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.company.demo/crc6466b141205c78a362.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.company.mylibrary.NativeLibrary" on path: DexPathList[[zip file "/data/app/~~2DGjK-ivAqIgR-5CJwLUlQ==/com.company.demo-dgKJQbH-orf7bno40PgR9w==/base.apk"],nativeLibraryDirectories=[/data/app/~~2DGjK-ivAqIgR-5CJwLUlQ==/com.company.demo-dgKJQbH-orf7bno40PgR9w==/lib/arm64, /data/app/~~2DGjK-ivAqIgR-5CJwLUlQ==/com.compant.demo-dgKJQbH-orf7bno40PgR9w==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
Classes in .jar/.aar also not included in class.dex in .apk file
Basic Information
- Version with issue: 6.0.100-preview.5.21302.13
- Last known good version: -
- IDE: Visual Studio Code on Mac
- Platform Target Frameworks:
- Android: android-25
- Affected Devices: Android device
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Android .aar dependencies aren't resolving in libraries
The problem I find is when i try integrate my .aar into other project, is i need specify all of the dependencies in...
Read more >Gradle build does not support local aar dependencies
The workaround : To compile the aar, just clean the project, and the aar file will be automatically regenerated. To include the aar,...
Read more >Troubleshooting Bindings - Xamarin
This article summarizes serveral common errors that may occur when generating bindings, along with possible causes and suggested ways to resolve ...
Read more >Known issues with Android Studio and Android Gradle Plugin
Issue in Android Runtime throws error. If you're using a device that runs Android 8.0 or 8.1, you might encounter "VERIFICATION_ERROR" messages when...
Read more >Learning the Basics
Typically, to compile against lib , we need the API of lib , but we don't need its runtime dependencies. So the lib...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This fix should be in .NET 6 Preview 6. It’s not really part of MAUI, but the Android workload it depends on.
@jonathanpeppers So this will be included in next MAUI preview version right?