Andriod Studio下ndk出现需要在gradle.properties中添加$USE_DEPRECATED_NDK = true的问题解法

来源:互联网 发布:js中的radio length 编辑:程序博客网 时间:2024/06/05 22:45

Android Studio版本:Android Studio 2.2

系统: win10 64 专业版

NDK版本:android-ndk-r14b(自己下载安装)、android-ndk-r12b-windows-x86_64(自己下载安装)、ndk-bundle(Android Studio中下载)3者均测试有效

根据网上的教程,有时候会出现如下的错误:

Error:Execution failed for task ':app:compileDebugNdk'.
> Error: NDK integration is deprecated in the current plugin.  Consider trying the new experimental plugin.  For details, see http://tools.android.com/tech-docs/new-build-system/gradle-experimental.  Set "$USE_DEPRECATED_NDK=true" in gradle.properties to continue using the current NDK integration.


解决的方法是在gradle.properties文件中添加一行代码:

android.useDeprecatedNdk = true
而不是按提示中的增加

$USE_DEPRECATED_NDK = true
但是增加

android.useDeprecatedNdk = true
后可能还是会出现一样的提示。这是因为没有同步gradle.properties文件的修改。这时候需要右键点击gradle.properties文件,选择Synchronize'gradle.properties',然后再次运行就不会有相同的错误提示了。

0 0
原创粉丝点击