Gradle失败:Socket未连接:connect

时间:2017-12-11 09:25:21

标签: android android-studio

在最后一次sdk更新后,我在打开Android项目时遇到此错误。我试图用这个解决方案解决它,但错误仍然存​​在

android studio 0.4.2: Gradle project sync failed error

消息

  

错误:未连接套接字:连接

Error:A problem occurred configuring root project 'A-muse'.
> Could not resolve all dependencies for configuration ':classpath'.
  

无法解析com.android.tools.build:gradle:2.3.3。        要求:            项目:   无法解决com.android.tools.build:gradle:2.3.3。   无法获得资源       “https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.3/gradle-       2.3.3.pom”。   无法获得       'https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.pom'。   套接字未连接:连接   无法解决com.neenbedankt.gradle.plugins:android-apt:1.8。        要求:            项目:   无法解决com.neenbedankt.gradle.plugins:android-apt:1.8。   无法获取资源“https://jcenter.bintray.com/com/neenbedankt/gradle/plugins/android-apt/1.8/android-apt-1.8.pom”。   无法获得“https://jcenter.bintray.com/com/neenbedankt/gradle/plugins/android-apt/1.8/android-apt-1.8.pom”。   套接字未连接:连接   无法解析com.google.gms:google-services:3.0.0。        要求:            项目:   无法解析com.google.gms:google-services:3.0.0。   无法获取资源“https://jcenter.bintray.com/com/google/gms/google-services/3.0.0/google-services-3.0.0.pom”。   无法获得“https://jcenter.bintray.com/com/google/gms/google-services/3.0.0/google-services-3.0.0.pom”。   套接字未连接:连接   无法解决me.tatarka:gradle-retrolambda:3.6.0。        要求:            项目:   无法解决me.tatarka:gradle-retrolambda:3.6.0。   无法获取资源“https://jcenter.bintray.com/me/tatarka/gradle-retrolambda/3.6.0/gradle-retrolambda-3.6.0.pom”。   无法获得“https://jcenter.bintray.com/me/tatarka/gradle-retrolambda/3.6.0/gradle-retrolambda-3.6.0.pom”。   套接字未连接:连接

Updated:

    android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"

    sourceSets.main {
        jni.srcDirs = []
        jniLibs.srcDir "$VUFORIA_SDK_DIR/$NATIVE_LIB_DIR/"
    }

    archivesBaseName = rootProject.projectDir.getName()

    defaultConfig {
        applicationId "com.ilunion.amuse"
        minSdkVersion 21
        targetSdkVersion 21
        versionCode 7
        versionName "1.6"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        externalNativeBuild {
            cmake {
                cppFlags ""
            }
        }
    }
    buildTypes {
        debug {
            minifyEnabled false
            debuggable true
            ndk {
                abiFilters "armeabi-v7a","x86"
            }
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            ndk {
                abiFilters "armeabi-v7a"
            }
        }
    }
    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }

    dexOptions {
        jumboMode = true
    }
    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }
}

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.squareup.retrofit2:adapter-rxjava:2.0.2'
    compile project(path: ':beepconsmanager')
    compile project(path: ':step-indicator')
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.google.dagger:dagger:2.5'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.jakewharton:butterknife:8.0.1'
    compile 'com.google.code.gson:gson:2.7'
    compile 'com.squareup.retrofit2:converter-gson:2.0.2'
    compile 'com.squareup.retrofit2:retrofit:2.0.2'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'io.reactivex:rxjava:1.1.8'
    compile 'io.reactivex:rxandroid:0.24.0'
    compile 'com.android.support:palette-v7:25.3.1'
    compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
    //compile 'com.android.support.constraint:constraint-layout:1.0.1'
    compile 'com.github.fuzz-productions:RatingBar:1.0.3'
    compile 'com.github.chrisbanes:PhotoView:1.3.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    //difuminar
    compile 'com.eightbitlab:blurview:1.3.3'
    //crash library
    compile 'cat.ereza:customactivityoncrash:2.1.0'
    //youtube
    compile files('libs/YouTubeAndroidPlayerApi.jar')
    testCompile 'junit:junit:4.12'
    apt 'com.jakewharton:butterknife-compiler:8.0.1'
    apt 'com.google.dagger:dagger-compiler:2.5'
    compile('com.google.firebase:firebase-core:10.0.1') {
        exclude module: 'play-services-base'
        exclude module: 'support-v4'
        exclude module: 'support-annotations'
    }
    compile 'com.firebaseui:firebase-ui:1.1.1'
    //Animations
    compile 'com.daimajia.easing:library:2.0@aar'
    compile 'com.daimajia.androidanimations:library:2.2@aar'
    compile files('libs/Vuforia.jar')
    apply plugin: 'me.tatarka.retrolambda'
    compile 'com.google.android.gms:play-services-maps:10.0.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.android.gms:play-services-location:10.0.1'
    compile 'com.google.maps.android:android-maps-utils:0.4+'
}

apply plugin: 'com.google.gms.google-services'

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'me.tatarka:gradle-retrolambda:3.6.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven { url "https://www.jitpack.io"}
        maven { url 'https://maven.fabric.io/public' }

        jcenter()
    }
}

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

0 个答案:

没有答案