[英]Android Studio 3.0 Gradle sync fails ,returns google app engine error
我升级到Android Studio 3.0,并在导入项目后,Gradle无法同步。这是我的gradle配置。
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.xxxxx.xxxx"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
gradle同步失败并返回此错误:
Error:com/google/appengine/gradle/model/AppEngineModelcom/google/appengine/gradle/model/AppEngineModel
这是Project gradle配置文件。
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
可能是什么问题呢?
试一试
在Gradle文件中添加以下行
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
确保您的项目级Gradle文件位于google()
。
这是样本
buildscript {
repositories {
google() // make sure this repo. is in your gradle
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
google() // make sure this repo. is in your gradle
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我重新安装了Android Studio 3.0.1,一切正常
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.