2017-01-04 196 views
0

我已經安裝了com.android.support:appcompat-v7:23.0.0和其他stuff.The應用程序正在運行完美我的My朋友的機器和我們有一切相同的設置。請大家幫我。提前感謝錯誤:無法解決:com.android.support:appcompat-v7:24.0.0

應用程序級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 Console: ............ .................................................. .......

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

創建新項目時是否有任何錯誤? –

回答

0

轉到

File-> Settings-> Build,Execution,Deployment-> Gradle-> Disable離線工作

。有時候這可能會導致這個問題。

+0

是的,我做了但沒有發生任何事情。 –