gpt4 book ai didi

android - 在 Centos 服务器上编译 Android 项目

转载 作者:太空宇宙 更新时间:2023-11-03 17:23:54 25 4
gpt4 key购买 nike

我想使用 Gradle 编译器在 Centos 服务器上构建一个 Android 应用程序,但我在构建时得到了这个。

    :app:compileDebugAidl FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugAidl'.
> java.lang.RuntimeException: com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException:
Process 'command '/android/android-sdk-linux/build-tools/23.0.0/aidl'' finished with non-zero exit value 139

这是stacktarce

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugAidl'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)

还有很多,我无法全部列出,如果您正在寻找具体的东西,请告诉我
最后几行是:

 org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 68 more
Caused by: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/android/android-sdk-linux/build-tools/23.0.0/aidl'' finished with non-zero exit value 139
at com.android.ide.common.internal.WaitableExecutor.waitForTasksWithQuickFail(WaitableExecutor.java:119)
at com.android.builder.internal.compiler.SourceSearcher.search(SourceSearcher.java:76)
at com.android.builder.core.AndroidBuilder.compileAllAidlFiles(AndroidBuilder.java:1188)
at com.android.build.gradle.tasks.AidlCompile.compileAllFiles(AidlCompile.java:130)
at com.android.build.gradle.tasks.AidlCompile.doFullTaskAction(AidlCompile.java:191)
... 76 more
Caused by: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/android/android-sdk-linux/build-tools/23.0.0/aidl'' finished with non-zero exit value 139
at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:43)
at com.android.builder.internal.compiler.AidlProcessor.processFile(AidlProcessor.java:105)
at com.android.builder.internal.compiler.SourceSearcher$1.call(SourceSearcher.java:96)
at com.android.builder.internal.compiler.SourceSearcher$1.call(SourceSearcher.java:93)
Caused by: org.gradle.process.internal.ExecException: Process 'command '/android/android-sdk-linux/build-tools/23.0.0/aidl'' finished with non-zero exit value 139
at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:367)
at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:41)
... 3 more


BUILD FAILED

app目录下的build.gradle文件是:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
useLibrary 'org.apache.http.legacy'

defaultConfig {
applicationId "com.pars_sharg"
minSdkVersion 8
targetSdkVersion 8
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}


dependencies {
compile 'com.android.support:appcompat-v7:23.0.0'
compile files('libs/adad.jar')
compile files('libs/urlimageviewhelper-1.0.4.jar')
compile files('libs/zxing-2.1.jar')
compile 'com.sayanpco.charge.library:sayan-charge:1.8'
}

最佳答案

问题可能是您的目标是非常旧的 android 版本……太旧了,可能不是您想要的。

请更新您的 build.gradle 的这一部分

android {
//...
defaultConfig {
minSdkVersion 8
targetSdkVersion 8
}
}

更合理的minSdkVersion & targetSdkVersion应该是这样

android {
//...
defaultConfig {
// Min doesn't have to be this high but
// it's a reasonable `minSdkVersion`
minSdkVersion 15
// target should be the version of the build tools you are using
targetSdkVersion 23
}
}

关于android - 在 Centos 服务器上编译 Android 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38528902/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com