我收到此错误 评估项目":app"时出现问题。同步我的项目时?



我已经从github下载了一个项目。我试着运行它,但是它运行失败了,给了我那个错误。这是我的煎锅。构建文件

apply plugin: 'com.android.application'
repositories {
mavenLocal()
flatDir {
dirs 'libs'
}
}
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.google.firebase.udacity.friendlychat"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
mplementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
// Displaying images
implementation 'com.github.bumptech.glide:glide:3.6.1'
}

,这里是每次运行

时得到的错误信息
A problem occurred evaluating project ':app'.
> Could not find method mplementation() for arguments [androidx.appcompat:appcompat:1.2.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

这是我想在android studio中运行的项目的链接

https://github.com/udacity/and-nd-firebase

在gradle文件的dependencies块的第一行有一个拼写错误。

dependencies {
mplementation 'androidx.appcompat:appcompat:1.2.0'
...
}

如果你看一下错误,它说:Could not find method implementation ()

请将mplementation 'androidx.appcompat:appcompat:1.2.0'
改为implementation 'androidx.appcompat:appcompat:1.2.0'

实施拼写错误。
做上述更改并重新同步您的项目。

答案已经在错误中了。有一个"我";在第一个实现中缺失。

mplementation 'androidx.appcompat:appcompat:1.2.0'

需要更改为

implementation 'androidx.appcompat:appcompat:1.2.0'

最新更新