'ERROR: Failed to resolve: com.android.support:appcompat-v7:29.0.1' [duplicate]

孤人 提交于 2019-11-26 06:49:05

问题


This question already has an answer here:

  • Android Studio keeps refusing to resolve com.android.support:appcompat-v7:29.0.1 4 answers

I want to try Intellij Platform for android development but even after fresh it shows gradle failures. Please help.

I have tried tweaking the line

implementation \'com.android.support:appcompat-v7:29.+\'

to some other versions but to no avail.

Here is my module level gradle

    apply plugin: \'com.android.application\'

android {
    compileSdkVersion 29
    buildToolsVersion \"29.0.1\"
    defaultConfig {
        applicationId \"com.example.myapplication\"
        minSdkVersion 23
        targetSdkVersion 29
        versionCode 1
        versionName \"1.0\"
        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile(\'proguard-android-optimize.txt\'), \'proguard-rules.pro\'
        }
    }
}

dependencies {
    implementation fileTree(dir: \'libs\', include: [\'*.jar\'])
    implementation \'com.android.support:appcompat-v7:29.+\'
    implementation \'com.android.support.constraint:constraint-layout:1.1.3\'
    testImplementation \'junit:junit:4.12\'
    androidTestImplementation \'com.android.support.test:runner:1.0.2\'
    androidTestImplementation \'com.android.support.test.espresso:espresso-core:3.0.2\'
}

Here is my project level Gradle

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

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath \'com.android.tools.build:gradle:3.1.0\'

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

allprojects {
    repositories {
        google()
        jcenter()

    }
}

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

The errors which I am getting while Intellij builds the gradles are

ERROR: Unable to resolve dependency for \':app@debug/compileClasspath\': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for \':app@debugAndroidTest/compileClasspath\': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for \':app@debugUnitTest/compileClasspath\': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for \':app@release/compileClasspath\': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for \':app@releaseUnitTest/compileClasspath\': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Show Details
Affected Modules: app


ERROR: Failed to resolve: com.android.support:appcompat-v7:29.0.1
Affected Modules: app

回答1:


Migrate to androidX by going to:

Refactor->Migrate to androidX



来源:https://stackoverflow.com/questions/57198936/error-failed-to-resolve-com-android-supportappcompat-v729-0-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!