Could not find com.android.support:appcompat-v7:25.0.0

 

老的Android工程导入as报错如下:

10:36	Gradle sync failed: Could not find com.android.support:appcompat-v7:25.0.0.
			Required by:
			FuNongTong:app:unspecified (18 s 207 ms)

如果是gradle4.0及以下,增加maven { url "https://maven.google.com" },如下:

buildscript {
    repositories {
        jcenter()
        maven { url "https://maven.google.com" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'

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

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

如果是gradle4.0及以上,maven { url "https://maven.google.com" }替换为google()

如下:

buildscript {
    repositories {
        jcenter()
        google()
    }
    
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

 

你可能感兴趣的:(android)