【问题标题】:Bitbucket-Pipelines android build setup failsBitbucket-Pipelines android 构建设置失败
【发布时间】:2017-12-10 00:53:05
【问题描述】:

经过几个小时的努力,我能够设置我的 docker 容器。我的 yml 文件如下:

image: mingc/android-build-box:latest

pipelines:
  default:
    - step:
        script:
            # Grab the Android Support Repo which isn't included in the container
            - echo y | android update sdk --filter "extra-android-m2repository" --no-ui -a
            # Accept preview licences
            - echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_SDK_HOME/licenses/android-sdk-preview-license"
            - ./gradlew assembleDebug --info

但是,当我在 bild.gradle 文件中使用“com.google.android.gms:play-services-location:11.0.2”时,我最终收到此错误:

FAILURE:构建失败并出现异常。 * 出了什么问题:无法解析配置 ':app:debugRuntimeClasspath' 的所有文件。 找不到 com.google.android.gms:play-services-location:11.0.2。 在以下位置搜索: 文件:/opt/android-sdk/extras/m2repository/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.pom 文件:/opt/android-sdk/extras/m2repository/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.jar 文件:/opt/android-sdk/extras/google/m2repository/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.pom 文件:/opt/android-sdk/extras/google/m2repository/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.jar 文件:/opt/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.pom 文件:/opt/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.jar https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.pom https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.jar https://jcenter.bintray.com/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.pom https://jcenter.bintray.com/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.jar https://jitpack.io/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.pom https://jitpack.io/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.jar https://repo1.maven.org/maven2/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.pom https://repo1.maven.org/maven2/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.jar https://oss.sonatype.org/content/repositories/snapshots/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.pom https://oss.sonatype.org/content/repositories/snapshots/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.jar 要求: 项目:应用程序>项目:sdk

非常感谢任何帮助。

【问题讨论】:

  • 请帮忙!!!

标签: android android-gradle-plugin continuous-integration bitbucket-pipelines


【解决方案1】:

试试这个,它对我来说很好。

image: mingc/android-build-box:latest

pipelines:
  default:
  - step:
      script:
        - chmod +x gradlew
        - ./gradlew assemble

【讨论】:

    【解决方案2】:

    我认为这是因为您使用的是 gms 库,但未将 google maven repo 包含到您的 gradle 脚本中。

    Google 已经发布了自己的 repo(https://developer.android.com/studio/build/dependencies.html#google-maven),you 可以将其添加到您的项目中。

    请检查您的 build.gradle 并添加 google()(如果您使用的是 android gradle 插件 3.0)或

    maven { url "https://maven.google.com" } 进入

    allprojects { repositories { ... } }

    部分。

    顺便说一句,在大多数情况下,一个小型的 android sdk docker 就足以用于 CI 管道,也许你可以试试 https://hub.docker.com/r/zhywang/android-sdk/,它只有 ~700MB,下载时间要少得多。

    【讨论】:

      猜你喜欢
      • 2019-11-30
      • 2020-10-31
      • 2018-08-20
      • 1970-01-01
      • 2022-09-30
      • 1970-01-01
      • 2011-03-12
      • 2019-01-01
      • 1970-01-01
      相关资源
      最近更新 更多