![](/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.