ndkBuild脚本运行
【摘要】
task ndkBuild(type: Exec) { workingDir file('src/main/jni') commandLine getNdkBuildCmd()
}
task cleanNative(type: Exec){ workingDir file('src/main/jni') commandLine getNdkBuildC...
task ndkBuild(type: Exec) { workingDir file('src/main/jni') commandLine getNdkBuildCmd() } task cleanNative(type: Exec){ workingDir file('src/main/jni') commandLine getNdkBuildCmd(), 'clean' } clean.dependsOn cleanNative def getNdkDir() { if (System.env.ANDROID_NDK_ROOT != null) return System.env.ANDROID_NDK_ROOT Properties properties = new Properties() properties.load(project.rootProject.file('local.properties').newDataInputStream()) def ndkdir = properties.getProperty('ndk.dir', null) if (ndkdir == null) throw new GradleException("NDK location not found. Define location with ndk.dir in the local.properties file or with an ANDROID_NDK_ROOT environment variable.") return ndkdir } def getNdkBuildCmd() { def ndkbuild = getNdkDir() + "/ndk-build" // ndkbuild += ".cmd" return ndkbuild }
linux下报错:
Error:Execution failed for task ':app:ndkBuild'.
> A problem occurred starting process 'command '/home/jason/Android/Sdk/ndk-bundle/ndk-build.cmd''
解决:
linux没有ndk-build.cmd
把.cmd去掉即可。
文章来源: blog.csdn.net,作者:网奇,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/jacke121/article/details/70171210
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)