Shruti
Shruti

Reputation: 55

NDK in Android studio with experimental gradle 0.2.0

I want to use NDK in Android Studio. For that i am following the Experimental gradle http://tools.android.com/tech-docs/new-build-system/gradle-experimental I need to get NDK path in my project -> app -> build.gradle

But when I am trying it like this :-

def ndkDir = plugins.getPlugin('com.android.model.application').getNdkFolder()

Gradle build fails with the following error :-

Error:(75, 0) No signature of method: com.android.build.gradle.model.AppComponentModelPlugin.getNdkFolder() is applicable for argument types: () values: []

Can anyone tell me the correct way to proceed with it ?

I am using :-

Upvotes: 3

Views: 954

Answers (2)

Shruti
Shruti

Reputation: 55

Yes I have specified the NDK path statically in the build.gradle

def ndkDir = '/path/to/ndk'

with this gradle sync is successful.

Upvotes: 0

Ysch
Ysch

Reputation: 772

I had not a similar problem, but a related one, I think..

Try File->settings-> Build, Execution, Deployment-> Gradle and select Use default gradle wrapper.

That did it for me. Apparently changing distributionUrl isn't enough..

Edit:

Also, the latest update bundles the NDK with the SDK. Open the SDK Manager, and download the NDK bundle from there. I've seen numerous cases where that simple change did the trick. Also, why don't you just type in the static path to your NDK, which will cause your problem to go away?...

Upvotes: 1

Related Questions