首页 > 解决方案 > 我无法添加任何库

问题描述

当我尝试添加任何库时,我有一个简单的错误:

无法解析“:app@debug/compileClasspath”的依赖关系:无法解析androidx.recyclerview:recyclerview:1.2.0。显示详细信息 受影响的模块:app

我只添加了一个 RecyclerView。我的毕业生:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.abbasmehdipur.myapplication"
        minSdkVersion 23
        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.2.0'
        implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
        implementation 'androidx.recyclerview:recyclerview:1.2.0'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'androidx.test.ext:junit:1.1.2'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    
    }

标签: android-studiogradle

解决方案


终于发现问题了!!!只是一个糟糕的代理设置。


推荐阅读