gpt4 book ai didi

android - 如何在 Android Studio 3.3 上修复 "ERROR: Gradle DSL method not found"

转载 作者:行者123 更新时间:2023-11-29 16:30:46 25 4
gpt4 key购买 nike

我刚刚在我的电脑上安装了 Android Studio 3.3 和 Java,当我打开一个新项目时立即出现这个错误。

ERROR: Gradle DSL method not found: 'testImplementation()'
Possible causes:
The project 'My Application' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 3.4.0 and sync project

The project 'My Application' may be using a version of Gradle that does not contain the method.
Gradle settings

The build file may be missing a Gradle plugin.
Apply Gradle plugin

当我尝试手动更新时,我下载了 gradle 5.4.0 并手动安装。 (我还检查了 cmd 以查看其版本。)

然后我变了

buildscript {
ext.kotlin_version = '1.3.31'
repositories {
google()
jcenter()

}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

这些代码到 gradle:5.4.0 我仍然有同样的错误。我该如何修复它?

    }
dependencies {
classpath 'com.android.tools.build:gradle:5.4.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

最佳答案

如果你有一个土耳其工作站,那么在 build.gradle 中改变:

testImplementation -> testİmplementation
androidTestImplementation -> androidTestİmplementation
androidTestImplementation -> androidTestİmplementation

关于android - 如何在 Android Studio 3.3 上修复 "ERROR: Gradle DSL method not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55867078/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com