gpt4 book ai didi

android - 找不到参数的方法 implementation() [com.google.android.material :material:1. 1.0]

转载 作者:行者123 更新时间:2023-12-05 00:09:56 26 4
gpt4 key购买 nike

我无法在 android 模拟器中运行我的应用程序。它以前可以工作,但是有什么东西破坏了它。

错误信息:

A problem occurred evaluating root project 'android'.
> Could not find method implementation() for arguments [com.google.android.material:material:1.1.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

我正在运行 gradle 3.2.1。这是我的 build.gradle 文件的 buildscript:
buildscript {
ext.kotlin_version = '1.2.71'
repositories {
google()
jcenter()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
}

dependencies {

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:3.2.1'
implementation "com.google.android.material:material:1.1.0"

}
}

最佳答案

那是顶级的gradle文件。
将此行移至 build.gradle 的依赖项部分app 文件夹中的文件,并更新为 1.1.0-beta01 :

implementation 'com.google.android.material:material:1.5.0-alpha03'
欲了解更多信息,请参阅此处: Why are there two build.gradle files in an Android Studio project?

关于android - 找不到参数的方法 implementation() [com.google.android.material :material:1. 1.0],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58290897/

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