java - 我在 gradle 中遇到错误,我该怎么办?

标签 java android gradle

我想将cardview放入我的项目中,它需要实现依赖关系(基于我观看的内容)

我在我搜索的 build.gradle 中输入了依赖项,并同步了...

但是 gradle 项目无法同步,这是错误:

build.gradle:29: Gradle DSL method not found: 'imeplementation()'
Possible causes:
The project 'Notifier' 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).
<a href="fixGradleElements">Upgrade plugin to version 3.5.0 and sync project</a>

The project 'Notifier' may be using a version of Gradle that does not contain the method.
<a href="open.wrapper.file">Open Gradle wrapper file</a>

The build file may be missing a Gradle plugin.
<a href="apply.gradle.plugin">Apply Gradle plugin</a>

这是应用程序中的build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"
    defaultConfig {
        applicationId "com.example.notifier"
        minSdkVersion 15
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    imeplementation 'androidx.cardview:cardview:1.0.0'
}

最佳答案

您只是输入错误,implementation 不是 imeplementation

关于java - 我在 gradle 中遇到错误,我该怎么办?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60585768/

相关文章:

android - 单击电话号码文本时如何显示电话窗口

gradle - gradle.processResources 中的代码块取决于是否请求了另一个任务

java - Spring如何处理事务回滚异常?

java - 如何在JSP中的WEB-INF内提供外部javascript文件的路径

java - 创建的类和公共(public)方法未转到测试方法

java - 有没有更系统的方法来填充我的布局?

JavaFX CheckBoxTreeItem 选择

php - 流行的 Android 应用程序如何连接到服务器?

gradle - 有什么方法可以写更简洁的gradle?

eclipse - 我可以获得 gradle 来更新我现有的 Eclipse 项目吗?