BrainiumLLC / cargo-mobile

Rust on mobile made easy!
Apache License 2.0
1.23k stars 52 forks source link

Android: Trying to build a single variant causes all variants to be built #44

Closed kazatsuyu closed 3 years ago

kazatsuyu commented 3 years ago

In Android Studio I set arm64Debug to Active Variant and started the build.
But gradle runs tasks :app:rustBuildArm64Debug, :app:rustBuildArmDebug, :app:rustBuildX86, ...

I wanted target/aarch64-linux-android/debug/lib*.so in jniLibs/arm64-v8a, but finally it was overwritten by target/aarch64-linux-android/release/lib*.so.

The problem seems to be caused by the following
https://github.com/BrainiumLLC/cargo-mobile/blob/master/templates/platforms/android-studio/buildSrc/src/main/kotlin/RustPlugin.kt.hbs#L35

francesca64 commented 3 years ago

@kazatsuyu thanks for reporting this!

@ArthurKValladares sorry to play the blame game, but can you take a look at this?