How to fix a ProcessException when creating an APK after updating support for libs?

I upgraded to support for libs appcompat-v7 and support-v4 to 22.1.1 (from 22.0.0):

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

And now I started getting a ProcessException when creating the APK:

 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 

And these are the mistakes Jenkins has:

 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 

However, after overriding Java to 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 

How to get Jenkins to download the exact version supporting libs?

Update

I use this command line for Jenkins:

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

And I get this output:

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

But then do

 ./gradlew clean aSD 

I am still getting the same error.

+5
source share
6 answers

I had the same problem and an extra-android-m2repository solved it. You can upgrade as follows:

 android update sdk --no-ui --all --filter extra-android-m2repository 
+4
source

Update AppCompat v7 from the Android SDK Manager. For me it was fixed after the update :)

+2
source

I had to update my gradle from 1.0.1 in build.gradle:

  `classpath 'com.android.tools.build:gradle:1.2.3'` 
+2
source

I had the same problem, and the solution in my case was to make sure that the Android Support Repository component was installed in the Android SDK Manager, in my case version 14 is current.

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

update the SDK, but also set the access rights of the downloaded sdk to the root user. You need to change it to a Jenkins user or make chmod 755 in a directory.

0
source

I just updated all google libraries and solved my problem

android update sdk --no-ui --all --filter "extra-android-m2repository, extra-android-support, extra-google-admob_ads_sdk, extra-google-analytics_sdk_v2, extra-google-google_play_services_froyo, google-google_play_services, optional -google-m2repository, optional-google-play_apk_expansion, optional-google-play_billing, optional-google-play_licensing, optional-google-webdriver "

0
source

All Articles