找不到com.andorid.tools.build:gradle:3.0.0-beta2

我无法解决与gradle文件相关联的问题。为解决这个问题,我已经下载了android studio 3.0 beta 6,其中的项目是没有build立。 并在Android Studio 2.3.2以下问题来了

顶级gradle

buildscript { repositories { jcenter() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:3.0.0-beta6' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files classpath 'com.google.gms:google-services:3.1.0' classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' } } allprojects { repositories { jcenter() maven { url "https://maven.google.com" } maven { url 'https://jitpack.io' } } } task clean(type: Delete) { delete rootProject.buildDir } 

问题

 Error:Could not find com.android.tools.build:gradle:3.0.0-beta2. Searched in the following locations: file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/3.0.0-beta2/gradle-3.0.0-beta2.pom file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/3.0.0-beta2/gradle-3.0.0-beta2.jar https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-beta2/gradle-3.0.0-beta2.pom https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-beta2/gradle-3.0.0-beta2.jar https://repo1.maven.org/maven2/com/android/tools/build/gradle/3.0.0-beta2/gradle-3.0.0-beta2.pom https://repo1.maven.org/maven2/com/android/tools/build/gradle/3.0.0-beta2/gradle-3.0.0-beta2.jar Required by: project : 

编辑:
刚刚添加的谷歌Maven回购:

顶级gradle

 buildscript { repositories { jcenter() mavenCentral() maven { url "https://maven.google.com" } } dependencies { // classpath 'com.android.tools.build:gradle:3.0.0-beta6' classpath 'com.android.tools.build:gradle:3.0.0-beta6' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files classpath 'com.google.gms:google-services:3.1.0' classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' } } //allprojects { // repositories { // jcenter() // maven { url "https://maven.google.com" } // maven { url 'https://jitpack.io' } // } //} task clean(type: Delete) { delete rootProject.buildDir } 

Gradle包装

 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip #distributionUrl= https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip 

在这里输入图像说明

编辑:
取消注释allproject块之后

错误 在这里输入图像说明 这个问题怎么解决? 我已经看过很多解决scheme,但无法解决这个问题

Related of "找不到com.andorid.tools.build:gradle:3.0.0-beta2"

你必须在顶层 build.gradle文件中的buildscript块中添加maven google

 buildscript { repositories { jcenter() ... // You need to add the following repository to download the // new plugin. maven { url "https://maven.google.com" } } dependencies { classpath 'com.android.tools.build:gradle:3.0.0-beta6' //... } } 

这个版本的插件也需要更新版本的gradle。 您必须更新gradle-wrapper.properties中的gradle-wrapper.properties ,如下所示:

 distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 

更多关于这个插件3.0.x的信息 。

 repositories { jcenter() ... // You need to add the following repository to download the // new plugin. maven { url "https://maven.google.com" } //THIS google() //OR THIS } 

同时删除.gradle和gradle文件夹并重新同步项目。 问题与caching

我已经通过使用Android Studio 3.0 Beta2解决了这个问题。 我刚刚改变了如下的gradle依赖关系

顶级gradle依赖关系

 buildscript { repositories { jcenter() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:3.0.0-beta2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files classpath 'com.google.gms:google-services:3.1.0' classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' } } allprojects { repositories { jcenter() maven { url "https://maven.google.com" } maven { url 'https://jitpack.io' } } } task clean(type: Delete) { delete rootProject.buildDir } 

我刚刚改变beta6 beta2.I不知道它是如何工作正常,但它工作正常