错误:无法解决:com.android.support:support-annotations:27.0.1 - Android Studio

时间:2017-12-06 10:52:47

标签: android gradle

我正在开发一个项目,2-3天前它工作正常并安装在连接到系统的设备上。 但是今天我试图将它安装在设备上并出现错误,

Error:Failed to resolve: com.android.support:support-annotations:27.0.1
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:/home/sharan/Dropbox/ptfix_androidlocal/ptfix/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

还有更多的similer错误。

。请参见屏幕截图。here

我的应用 Gradle代码如下。

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.1'
    defaultConfig {
        applicationId "com.ameba.ptfix"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    android {
        useLibrary 'org.apache.http.legacy'
        packagingOptions {
            exclude 'META-INF/DEPENDENCIES.txt'
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/NOTICE.txt'
            exclude 'META-INF/NOTICE'
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/DEPENDENCIES'
            exclude 'META-INF/notice.txt'
            exclude 'META-INF/license.txt'
            exclude 'META-INF/dependencies.txt'
            exclude 'META-INF/LGPL2.1'
        }

    }

}
repositories {
    jcenter()
    maven { url "https://dl.bintray.com/drummer-aidan/maven" }
    flatDir {
        dirs 'libs'
    }
    maven {
        url = 'https://oss.sonatype.org/content/repositories/snapshots/'
    }
}

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

dependencies {
    compile('org.apache.httpcomponents:httpmime:4.3') {
        exclude module: "httpclient"
    }
    compile('org.apache.httpcomponents:httpcore:4.4.1') {
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'

    }
    compile project(':slideDateTimePicker')
    compile project(':ImageCropper')

    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.android.support:design:25.1.0'
    compile 'com.android.support:support-v4:25.1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'com.google.android.gms:play-services:10.2.1'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.akexorcist:RoundCornerProgressBar:2.0.3'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.github.sundeepk:compact-calendar-view:2.0.0'
    compile 'com.afollestad:material-camera:0.4.4'
    compile 'life.knowledge4:k4l-video-trimmer:1.1.3-SNAPSHOT'
    compile 'com.google.firebase:firebase-messaging:10.2.1'
    compile 'org.greenrobot:eventbus:3.0.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.github.juanlabrador:badgecounter:1.0.2@aar'
    compile 'com.github.oxoooo:touch-image-view:1.0.1'
    compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
    compile 'com.paypal.sdk:paypal-android-sdk:2.15.3'
}
apply plugin: 'com.google.gms.google-services'

我希望得到一些帮助,以便我的项目可以重新开始工作。任何帮助将受到高度赞赏。

我的根Gradle代码就是这个

//顶级构建文件,您可以在其中添加

共有的配置选项
all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.1.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
}

0 个答案:

没有答案