问题与处理策略
问题描述
-
在 Android 项目中,报如下警告
The option 'android.useDeprecatedNdk' is deprecated.
The current default is 'false'.
It has been removed from the current version of the Android Gradle plugin.
NdkCompile is no longer supported翻译
配置项 android.useDeprecatedNdk 已弃用
当前默认值为 false
它已从当前版本的 Android Gradle 插件中删除
不再支持 NdkCompile
问题原因
-
android.useDeprecatedNdk
是旧版 Android Gradle 插件(AGP)中的一个配置项,用于启用对 NDK 编译的支持 -
从 AGP 3.0.0 开始,
NdkCompile
已被弃用,并在更高版本中被移除 -
当前版本的 AGP 默认将
android.useDeprecatedNdk
设置为false
,并且不再支持NdkCompile
处理策略
-
在项目的
gradle.properties
文件中,删除或注释掉以下内容android.useDeprecatedNdk=true