gpt4 book ai didi

android - 如何在支持库更新后构建 APK 时修复 ProcessException?

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:14:01 24 4
gpt4 key购买 nike

我已经升级到 support libs appcompat-v7support-v422.1.1 (来自 22.0.0):

compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:support-v4:22.1.1'

现在我在构建 APK 时开始遇到 ProcessException:

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/java/jdk1.8.0_31/bin/java'' finished with non-zero exit value 2

Jenkins 的此类错误:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_stagingDebugCompile'.
> Could not find com.android.support:appcompat-v7:22.1.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.jar
https://repo1.maven.org/maven2/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.pom
https://repo1.maven.org/maven2/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.jar
https://maven.fabric.io/public/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.pom
https://maven.fabric.io/public/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.jar
file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.pom
file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.jar
file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.pom
file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.jar
Required by:
workspace:app:1.5.1
> Could not find com.android.support:support-v4:22.1.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://jcenter.bintray.com/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
https://repo1.maven.org/maven2/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://repo1.maven.org/maven2/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
https://maven.fabric.io/public/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://maven.fabric.io/public/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
Required by:
workspace:app:1.5.1
> Could not find com.android.support:support-v4:22.1.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://jcenter.bintray.com/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
https://repo1.maven.org/maven2/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://repo1.maven.org/maven2/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
https://maven.fabric.io/public/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://maven.fabric.io/public/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
Required by:
workspace:app:1.5.1 > com.android.support:recyclerview-v7:21.0.2
> Could not find com.android.support:support-v4:22.1.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://jcenter.bintray.com/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
https://repo1.maven.org/maven2/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://repo1.maven.org/maven2/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
https://maven.fabric.io/public/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://maven.fabric.io/public/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
Required by:
workspace:app:1.5.1 > com.android.support:gridlayout-v7:19.1.0
> Could not find com.android.support:support-v4:22.1.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://jcenter.bintray.com/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
https://repo1.maven.org/maven2/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://repo1.maven.org/maven2/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
https://maven.fabric.io/public/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://maven.fabric.io/public/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
Required by:
workspace:app:1.5.1 > com.facebook.android:facebook-android-sdk:4.0.0
> Could not find com.android.support:support-v4:22.1.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://jcenter.bintray.com/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
https://repo1.maven.org/maven2/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://repo1.maven.org/maven2/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
https://maven.fabric.io/public/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://maven.fabric.io/public/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
Required by:
workspace:app:1.5.1 > com.astuetz:pagerslidingtabstrip:1.0.1
> Could not find com.android.support:appcompat-v7:22.1.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.jar
https://repo1.maven.org/maven2/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.pom
https://repo1.maven.org/maven2/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.jar
https://maven.fabric.io/public/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.pom
https://maven.fabric.io/public/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.jar
file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.pom
file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.jar
file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.pom
file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1.jar
Required by:
workspace:app:1.5.1 > com.afollestad:material-dialogs:0.6.3.1
> Could not find com.android.support:support-v4:22.1.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://jcenter.bintray.com/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
https://repo1.maven.org/maven2/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://repo1.maven.org/maven2/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
https://maven.fabric.io/public/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
https://maven.fabric.io/public/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.pom
file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1.jar
Required by:
workspace:app:1.5.1 > com.google.android.gms:play-services-analytics:7.0.0 > com.google.android.gms:play-services-base:7.0.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Java降级到1.7后还是一样:

Error:Execution failed for task ':app:dexStagingDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/java/jdk1.7.0_79/bin/java'' finished with non-zero exit value 2

我应该如何强制 Jenkins 下载准确版本的支持库?

更新

我在 Jenkins 上使用这个命令行:

sudo /opt/android-sdk-linux/tools/android update sdk --no-ui --all --filter extra-android-support

我得到了这个输出:

...
Downloading Android Support Library, revision 22.1.1
Installing Android Support Library, revision 22.1.1
Installed Android Support Library, revision 22.1.1
...

然后做

./gradlew clean aSD

我仍然遇到同样的错误。

最佳答案

我有同样的问题,更新 extra-android-m2repository 已经解决了。您可以按如下方式进行更新:

android update sdk --no-ui --all --filter extra-android-m2repository

关于android - 如何在支持库更新后构建 APK 时修复 ProcessException?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29954899/

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