CircleCI 构建获得 "Could not find com.google.android.gms:play-services-identity:11.0.1"
CircleCI build getting "Could not find com.google.android.gms:play-services-identity:11.0.1"
我正在尝试使用此 circle.yml 文件
在 CircleCI 上构建一个 Android 应用程序
machine:
java:
version: oraclejdk8
environment:
# Java options
JAVA_OPTS: "-Xms512m -Xmx2048m"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
dependencies:
pre:
# Download and install latest(26.0.2) sdk-tools revision
- wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
- mkdir sdk
- unzip -d sdk sdk-tools-linux-3859397.zip
# Accepts SDK licenses
- mkdir "$ANDROID_HOME/licenses" || true
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
# Install Android SDKs and additional repositories
- echo y | sdk/tools/bin/sdkmanager --channel=2 "build-tools;25.0.3" "platform-tools" "tools"
- echo y | sdk/tools/bin/sdkmanager --channel=2 "extras;google;m2repository" "extras;android;m2repository" "extras;google;google_play_services"
test:
override:
# Generate a debug-apk
- ./gradlew assembleAppseeOffDebug -PdisablePreDex
# Copy the generated apk files to Circle-CI Artifacts
- cp -r app/build/outputs/apk/ $CIRCLE_ARTIFACTS
# Copy the test results to Circle-CI Artifacts
- cp -r app/build/outputs/androidTest-results/* $CIRCLE_TEST_REPORTS
问题是在 gradle 构建阶段,我遇到了这个错误
Could not find com.google.firebase:firebase-messaging:11.0.1.
Searched in the following locations:
file:/usr/local/android-sdk-linux/extras/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
file:/usr/local/android-sdk-linux/extras/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
http://dl.bintray.com/populov/maven/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
http://dl.bintray.com/populov/maven/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://jcenter.bintray.com/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://jcenter.bintray.com/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://oss.sonatype.org/content/repositories/snapshots/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://oss.sonatype.org/content/repositories/snapshots/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://jitpack.io/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://jitpack.io/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://maven.fabric.io/public/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://maven.fabric.io/public/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://zendesk.artifactoryonline.com/zendesk/repo/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://zendesk.artifactoryonline.com/zendesk/repo/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
是否有任何我没有在 circle.yml 文件中声明的 sdk 依赖项?
问题出在执行器 (oraclejdk8) 上,它没有安装正确的 Android SDK 和 Google 存储库。
我通过从 CircleCI 1.0 迁移到 2.0 并设置 bitriseio/docker-android:latest(默认安装了正确的存储库)作为 docker 图像解决了这个问题。
这是我的决赛config.yml
version: 2
jobs:
build:
working_directory: /opt/working
docker:
- image: bitriseio/docker-android:latest
environment:
# Java options
JAVA_OPTS: "-Xms512m -Xmx2048m"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
steps:
- checkout
- run:
name: Accepts License
command: echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
- run:
name: Assemble & Test
command: ./gradlew assembleDebug testDebugUnitTest
- store_artifacts:
path: app/build/reports/tests/
destination: tests_reports/
- store_test_results:
path: "app/build/test-results/testDebugUnitTest/"
- store_artifacts:
path: app/build/outputs/apk/
destination: apks/
我正在尝试使用此 circle.yml 文件
在 CircleCI 上构建一个 Android 应用程序machine:
java:
version: oraclejdk8
environment:
# Java options
JAVA_OPTS: "-Xms512m -Xmx2048m"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
dependencies:
pre:
# Download and install latest(26.0.2) sdk-tools revision
- wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
- mkdir sdk
- unzip -d sdk sdk-tools-linux-3859397.zip
# Accepts SDK licenses
- mkdir "$ANDROID_HOME/licenses" || true
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
# Install Android SDKs and additional repositories
- echo y | sdk/tools/bin/sdkmanager --channel=2 "build-tools;25.0.3" "platform-tools" "tools"
- echo y | sdk/tools/bin/sdkmanager --channel=2 "extras;google;m2repository" "extras;android;m2repository" "extras;google;google_play_services"
test:
override:
# Generate a debug-apk
- ./gradlew assembleAppseeOffDebug -PdisablePreDex
# Copy the generated apk files to Circle-CI Artifacts
- cp -r app/build/outputs/apk/ $CIRCLE_ARTIFACTS
# Copy the test results to Circle-CI Artifacts
- cp -r app/build/outputs/androidTest-results/* $CIRCLE_TEST_REPORTS
问题是在 gradle 构建阶段,我遇到了这个错误
Could not find com.google.firebase:firebase-messaging:11.0.1.
Searched in the following locations:
file:/usr/local/android-sdk-linux/extras/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
file:/usr/local/android-sdk-linux/extras/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
http://dl.bintray.com/populov/maven/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
http://dl.bintray.com/populov/maven/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://jcenter.bintray.com/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://jcenter.bintray.com/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://oss.sonatype.org/content/repositories/snapshots/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://oss.sonatype.org/content/repositories/snapshots/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://jitpack.io/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://jitpack.io/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://maven.fabric.io/public/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://maven.fabric.io/public/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://zendesk.artifactoryonline.com/zendesk/repo/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://zendesk.artifactoryonline.com/zendesk/repo/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
是否有任何我没有在 circle.yml 文件中声明的 sdk 依赖项?
问题出在执行器 (oraclejdk8) 上,它没有安装正确的 Android SDK 和 Google 存储库。
我通过从 CircleCI 1.0 迁移到 2.0 并设置 bitriseio/docker-android:latest(默认安装了正确的存储库)作为 docker 图像解决了这个问题。
这是我的决赛config.yml
version: 2
jobs:
build:
working_directory: /opt/working
docker:
- image: bitriseio/docker-android:latest
environment:
# Java options
JAVA_OPTS: "-Xms512m -Xmx2048m"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
steps:
- checkout
- run:
name: Accepts License
command: echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
- run:
name: Assemble & Test
command: ./gradlew assembleDebug testDebugUnitTest
- store_artifacts:
path: app/build/reports/tests/
destination: tests_reports/
- store_test_results:
path: "app/build/test-results/testDebugUnitTest/"
- store_artifacts:
path: app/build/outputs/apk/
destination: apks/