android - 无法解析 : com. android.support :appcompat-v7:27. 0.2

标签 android gradle

我厌倦了在 android studio 中解决这个错误。我真的浪费了宝贵的 2 天时间来解决这个愚蠢的错误。伙计们,请尝试帮助我摆脱这种情况。不要认为我在 SO 上留下了任何我没有尝试过的链接。但没有运气。

我正在使用 android studio 2.3.3

我的根级gradle文件如下:-

    buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.google.gms:google-services:3.0.0'

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

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

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

我的应用构建如下:-

  apply plugin: 'com.android.application'
    android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.myAppId"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

    repositories {
    mavenCentral()
}

    dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    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:25.2.0'
    compile 'com.android.support:recyclerview-v7:25.2.+'
    compile 'com.android.support:design:25.2.0'
    compile 'com.google.code.gson:gson:2.6.2'
    compile 'com.squareup.retrofit2:retrofit:2.0.2'
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.squareup.retrofit2:converter-gson:2.0.2'
    compile 'com.squareup.retrofit2:converter-scalars:2.3.0'
    compile 'com.google.android.gms:play-services-location:9.2.1'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.google.android.gms:play-services-auth:9.2.1'
    testCompile 'junit:junit:4.12'
    compile files('libs/ormlite-android-4.43.jar')
    compile files('libs/ormlite-core-4.43.jar')
    compile files('libs/universal-image-loader-1.9.5.jar')
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.androidanimations:library:1.0.3@aar'
    compile 'in.srain.cube:grid-view-with-header-footer:1.0.12'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:palette-v7:25.2.0'
    compile 'com.github.jd-alexander:LikeButton:0.2.1'
    compile 'com.github.techery:properratingbar:0.0.5'
    compile 'com.github.GoodieBag:Pinview:v1.3'
    compile project(':library')
}
apply plugin: 'com.google.gms.google-services'

我的 gradle-wrapper.properties:-

 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
 distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

我使用的构建工具版本为 25.0.2。我不知道为什么它会给我错误 27.0.2。

我面临以下错误:-

Error in AS

最佳答案

得到解决方案。 只是 替换

compile 'com.facebook.android:facebook-android-sdk:[4,5)'

compile 'com.facebook.android:facebook-android-sdk:4.26.0'

关于android - 无法解析 : com. android.support :appcompat-v7:27. 0.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49553887/

相关文章:

java - 我似乎不能从 firebase 数据库中引用用户 ID 下的 child

android - 如何将 Activity 从下拉菜单中的通知放在前面?

node.js - 通过 Gradle 将文件复制到构建目录

java - 如何在 gradle 5.0.0 中将 bootRepackage 任务转换为 kotlin DSL?

android - PluginApplicationException : Failed to apply plugin class 'FlutterPlugin'

gradle - 如何懒惰地配置一个 Gradle 任务?

android - 如何从 Android 设备中获取音频文件的路径或 uri?

android - SeekBar 的拇指上的半径必须 > 0

Java & 安卓 : Best way to create a dynamically expandable list of EditTexts in an activity?

android - 自动生成的代码(如Dagger2)在持续集成中存在严重问题