CardView依赖关系链接失败

时间:2019-10-12 07:13:48

标签: android android-studio dependencies android-cardview

I want to display a dialog box to display a message along with two buttons (SignIn and Close). But it's giving me a Resource Linking Failed error. though I have a dependency of cardview in my build gradle file (app). Application runs with zero errors but build is failing. 

以下是我尝试同步它的不同方式:

implementation 'com.android.support:cardview-v7:+'
implementation 'com.android.support:cardview-v7:28.0.0-alpha3'
compile 'com.android.support:cardview-v7:28.0.0'

以下是事件日志中的错误: 9:25 AM仿真器:仿真器:警告:UpdateCheck:失败:错误

9:26 AM Gradle构建在1 m 15 s 453毫秒内失败

上午9:26模拟器:模拟器:警告:AsyncSocketServer.cpp:99:接受主机连接时出错错误消息:未知错误

9:26 AM执行任务:项目C:\ Users \ Maryam \ AndroidStudioProjects \ Sign_Up中的[:app:assembleDebug]

9:26 AM Gradle构建在18秒154毫秒内失败

9:26 AM建立APK:建立APK时发生错误。您可以在“消息”视图中找到错误。

9:29 AM Gradle同步开始于单变量同步

上午9:30 Gradle同步失败:在类型org.gradle.api.internal.artifacts.dsl类型的对象上找不到参数[com.android.support:cardview-v7:26.+]的方法implemantation() .dependencies.DefaultDependencyHandler。 (8秒722毫秒) 这是我的构建Gradle文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.example.sign_up"
        minSdkVersion 15
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    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.android.material:material:1.0.0'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
    implementation 'androidx.vectordrawable:vectordrawable:1.0.1'
    implementation 'androidx.navigation:navigation-fragment:2.0.0'
    implementation 'androidx.navigation:navigation-ui:2.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'androidx.gridlayout:gridlayout:1.0.0'
    implementation 'com.android.support:cardview-v7:+'
}

0 个答案:

没有答案