尝试将模块导入我的应用程序后,我收到一个错误:
Gradle version 2.2 is required. Current version is 5.4.1.
Please fix the project's Gradle settings.
Fix Gradle wrapper and re-import project
Open Gradle wrapper properties
Gradle settings
一切正常:/这是我的 Gradle 文件:
buildscript {
ext.kotlin_version = '1.3.60'
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02'
}
}
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
和 wrapper.properties 文件
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
我试图使缓存无效,但没有奏效。任何的想法 ?我要疯了!
最佳答案
您必须进入新模块文件夹并找到 build.gradle
文件并修复该文件(更改 gradle 版本和其他版本)
关于Android Gradle 同步失败 - 需要 Gradle 版本 2.2。当前版本是 5.4.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60616484/