Android Gradle 同步失败 - 需要 Gradle 版本 2.2。当前版本是 5.4.1

标签 android gradle

尝试将模块导入我的应用程序后,我收到一个错误:

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/

相关文章:

java - 谷歌登录 ApiException : 10:

java - Android 证明复制我的源代码

android - 无法在android studio中运行flutter项目

android - 重构程序包名称和重命名applicationID仍然使gradle失败

android - 返回类型与 FragmentPagerAdapter.getItem(int) 不兼容

android - TextEdit值改变时如何触发?

android - 动态功能 Activity 未加载,卡在安装中

android - 已安装Cordova gradle,但未找到

android - 通过gradle创建Android项目的zip及其依赖项

android - 在 Android Studio 中找不到 com.android.support :appcompat-v7:25. 3.1?