Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Install Google Play Services GMS SDK on CircleCI

I am using a CircleCI server to build and test and Android application and have trouble installing the Android SDK for Google Play Services (including GMS services) on the server.

My circle.yml file is:

environment:
          ANDROID_HOME: /usr/local/android-sdk-linux

dependencies:
  pre:
    - echo y | sudo /usr/local/android-sdk-linux/tools/android update sdk --no-ui --all --filter extra-android-m2repository
    - echo y | sudo /usr/local/android-sdk-linux/tools/android update sdk --no-ui --all

    - wget $DEBUG_KEYSTORE_URL
    - openssl des3 -d -pass env:DEBUG_KEYSTORE_PASSWORD -salt -in debug.keystore.encrypted  -out ~/.android/debug.keystore

test:
    override:
       - ./gradlew assembleDebug
    post:
      - cp -r app/build/outputs $CIRCLE_ARTIFACTS

The first

- echo y | sudo /usr/local/android-sdk-linux/tools/android update sdk --no-ui --all --filter extra-android-m2repository

was a fix for an earlier issue with the Android SDK extras, and I thought that the second line would install all remaining components:

- echo y | sudo /usr/local/android-sdk-linux/tools/android update sdk --no-ui --all

However, I am getting the following error (below).

When trying to keep my circle.yml file up to date with the latest Android SDK, I seem to keep running into similar issues. Any suggestions are appreciated!

Download https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.0-beta1/gradle-1.3.0-beta1.pom
Download https://jcenter.bintray.com/com/google/gms/google-services/1.3.0-beta1/google-services-1.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/build/gradle-core/1.3.0-beta1/gradle-core-1.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/build/builder/1.3.0-beta1/builder-1.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/lint/lint/24.3.0-beta1/lint-24.3.0-beta1.pom
Download https://jcenter.bintray.com/net/sf/proguard/proguard-gradle/5.2.1/proguard-gradle-5.2.1.pom
Download https://jcenter.bintray.com/net/sf/proguard/proguard-parent/5.2.1/proguard-parent-5.2.1.pom
Download https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.3.6/groovy-all-2.3.6.pom
Download https://jcenter.bintray.com/com/android/tools/build/builder-model/1.3.0-beta1/builder-model-1.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/build/builder-test-api/1.3.0-beta1/builder-test-api-1.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/sdklib/24.3.0-beta1/sdklib-24.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/sdk-common/24.3.0-beta1/sdk-common-24.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/common/24.3.0-beta1/common-24.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/build/manifest-merger/24.3.0-beta1/manifest-merger-24.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/24.3.0-beta1/ddmlib-24.3.0-beta1.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm/5.0.3/asm-5.0.3.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm-parent/5.0.3/asm-parent-5.0.3.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.pom
Download https://jcenter.bintray.com/com/android/tools/jack/jack-api/0.9.0/jack-api-0.9.0.pom
Download https://jcenter.bintray.com/com/android/tools/jill/jill-api/0.9.0/jill-api-0.9.0.pom
Download https://jcenter.bintray.com/com/android/tools/lint/lint-checks/24.3.0-beta1/lint-checks-24.3.0-beta1.pom
Download https://jcenter.bintray.com/org/eclipse/jdt/core/compiler/ecj/4.4/ecj-4.4.pom
Download https://jcenter.bintray.com/net/sf/proguard/proguard-base/5.2.1/proguard-base-5.2.1.pom
Download https://jcenter.bintray.com/com/android/tools/annotations/24.3.0-beta1/annotations-24.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/layoutlib/layoutlib-api/24.3.0-beta1/layoutlib-api-24.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/dvlib/24.3.0-beta1/dvlib-24.3.0-beta1.pom
Download https://jcenter.bintray.com/com/android/tools/lint/lint-api/24.3.0-beta1/lint-api-24.3.0-beta1.pom
Download https://jcenter.bintray.com/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.pom
Download https://jcenter.bintray.com/com/intellij/annotations/12.0/annotations-12.0.pom
Download https://jcenter.bintray.com/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3.pom
Download https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.0-beta1/gradle-1.3.0-beta1.jar
Download https://jcenter.bintray.com/com/google/gms/google-services/1.3.0-beta1/google-services-1.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/build/gradle-core/1.3.0-beta1/gradle-core-1.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/build/builder/1.3.0-beta1/builder-1.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/lint/lint/24.3.0-beta1/lint-24.3.0-beta1.jar
Download https://jcenter.bintray.com/net/sf/proguard/proguard-gradle/5.2.1/proguard-gradle-5.2.1.jar
Download https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.3.6/groovy-all-2.3.6.jar
Download https://jcenter.bintray.com/com/android/tools/build/builder-model/1.3.0-beta1/builder-model-1.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/build/builder-test-api/1.3.0-beta1/builder-test-api-1.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/sdklib/24.3.0-beta1/sdklib-24.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/sdk-common/24.3.0-beta1/sdk-common-24.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/common/24.3.0-beta1/common-24.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/build/manifest-merger/24.3.0-beta1/manifest-merger-24.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/24.3.0-beta1/ddmlib-24.3.0-beta1.jar
Download https://jcenter.bintray.com/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar
Download https://jcenter.bintray.com/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar
Download https://jcenter.bintray.com/com/android/tools/jack/jack-api/0.9.0/jack-api-0.9.0.jar
Download https://jcenter.bintray.com/com/android/tools/jill/jill-api/0.9.0/jill-api-0.9.0.jar
Download https://jcenter.bintray.com/com/android/tools/lint/lint-checks/24.3.0-beta1/lint-checks-24.3.0-beta1.jar
Download https://jcenter.bintray.com/org/eclipse/jdt/core/compiler/ecj/4.4/ecj-4.4.jar
Download https://jcenter.bintray.com/net/sf/proguard/proguard-base/5.2.1/proguard-base-5.2.1.jar
Download https://jcenter.bintray.com/com/android/tools/annotations/24.3.0-beta1/annotations-24.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/layoutlib/layoutlib-api/24.3.0-beta1/layoutlib-api-24.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/dvlib/24.3.0-beta1/dvlib-24.3.0-beta1.jar
Download https://jcenter.bintray.com/com/android/tools/lint/lint-api/24.3.0-beta1/lint-api-24.3.0-beta1.jar
Download https://jcenter.bintray.com/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar
Download https://jcenter.bintray.com/com/intellij/annotations/12.0/annotations-12.0.jar
Download https://jcenter.bintray.com/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3.jar

