Android:NDK开发错误锦集(一)


NDK开发时配置以及编写难免会出现错误:以下是我在NDK配置以及编写是出现的错误 和解决方法

Android:NDK开发错误锦集(一)

Android:NDK开发错误锦集(二)

Android:NDK开发错误锦集(三)


以下是log日志里的错误

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugNdk'.
> 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:
   D:\Demo\NDK\NDemo\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=1530683631447 in gradle.properties

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s

上面代码意思告诉你

android.useDeprecatedNdk=true

这行代码在android中已经过时了,那怎么解决呢,其实日志里后面已经给我们解决方法了:

To continue using the deprecated NDK compile for another 60 days, set
android.deprecatedNdkCompileLease=1530683631447 in gradle.properties

意思是继续使用已弃用的NDK编译60天,并且在设置了一个时间戳,

android.deprecatedNdkCompileLease=1530683631447

把你log日志里的这句话替换 android.useDeprecatedNdk=true 就可以了!


我想60天也够用了, 不够用的话在替换一次









评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值