Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

How can I force Android Studio to build my app using the the updated NDK shared library (.so) file, without having to clean the entire project first?

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

like image 909
Alyoshak Avatar asked Jul 19 '16 22:07

Alyoshak


1 Answers

Just checked that Android Studio perfectly detects changes of .so files and rebuilds app when they are changed and you are running the app. Make sure that you have latest Android Studio version and that your .so files are resided 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 needed.

Also check that your changed .so files have newer modification time than old ones.

like image 126
Anton Malyshev Avatar answered Oct 10 '22 05:10

Anton Malyshev