几个星期,我学会了如何编译来自IBR-DTN Github的IBR-DTN源码,现在我被卡在Android NDK的东西。 在Android工作室在这里我失败日志,我试过Windows版本和Linux版本总有相同的错误在Windows或Linux上失败的ndkBuild进程'命令sh'Android Studio
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
我没有直接从工作室运行它,我总是使用命令行。这个回购更容易 – Abk