Failed to resolve: com.android.support:appcompat-v7 24.0.1-ThrowExceptions

Exception or error:

I have searched around a lot but I cannot really find a post that helps I am somewhat new to android so some of this goes over my head. Anyway, my problems started when I got an error saying gradle plugin was old and the sync would not complete. So I changed a few things around not really sure what I did. Now I have:

Error(25,13) Failed to resolve: com.android.support:appcompat-v7 24.0.1

Project gradle file:

    // Top-level build file where you can add configuration options common to     all sub-projects/modules.

    buildscript {
        repositories {
            jcenter()
        }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

app gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"
    defaultConfig {
        applicationId "com.bisesifreelance.maxbisesi.tic_tac_toe"
        minSdkVersion 23
        targetSdkVersion 24
        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:24.0.1'
    testCompile 'junit:junit:4.12'
}

Also I have installed all build tools in SDK manager I’m not allowed to embed images yet? but it says:

Android SDK Plaform-Tools 24.03 installed

Android SDK Tools 25.2.2 installed

Thank YOu! I’m very lost.

How to solve:

try

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

EDIT

For sdk 27

buildToolsVersion "27.0.3"

implementation "com.android.support:appcompat-v7:27.1.1"

###

You can also write like this:

allprojects {
        repositories {
            jcenter()
            maven {
                url "https://maven.google.com"
            }
        }
    }

###

Try adding jcenter like this way

repositories {
    jcenter {
        url "http://jcenter.bintray.com/"
    }
}

Rather than

  repositories {
        jcenter()
    }

###

Make sure that this folder exists:

\your-android-sdk\extras\android\m2repository\com\android\support\appcompat-v7\24.0.1

Of course, 24.0.1 should be replaced by the latest version.

I had this problem because I occasionally renamed 24.0.1 to something else and so the required folder couldn’t be found.

###

I had the same problem after updating Android Studio. In my case it was an issue of permissions as I do my day-to-day programming on my user account, while Android studio was installed and updated with the administrator account.

FIX:

Open the standalone SDK manager and go down to ‘extras’. Click on ‘Android Support Repository’ (which will probably set as ‘Not installed’) and install the packages. If you are prompted with an error message saying something like ‘error trying to rename folder’. Go to the folder that is mentioned in the message and make sure that the permissions are set correctly. After that click ‘Try Again’ and it should install the package without a problem.

NOTE: This might happen a few more times. Just repeat the process for each file. The problem should then be solved.

###

Change a character - to :

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

rather than

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

###

try update the IDE and remove earlier build version (like 23) after installing later one and rename it to newer one.

###

Open SDK Manager and update the Extras–>Android Support Repository.

Path ..sdk\extras\android\m2repository\com\android\support\appcompat-v7>

Check for the updated version being installed.

###

In build.gradle in all projects, add Marvel and add this URL ‘https://maven.google.com

Leave a Reply

Your email address will not be published. Required fields are marked *