![](/img/trans.png)
[英]Gradle Error:Gradle DSL method not found: 'executeWithoutThrowingTaskFailure()'
[英]ERROR: Gradle DSL method not found: 'imlementation()'
在我将 android 手机更新为 Android 10 后,我的应用程序无法运行。所以我将我的应用程序迁移到了 androidx。 现在我正在尝试将我的 gradle 从 2.3.1 更新到 3.5.1。
这是我的 build.gradle(Project:) 文件 -
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
我的 build.gradle(Project:) 文件是 -
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "....."
minSdkVersion 19
targetSdkVersion 29
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
imlementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation files('....')
implementation files('....')
implementation files('....')
implementation files('....')
}
这是我得到的错误 -
错误:未找到 Gradle DSL 方法:'imlementation()' 可能的原因:
项目“.....”可能正在使用不包含该方法的 Android Gradle 插件版本(例如,在 1.1.0 中添加了“testCompile”)。 将插件升级到 3.5.1 版本并同步项目
项目“...”可能正在使用不包含该方法的 Gradle 版本。 打开 Gradle 包装文件
构建文件可能缺少 Gradle 插件。 应用 Gradle 插件
我是 android 开发的新手。 我正在使用 android 工作室。
先感谢您。
您在第一个implementation
声明中打错了字。 imlementation
-> implementation
。
变更imlementation
至
implementation
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.