Android unit test fails when using Rust libraries indirectly
!44 (merged) solves Android unit test failures when the unit test is in an application or a library that directly uses a Rust library. However, when the unit test is in a module referencing a Kotlin library that uses a Rust library, it fails with an UnsatisfiedLinkError
. We can force the users to stick with the instrumented test, but this will require them to do more like adding an additional sourceSet nonAndroidTest
to not run Android local unit tests.
To resolve this issue, we need a feature that publishes a library as a JAR and an AAR simultaneously (as we need the AAR for real use but the JAR for unit tests), which seems to be out of the supported range of AGP. Finding a reliable way to make a dependency on jvmMain
of the Rust library from androidUnitTest
of the consuming Kotlin library would be the ideal way.