Failed to resolve: com.android.support:appcompat-v7:30.0.0
Asked Answered
L

5

5

I am beginner and getting this error in Android Studio :-

Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:30.0.0 Install Repository and sync project
Show in File
Show in Project Structure dialog

And here is my gradle code :-

apply plugin: 'com.android.application'

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.0"
    defaultConfig {
        applicationId "com.example.piyushbairagi.demoapp"
        minSdkVersion 15
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:30.0.0'
    testCompile 'junit:junit:4.12'
}

I am using Android Studio 2.2.1 version for learning purpose. Any help will really be appreciated.

Lawsuit answered 16/6, 2020 at 19:20 Comment(0)
D
9

It happens because the support libraries v.30 don't exist.

Use the androidx library:

implementation 'androidx.appcompat:appcompat:1.1.0'

or use the last support library:

implementation 'com.android.support:appcompat-v7:28.0.0'
Dynamoelectric answered 16/6, 2020 at 19:29 Comment(1)
I've not migrating to AndroidX, so I've got problem with: 'com.android.support:appcompat-v7:28.0.0'but succeeded with implementation 'com.android.support:appcompat-v7:25.1.0'Primary
F
8
android.useAndroidX=true
android.enableJetifier=true

You can add these to the gradle.properties file and this shall work fine. I had the same issue and adding these removed the error. Also try updating all the plugins and components of the Android studio.

Frost answered 7/7, 2020 at 6:29 Comment(0)
C
0

Latest version available for Support Libraries is 28.0.0.

So, you must update your build.gradle as follows:

compile 'com.android.support:appcompat-v7:28.0.0'

Support library was discontinued. So, don't expect any new release after 28.0.0.

Google is now supporting AndroidX. In a certain (and basic) way, is the same thing. So, you may want to consider to migrate your app to Android X in order to get support from Google.

More info about Android X:

https://developer.android.com/jetpack/androidx/migrate

Circuity answered 16/6, 2020 at 21:35 Comment(0)
S
0

This error is probably due to the fact that you do not have the updated Gradle and sdk installed in Android Studio. You must be install updated version of those or change targetsdk version and sdk version and compile appcompact to The version of you installed in pc as picture.enter image description here

Safety answered 3/3, 2021 at 9:7 Comment(0)
T
-1

Generally, the problem is about your sdk version just check it may correspond to your dependencies version 27.+ or 26.0 etc ....

Just check the version of your sdk it may correspond to the needed version for your app like in this picture

enter image description here

enter image description here

Tertullian answered 23/2, 2021 at 12:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.