将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()”
可能的原因:
The project '.....' 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.5.1 and sync project
The project '...' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file
The build file may be missing a Gradle plugin. Apply Gradle plugin
我是android开发的新手。我正在使用android studio。
先感谢您。
最佳答案
您在第一个implementation
声明中输入了错误。 imlementation
-> implementation
关于java - 错误:未找到Gradle DSL方法: 'imlementation()',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58642805/