Android Studio org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException:

Mah*_*fin 12 android gradle

我想通过 hbb20 集成国家/地区代码选择器。我放置了依赖项并构建,这很好,但是每当我尝试运行该应用程序时,我都会收到此错误:

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.

我的 build.gradle 应用程序级别代码:

plugins {
    id 'com.android.application'
}

android {
    compileSdk 31

    defaultConfig {
        applicationId "com.teamphoenix.amarflat"
        minSdk 22
        targetSdk 31
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation "com.github.skydoves:powerspinner:1.1.9"
    implementation 'com.hbb20:ccp:2.4.7'
}
Run Code Online (Sandbox Code Playgroud)

小智 5

我在使用 mik3y 的 USB 转串口时遇到了同样的问题。

我错误地使用了:

com.github.mik3y:usb-serial-for-android:标签

并将其更改为:

com.github.mik3y:usb-serial-for-android:3.4.3

解决了问题。

我建议您检查所有依赖项,可能其中之一没有正确指向其存储库,我希望我可以帮助您。顺便说一句,代码末尾的(```)肯定只是一个编辑错误,对吧?