几个星期以来,我学习了如何从IBR-DTN Github编译 IBR-DTN 源代码,现在我被困在 Android NDK 的东西上。这是我在Android Studio上的失败日志,我尝试了Windows版本和Linux版本总是有同样的错误
Error:Execution failed for task ':app:ndkBuild'.
> A problem occurred starting process 'command 'sh''
这是我的 build.gradle
apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'
def createVersionName() {
if (System.getenv().containsKey("BUILD_NUMBER")) {
if (System.getenv().containsKey("GIT_COMMIT")) {
return rootProject.ext.versionName + "-" + System.getenv("GIT_COMMIT").substring(0, 7)
} else {
return rootProject.ext.versionName + "-" + System.getenv("BUILD_NUMBER")
}
} else {
return rootProject.ext.versionName
}
}
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "de.tubs.ibr.dtn"
minSdkVersion 9
targetSdkVersion 22
versionCode System.getenv("BUILD_NUMBER") as Integer ?: rootProject.ext.versionCode
versionName createVersionName()
}
signingConfigs {
release {
storeFile file(System.getenv("KEYSTORE") ?: "publish.keystore")
storePassword System.getenv("KEYSTORE_PASSWD")
keyAlias System.getenv("KEY_ALIAS") ?: android.defaultConfig.applicationId
keyPassword System.getenv("KEY_PASSWD")
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets.main {
jniLibs.srcDir 'src/main/libs'
jni.srcDirs = []
}
}
// enable signing if the keystore exists
if (android.signingConfigs.release.storeFile.exists()) {
android.buildTypes.release.signingConfig = android.signingConfigs.release
}
task ndkBuild(type: Exec) {
executable "sh"
workingDir "src/main/jni"
args "build.sh"
}
preBuild.dependsOn ndkBuild
dependencies {
compile 'de.tubs.ibr.dtn:library:1.1.2'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.jjoe64:graphview:3.1.+'
compile 'com.google.zxing:core:3.2.+'
compile 'com.google.zxing:android-integration:3.2.+'
}
寻求帮助以完成我的论文,我感谢这里的每一个建议。非常喜欢 XOXO