Monday 3 April 2017

Android jni : executing external native build for cmake cmakelists.txt file


1. Check in your build.gradle file for your App's module

externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }
 
2. remove above the cmake section

3. re-sync the project:   
   go to menu Build -> Refresh Linked C++ Projects 

4. Right-click on the module, such as the app module, select "Link C++ Project with Gradle" from the menu.

5. You should see a dialog similar to the one shown in below figure.


6. Click OK.

Android jni : could not find external native build

In your root build.gradle, make sure that gradle is set to at least version 2.2.0:

So you should have the following in buildscript {...}

dependencies { 
    classpath 'com.android.tools.build:gradle:2.2.0' 
}