在圆 ci 中找不到 com.android.tools.build:gradle:3.0.0-alpha1 [英] Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci

查看:22
本文介绍了在圆 ci 中找不到 com.android.tools.build:gradle:3.0.0-alpha1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 gradle 插件更新到最新版本:com.android.tools.build:gradle:3.0.0-alpha1 并且发生了这个错误:

I update the gradle plugin to the latest : com.android.tools.build:gradle:3.0.0-alpha1 and this error occured :

export TERM="dumb"
if [ -e ./gradlew ]; then ./gradlew test;else gradle test;fi

FAILURE: Build failed with an exception.

What went wrong:
    A problem occurred configuring root project 'Android-app'. Could not
 resolve all dependencies for configuration ':classpath'. Could not
 find com.android.tools.build:gradle:3.0.0-alpha1. Searched in the
 following locations:
 https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha1/gradle-3.0.0-alpha1.pom
 https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha1/gradle-3.0.0-alpha1.jar
 Required by:

当前 circle.yml

Current circle.yml

dependencies:
   pre:
      - mkdir -p $ANDROID_HOME"/licenses"
      - echo $ANDROID_SDK_LICENSE > $ANDROID_HOME"/licenses/android-sdk-license"
      - source environmentSetup.sh && get_android_sdk_25

   cache_directories:
    - /usr/local/android-sdk-linux
    - ~/.android
    - ~/.gradle
   override:
    - ./gradlew dependencies || true

test:
  post:
    - mkdir -p $CIRCLE_TEST_REPORTS/junit/
    - find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;

machine:
    java:
        version: oraclejdk8

我的gradle文件:

My gradle file :

buildscript {
  repositories {
    jcenter()
    maven {
      url 'https://maven.google.com'
    }
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
    classpath 'com.google.gms:google-services:3.0.0'
    classpath "io.realm:realm-gradle-plugin:3.1.3"
  }
}

allprojects {
  repositories {
    mavenCentral()
    jcenter()
  }
}

task clean(type: Delete) {
  delete rootProject.buildDir
}

推荐答案

Google 有新的 maven repo

Google have new maven repo

https://android-developers.googleblog.com/2017/10/android-studio-30.html > 部分 Google 的 Maven 存储库

https://developer.android.com/studio/preview/features/new-android-plugin-migration.htmlhttps://developer.android.com/studio/build/dependencies.html#google-maven

所以添加对maven repo的依赖:

So add the dependency on maven repo:

buildscript {
    repositories {
        ...
        // You need to add the following repository to download the
        // new plugin.
        google() // new which replace https://maven.google.com
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.3'  //Minimum supported Gradle version is 4.6.
    }
}

这篇关于在圆 ci 中找不到 com.android.tools.build:gradle:3.0.0-alpha1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