Android Gradle Error: Could not download library-1.8.aar (com.nbsp:library:1.8)

Viewed 1866

Out of nowhere I got this error:

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download library-1.8.aar (com.nbsp:library:1.8)
Show Details
Affected Modules: app

This is my app gradle file:

android {
    compileSdkVersion 30
    defaultConfig {
        applicationId "..."
        minSdkVersion 21
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
dependencies {
implementation 'com.nbsp:library:1.8'
implementation 'com.android.volley:volley:1.2.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.material:material:1.3.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

It worked fine yesterday but today when I opened Android Studio, I got this error. I've searched, but not find a solution. I don't know why it's showing me this, also Show Details link doesn't work.

1 Answers

This seems to work for me: I replaced

implementation 'com.nbsp:library:1.8'

with

implementation 'com.nbsp:materialfilepicker:1.9.1'

The library:1.8 was used by MaterialFilePicker but when I went to their github I saw that they change it with materialfilepicker:1.9.1

And I also had to add the following compileOption in the gradle file:

android {
.....................
compileOptions {
    sourceCompatibility 1.8
    targetCompatibility 1.8
}
}

And also Build->Clean project and then Rebuild project

Related