无法在圈子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

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

问题描述

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

  export TERM =dumb
if [-e ./gradlew];然后./gradlew测试; else gradle测试; fi

失败:生成失败,出现异常。

出错:
配置root项目'Android-app'时发生问题。
无法解析配置':classpath'的所有依赖关系。
找不到$ com.android.tools.build:gradle:3.0.0-alpha1。在以下位置搜索

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
要求:

当前的circle.yml

 依赖项:
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
覆盖:
- ./gradlew依赖关系||真

测试:
发布:
- mkdir -p $ CIRCLE_TEST_REPORTS / junit /
- 查找。 -type f -regex。* / target / surefire-reports /.* xml-exec cp {} $ CIRCLE_TEST_REPORTS / junit / \;

机器:
java:
版本:oraclejdk8



<编辑:
我的gradle文件:

  buildscript {
repositories {
jcenter )
maven {
url'https://maven.google.com'
}
}
依赖关系{
classpath'com.android.tools .build:gradle:3.0.0-alpha1'
classpath'com.google.gms:google-services:3.0.0'
classpathio.realm:realm-gradle-plugin:3.1.3

}

allprojects {
储存库{
mavenCentral()
jcenter()
}
}

任务清理(类型:删除){
删除rootProject.buildDir
}


解决方案

谷歌有新的maven repo,所以可能是它的原因。 $ b

https://android-developers.googleblog.com/2017/10/an droid-studio-30.html > section Google的Maven Repository

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



因此,也许(未测试)添加对maven repo的依赖关系:

  buildscript {
存储库{
...
//您需要添加以下存储库以下载
//新插件。
google()//替换为https://maven.google.com
}

依赖关系{$ b $ classpath'com.android.tools.build: gradle:3.1.0'
}
}


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:

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

Edit: 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 have new maven repo, so it could be the reason.

https://android-developers.googleblog.com/2017/10/android-studio-30.html > section Google's Maven Repository

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

So maybe (not tested) 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
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
    }
}

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

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