Error: Flag android.useDeprecatedNdk is no longer supported and will be removed in the next version

ndk使用make过程中报如下错误:

Error: Flag android.useDeprecatedNdk is no longer supported and will be removed in the next version of Android Studio.  Please switch to a supported build system.
Consider using CMake or ndk-build integration. For more information, go to:
 https://d.android.com/r/studio-ui/add-native-code.html#ndkCompile
 To get started, you can use the sample ndk-build script the Android
 plugin generated for you at:
 F:\kotlin\flutter_trip\flutter_trip\nkd_file_crypt\app\build\intermediates\ndk\debug\Android.mk
Alternatively, you can use the experimental plugin:
 https://developer.android.com/r/tools/experimental-plugin.html
To continue using the deprecated NDK compile for another 60 days, set 
android.deprecatedNdkCompileLease=1573302229741 in gradle.properties

 

原因:

升级到studio3.0正式版,android.useDeprecatedNdk去掉,ndk改成cmake编译方式。

 

解决办法:

在gradle.properties中将:android.useDeprecatedNdk=true
改为
android.deprecatedNdkCompileLease=1573302229741

其中“=”后面可以在错误日志中看到

Error: Flag android.useDeprecatedNdk is no longer supported and will be removed in the next version