我正在尝试使用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添加到当前应用程序。在此先感谢。