NDK in android studio with experimental gradle 0.2.0
I want to use NDK in Android Studio. For this I am following the experimental gradle http://tools.android.com/tech-docs/new-build-system/gradle-experimental I need to get the NDK path in my project -> app -> build.gradle
But when I try to do it like this: -
def ndkDir = plugins.getPlugin('com.android.model.application').getNdkFolder()
Gradle Build error with error: -
Error: (75, 0) No method signature: com.android.build.gradle.model.AppComponentModelPlugin.getNdkFolder () applicable for argument types :() values: []
Can anyone tell me the correct way to proceed with it?
I use: -
- Android Studio 1.3
- Gradle2.5 "DistributionUrl = https://services.gradle.org/distributions/ gradle -2.5-all.zip"
- classpath 'com.android.tools.build: gradle-experimental: 0.2.0'
source to share
I didn't have a similar issue but seemed to be related to it.
Try it File->settings-> Build, Execution, Deployment-> Gradle
and choose Use default gradle wrapper
.
This did it for me. Apparently changing the Url distribution isn't enough.
Edit:
In addition, the latest update links the NDK to the SDK. Open SDK manager and download NDK bundle
from there. I've seen numerous cases where this simple change did the trick. Also, why don't you just enter a static path to your NDK, which will make your problem go away? ...
source to share