Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No sdkHandler field in LibraryPlugin after updating to build tools 2.3.0

I was using the this method to get the NDK directory:

project.plugins.findPlugin('com.android.library').sdkHandler.getNdkFolder()

Ater updating com.android.tools.build:gradle to 2.3 the field sdkHandler seems to have been renamed on removed

Error:No such property: sdkHandler for class: com.android.build.gradle.LibraryPlugin

Is there an alternative way to get the NDK directory path in a library module?

like image 830
Marcin Kunert Avatar asked Mar 07 '17 09:03

Marcin Kunert


2 Answers

This method will now return the NDK's full path:

project.android.ndkDirectory.absolutePath
like image 156
Tjaart Avatar answered Oct 06 '22 16:10

Tjaart


For me the fix was to simply set the ANDROID_NDK environment variable. More here.

like image 44
Vaiden Avatar answered Oct 06 '22 15:10

Vaiden