Failed to resolve: com.android.support:appcompat-v7:28.0

后端 未结 9 1662
猫巷女王i
猫巷女王i 2020-12-05 22:48

When I use com.android.support:appcompat-v7:28.+ in my project\'s build.gradle(module) it works without any error. But when I just use com.an

相关标签:
9条回答
  • 2020-12-05 23:20

    implementation 'com.android.support:appcompat-v7:28.0' implementation 'com.android.support:support-media-compat:28.0.0' implementation 'com.android.support:support-v4:28.0.0' All to add

    0 讨论(0)
  • 2020-12-05 23:23

    Run

    gradlew -q app:dependencies
    

    It will remove what is wrong.

    0 讨论(0)
  • 2020-12-05 23:26

    As @Sourabh already pointed out, you can check in the Google Maven link what are the packages that Google has listed out.

    If you, like me, are prompted with a similar message to this Failed to resolve: com.android.support:appcompat-v7:28.0, it could be that you got there after upgrading the targetSdkVersion or compileSdkVersion.

    What is basically happening is that the package is not being found, as the message correctly says. If you upgraded the SDK, check the Google Maven, to check what are the available versions of the package for the new SDK version that you want to upgrade to.

    I had these dependencies (on version 27):

    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    

    And I had to change the SDK version and the rest of the package number:

    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    

    Now the packages are found and downloaded. Since the only available package for the 28 version of the SDK is 28.0.0 at the moment of writing this.

    0 讨论(0)
提交回复
热议问题