错误:找不到com.android.support:support-v4:27.0.1

时间:2017-12-20 13:25:51

标签: android gradle

将Gradle更新为3.3并将Android Studio版本更新为3.0.1后,我收到以下错误

错误

  

错误:找不到com.android.support:support-v4:27.0.1。需要   通过:       项目:app> com.android.support:design:25.2.0       项目:app> com.android.support:design:25.2.0> com.android.support:transition:25.2.0

     

有关详细信息,请参阅IDE日志(帮助|显示日志)

     

请从Android SDK安装Android支持存储库   管理器。

App Gradle配置: -

useLibrary 'org.apache.http.legacy'
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        vectorDrawables.useSupportLibrary = true
        applicationId "com.cyberrafting.joinapp"
        minSdkVersion 17
        targetSdkVersion 25
        versionCode 9
        versionName "9"
        multiDexEnabled true

3 个答案:

答案 0 :(得分:9)

根据https://developer.android.com/topic/libraries/support-library/setup.html,确保您包含maven.google.com repo

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

答案 1 :(得分:0)

更改您的编译版本和构建工具版本

compileSdkVersion 27
buildToolsVersion '27.0.2'

以及所有支持库到27.0.2

答案 2 :(得分:-1)

将此代码复制到android / build.gradle文件中

allprojects {
    repositories {
        mavenLocal()
        maven { url 'https://maven.google.com' }
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}