How to create an NDK application with Android Studio 2.1 and com.android.tools.build:gradle:2.1.0?

I searched a little Google, but all the NDK examples seem to use com.android.tools.build: gradle-experimental: 07.0.

The examples from https://github.com/googlesamples/android-ndk also use com.android.tools.build:gradle-experimental07.7.0.

If I switch to com.android.tools.build: gradle: 2.1.0, these projects are simply not built. Firstly, there is an error when it can not find a plugin for apply plugin: 'com.android.model.application'(had to change to 'com.android.application'), and the characters within android.ndk { ... }, such as CFlags, cppFlags, ldLibscan not be resolved.

It seems that the entire ndk section has been deleted according to http://google.imtqy.com/android-gradle-dsl/current/index.html .

Can someone point me in the right direction how to properly create a Hello World NDK application using com.android.tools.build: gradle: 2.1.0 in Android Studio 2.1? There should be some tricks that I miss here.

+4
source share

All Articles