FAILURE: Build failed with an exception.

    * What went wrong:
    A problem occurred configuring project ':app'.
    > Could not resolve all dependencies for configuration ':app:_debugCompile'.
       > Could not find com.google.android.gms:play-services-maps:7.5.0.
         Searched in the following locations:
             http://dl.bintray.com/populov/maven/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.pom
             http://dl.bintray.com/populov/maven/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.jar
             https://repo1.maven.org/maven2/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.pom
             https://repo1.maven.org/maven2/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.jar
             https://jcenter.bintray.com/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.pom
             https://jcenter.bintray.com/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.jar
             https://maven.fabric.io/public/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.pom
             https://maven.fabric.io/public/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.jar
             file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.pom
             file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.jar
             file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.pom
             file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/android/gms/play-services-maps/7.5.0/play-services-maps-7.5.0.jar
         Required by:
             project-android-app:app:unspecified
       > Could not find com.google.android.gms:play-services-location:7.5.0.
         Searched in the following locations:
             http://dl.bintray.com/populov/maven/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.pom
             http://dl.bintray.com/populov/maven/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.jar
             https://repo1.maven.org/maven2/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.pom
             https://repo1.maven.org/maven2/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.jar
             https://jcenter.bintray.com/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.pom
             https://jcenter.bintray.com/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.jar
             https://maven.fabric.io/public/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.pom
             https://maven.fabric.io/public/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.jar
             file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.pom
             file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.jar
             file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.pom
             file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/android/gms/play-services-location/7.5.0/play-services-location-7.5.0.jar
         Required by:
             project-android-app:app:unspecified
       > Could not find com.google.android.gms:play-services-gcm:7.5.0.
         Searched in the following locations:
             http://dl.bintray.com/populov/maven/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.pom
             http://dl.bintray.com/populov/maven/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.jar
             https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.pom
             https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.jar
             https://jcenter.bintray.com/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.pom
             https://jcenter.bintray.com/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.jar
             https://maven.fabric.io/public/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.pom
             https://maven.fabric.io/public/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.jar
             file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.pom
             file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.jar
             file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.pom
             file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/android/gms/play-services-gcm/7.5.0/play-services-gcm-7.5.0.jar
         Required by:
             project-android-app:app:unspecified

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

    BUILD FAILED


    export TERM="dumb"
    ./gradlew dependencies
     returned exit code 1

    Total time: 19.331 secs Action failed: ./gradlew dependencies
like image 766
ZenBalance Avatar asked Mar 16 '23 18:03

ZenBalance


1 Answers

The solution after much tweaking seems to require you to explicitly specify the components you need in the --filter option. If you don't add filter, it appears that --all will NOT give you all the components needed.

Fix is below for others:

ssh dependencies: pre: - echo y | sudo /usr/local/android-sdk-linux/tools/android update sdk --no-ui --all --filter extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository

like image 58
ZenBalance Avatar answered Mar 21 '23 15:03

ZenBalance