2023-01-20 264
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
version "3.10.2"
targets "native-lib" // New line
}
}
单击绿色播放按钮(运行’app’)时,我会以某种方式出现错误:
Build file '<project folder>/app/build.gradle' line: 5
A problem occurred evaluating project ':app'.
> No signature of method: build_bcdq4hni531na6stswx8a7txx.android() is
applicable for argument types: (build_bcdq4hni531na6stswx8a7txx$_run_closure1)
values: [build_bcdq4hni531na6stswx8a7txx$_run_closure1@41fd5f78]
发生了什么事?
targets属性记录在: https://developer.android.com/studio/projects/gradle-external-native-builds
此问题的答案也使用targets属性.
在构建Android App时禁用CMAKE目标
我什至无法通过将arguments "-DOPTION=1"添加到build.gradle!
将参数传递给cmake
也许将”目标”和其他选项放在android.defaultConfig.externalnativeBuild(而不是android.external.externalnativebuild)中.
android {
defaultConfig {
:
externalNativeBuild {
cmake {
targets "native-lib" // New line here!
}
}
}
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
version "3.10.2"
// targets "native-lib" // Not here!
}
}
}
以上所述是小编给大家介绍的在build.gradle file->无签名的方法中指定目标,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对77isp云服务器技术网的支持!
原文链接:https://77isp.com/post/25994.html
=========================================
https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2022-11-26
网站技术 2023-01-07
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
簿偌 2023年10月22日
扫码二维码
获取最新动态