找不到cardview.jar(androidx.cardview:cardview:1.0.0)

问题描述 投票:0回答:1

我的项目运行正常,但是今天当我打开它时,尽管我没有使用任何卡片视图,但都有此错误。我的其他项目构建良好,但只有该项目无法构建。

找不到cardview.jar(androidx.cardview:cardview:1.0.0)。

我的课程路径是:classpath'com.android.tools.build:gradle:3.5.1'

我手动添加了cardview库,但是它也无法正常工作。

我添加了

maven {
            url "https://maven.google.com"
        }

但是它也不起作用。

我手动添加了cardview库,但是它也无法正常工作。

这是我的gradle代码项目级别

buildscript {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
        maven {
            url "https://maven.google.com"
        }
        maven { url 'https://maven.fabric.io/public' }

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

这是我的Gradle代码应用级别

应用插件:'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.intechdev.tcommerce"
        minSdkVersion 21
        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'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.9'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
    implementation 'com.squareup.retrofit2:retrofit:2.6.2'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'androidx.exifinterface:exifinterface:1.0.0'
    implementation 'com.github.tiper:MaterialSpinner:1.3.3'
    implementation 'de.hdodenhof:circleimageview:3.0.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.2.0'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.google.android.gms:play-services-auth:17.0.0'
    implementation 'com.mikhaellopez:circularimageview:4.0.2'
    implementation "androidx.preference:preference:1.1.0"
    implementation 'com.android.support:multidex:1.0.3'
    implementation "com.github.bumptech.glide:glide:4.9.0"
    implementation 'com.iarcuschin:simpleratingbar:0.1.5'
    annotationProcessor "com.github.bumptech.glide:compiler:4.9.0"
    implementation "com.github.firdausmaulan:GlideSlider:1.5.1"
    api 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
    implementation 'com.justkiddingbaby:vercodeedittext:1.1.0'
    implementation 'com.google.android.material:material:1.1.0-beta01'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
android android-studio android-cardview androidx materialcardview
1个回答
0
投票

您没有添加CardView库。

将此内容添加到新行的依赖项中:

 implementation 'androidx.cardview:cardview:1.0.0'

然后同步您的Gradle文件,它应该可以解决问题。

© www.soinside.com 2019 - 2024. All rights reserved.