我正在尝试使用 Android Studio 在我的手机上安装 Superpowered 示例应用程序,但它没有被构建。它显示错误:
Error:Execution failed for task ':app:ndkBuild'.
> A problem occurred starting process 'command 'null/ndk-build''
build.gradle 代码为:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.superpowered.hlsexample"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
sourceSets.main {
jniLibs.srcDir 'src/main/libs'
jni.srcDirs = []
}
}
task ndkBuild(type: Exec) {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
def ndkDir = properties.getProperty('ndk.dir')
commandLine "$ndkDir/ndk-build", '-B', '-C', file('src/main/jni').absolutePath
// Windows users: commandLine "$ndkDir\\ndk-build.cmd", '-B', '-C', file('src/main/jni').absolutePath
}
lintOptions {
abortOnError false
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuild
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
}
请帮我找到正确的解决方案。和/或指导我如何将 NDK 添加到当前应用程序。提前致谢。
最佳答案
关于android - Superpowered SDK : Error:Execution failed for task ':app:ndkBuild' . 启动进程 'command ' null/ndk-build'',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35392056/