0

挣扎了几个小时后,我能够设置我的码头集装箱。我YML文件如下:Bitbucket-Pipelines android build setup失败

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 

然而,当我使用“com.google.android.gms:发挥服务地点:11.0.2”在我bild.gradle文件我最终收到此错误:

FAILURE: Build failed with an exception. * What went wrong: Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.google.android.gms:play-services-location:11.0.2. Searched in the following locations: file:/opt/android-sdk/extras/m2repository/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.pom file:/opt/android-sdk/extras/m2repository/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.jar file:/opt/android-sdk/extras/google/m2repository/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.pom file:/opt/android-sdk/extras/google/m2repository/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.jar file:/opt/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-location/11.0.2/play-services-location-11.0.2.pom file:/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 Required by: project :app > project :sdk

任何帮助,非常感谢。

+0

请帮忙!!!! –

回答

0

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

image: mingc/android-build-box:latest 

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

我认为这是因为您使用gms库,但不包括谷歌maven回购到您的gradle脚本。

谷歌已经发布了自己的回购协议(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,下载的时间要少得多。

相关问题