错误:无法解决:com.android.support:appcompat-v7:24.0.0

时间:2017-01-04 07:30:05

标签: android build.gradle android-sdk-tools android-studio-2.1

我已经安装了com.android.support:appcompat-v7:23.0.0和其他东西。应用程序运行完美om我的朋友的机器,我们有一切相同的设置。请伙计们帮助我。谢谢你提前< / p>

app level gradle在这里: .................................................. ..........

    apply plugin: 'com.android.application'
/*apply plugin: 'com.google.gms.google-services'*/

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.1'


    defaultConfig {
        applicationId "com.abc.mobile"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 17
        versionName '2.0'
        // vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        abortOnError false
    }
    productFlavors {

    }
    /*aaptOptions{additionalParameters "--no-version-vectors"}
    defaultConfig{vectorDrawables.useSupportLibrary = true}*/
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':backbasecxp-1.7.1')
    compile 'com.google.guava:guava:18.0'
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.android.support:design:23.0.0'
    compile 'de.hdodenhof:circleimageview:1.2.1'
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.squareup.okhttp3:okhttp:3.4.1'
    compile 'com.afollestad:digitus:0.2.12'
    //compile 'com.google.android.gms:play-services-auth:7.8.0'
    //compile 'com.google.firebase:firebase-messaging:9.0.2'
}

task printVersionOnFile {
    def version = new File('version.txt')
    version.text = android.defaultConfig.versionName
}

这是项目级别的gradle: .................................................. ........................

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

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'

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

       //classpath 'com.google.gms:google-services:3.0.0'

    }


}

allprojects {
    repositories {
        jcenter()
 //      maven {
 //           url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'
  //      }
    }
}

Meessage gradle: .................................................. ..................

    C:\Manoj\IDFCLATEST\app\build.gradle
Error:Failed to resolve: com.android.support:recyclerview-v7:24.0.0
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:C:/Manoj/IDFCLATEST/app/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
Error:Failed to resolve: com.android.support:appcompat-v7:24.0.0
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:C:/Manoj/IDFCLATEST/app/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
Error:Failed to resolve: com.android.support:support-annotations:24.0.0
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:C:/Manoj/IDFCLATEST/app/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
Error:Failed to resolve: com.android.support:support-v4:24.0.0
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:C:/Manoj/IDFCLATEST/app/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

Gradle控制台: .................................................. ..................

Executing tasks: [clean, :app:generateDebugSources, :app:prepareDebugUnitTestDependencies, :app:mockableAndroidJar, :app:generateDebugAndroidTestSources]

Configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not resolve com.android.support:appcompat-v7:24.0.0.
     Required by:
         IDFCLATEST:app:unspecified
         IDFCLATEST:app:unspecified > com.android.support:design:23.0.0
      > Could not resolve com.android.support:appcompat-v7:24.0.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/support/appcompat-v7/24.0.0/appcompat-v7-24.0.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/support/appcompat-v7/24.0.0/appcompat-v7-24.0.0.pom'.
               > No route to host: connect
   > Could not resolve com.android.support:support-v4:24.0.0.
     Required by:
         IDFCLATEST:app:unspecified > com.android.support:design:23.0.0
      > Could not resolve com.android.support:support-v4:24.0.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/support/support-v4/24.0.0/support-v4-24.0.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/support/support-v4/24.0.0/support-v4-24.0.0.pom'.
               > No route to host: connect
   > Could not resolve com.android.support:appcompat-v7:24.0.0.
     Required by:
         IDFCLATEST:app:unspecified > com.afollestad:digitus:0.2.12
         IDFCLATEST:app:unspecified > com.afollestad:digitus:0.2.12 > com.afollestad.material-dialogs:core:0.8.6.0
      > Could not resolve com.android.support:appcompat-v7:24.0.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/support/appcompat-v7/24.0.0/appcompat-v7-24.0.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/support/appcompat-v7/24.0.0/appcompat-v7-24.0.0.pom'.
               > No route to host: connect
   > Could not resolve com.android.support:support-v4:24.0.0.
     Required by:
         IDFCLATEST:app:unspecified > com.afollestad:digitus:0.2.12 > com.afollestad.material-dialogs:core:0.8.6.0
      > Could not resolve com.android.support:support-v4:24.0.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/support/support-v4/24.0.0/support-v4-24.0.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/support/support-v4/24.0.0/support-v4-24.0.0.pom'.
               > No route to host: connect
   > Could not resolve com.android.support:support-annotations:24.0.0.
     Required by:
         IDFCLATEST:app:unspecified > com.afollestad:digitus:0.2.12 > com.afollestad.material-dialogs:core:0.8.6.0
      > Could not resolve com.android.support:support-annotations:24.0.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/support/support-annotations/24.0.0/support-annotations-24.0.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/support/support-annotations/24.0.0/support-annotations-24.0.0.pom'.
               > No route to host: connect
   > Could not resolve com.android.support:recyclerview-v7:24.0.0.
     Required by:
         IDFCLATEST:app:unspecified > com.afollestad:digitus:0.2.12 > com.afollestad.material-dialogs:core:0.8.6.0
      > Could not resolve com.android.support:recyclerview-v7:24.0.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/support/recyclerview-v7/24.0.0/recyclerview-v7-24.0.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/support/recyclerview-v7/24.0.0/recyclerview-v7-24.0.0.pom'.
               > No route to host: connect
   > Could not resolve com.android.support:appcompat-v7:24.0.0.
     Required by:
         IDFCLATEST:app:unspecified > com.afollestad:digitus:0.2.12 > com.afollestad.material-dialogs:core:0.8.6.0 > me.zhanghai.android.materialprogressbar:library:1.1.6
      > Could not resolve com.android.support:appcompat-v7:24.0.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/support/appcompat-v7/24.0.0/appcompat-v7-24.0.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/support/appcompat-v7/24.0.0/appcompat-v7-24.0.0.pom'.
               > No route to host: connect
   > Could not resolve com.android.support:support-annotations:24.0.0.
     Required by:
         IDFCLATEST:app:unspecified > com.afollestad:digitus:0.2.12 > com.afollestad.material-dialogs:core:0.8.6.0 > me.zhanghai.android.materialprogressbar:library:1.1.6
      > Could not resolve com.android.support:support-annotations:24.0.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/support/support-annotations/24.0.0/support-annotations-24.0.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/support/support-annotations/24.0.0/support-annotations-24.0.0.pom'.
               > No route to host: connect

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

1 个答案:

答案 0 :(得分:0)

转到

<强>文件&GT;设置 - &GT;生成,执行,部署 - &GT; Gradle-&GT;禁用离线工作

。有时这可能会导致这个问题。