简体   繁体   English

错误:未找到 Gradle DSL 方法:“实施()”

[英]ERROR: Gradle DSL method not found: 'imlementation()'

My app is not working after I updated my android phone to Android 10. So I migrated my app to androidx.在我将 android 手机更新为 Android 10 后,我的应用程序无法运行。所以我将我的应用程序迁移到了 androidx。 Now I am trying to update my gradle from 2.3.1 to 3.5.1.现在我正在尝试将我的 gradle 从 2.3.1 更新到 3.5.1。

This is my build.gradle(Project:) file -这是我的 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'
        }
    }
}

My build.gradle(Project:) file is -我的 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('....')
}

This is the Error I get -这是我得到的错误 -

ERROR: Gradle DSL method not found: 'imlementation()' Possible causes:错误:未找到 Gradle DSL 方法:'imlementation()' 可能的原因:

The project '.....' may be using a version of the Android Gradle plug-in that does not contain the method (eg 'testCompile' was added in 1.1.0).项目“.....”可能正在使用不包含该方法的 Android Gradle 插件版本(例如,在 1.1.0 中添加了“testCompile”)。 Upgrade plugin to version 3.5.1 and sync project将插件升级到 3.5.1 版本并同步项目

The project '...' may be using a version of Gradle that does not contain the method.项目“...”可能正在使用不包含该方法的 Gradle 版本。 Open Gradle wrapper file打开 Gradle 包装文件

The build file may be missing a Gradle plugin.构建文件可能缺少 Gradle 插件。 Apply Gradle plugin应用 Gradle 插件

I am new to android development.我是 android 开发的新手。 I am using android studio.我正在使用 android 工作室。

Thank you in advance.先感谢您。

You made a typo in your first implementation declaration.您在第一个implementation声明中打错了字。 imlementation -> implementation . imlementation -> implementation

Change imlementation变更imlementation

to

implementation

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM