How to get Android Studio to build with the updated NDK library without having to clean and build the entire project?

How to get Android Studio to create my application using the updated NDK shared library file (.so) without having to clean up the whole project first?

There must be some mechanism by which Android Studio can detect that the shared library has been updated and use the latter. If I create a Build-> Clean project and then run the Run-> Run application, it will use the new version of the library, but it will also have to do a lot of work that is not needed, since none of the java source has changed. Even Run-> Clean and Rerun'app 'will not use the new library. (!!!)

+7
android android-studio build build.gradle shared-libraries
source share
2 answers

I just checked that Android Studio perfectly detects changes to .so files and restores the application when they change, and you start the application. Make sure you have the latest version of Android Studio and that your .so files are in directories

app/src/main/jniLibs/armeabi-v7a app/src/main/jniLibs/x86 

changing "main" to your build configuration and armeabi-v7a, x86, .. to your supported architectures, if necessary.

Also check that your modified .so files have a newer modification time than the old ones.

+1
source share

Go to "Preferences" → "Build, Run, Deploy" → "Instant Run".

And then just switch all the fields to.

+1
source share

All Articles