2017-07-22 13 views
0

Gradle Fehler:Gradle bauen haben einige Fehler

Error:(63, 13) Failed to resolve: com.google.android.gms:play-services-gcm:11.0.2

Error:(66, 13) Failed to resolve: com.google.android.gms:play-services-maps:11.0.2

Error:(65, 13) Failed to resolve: com.google.android.gms:play-services-analytics:11.0.2

Error:(62, 13) Failed to resolve: com.google.android.gms:play-services-places:11.0.2

Error:(64, 13) Failed to resolve: com.google.android.gms:play-services-location:11.0.2

Error:(55, 13) Failed to resolve: com.android.support.constraint:constraint-layout:1.0.2

apply plugin: 'com.android.application' 

android { 
    signingConfigs { 
     config { 
      keyPassword keyPassword 
      storeFile filestoreFile 
      storePassword storePassword 
      keyAlias keyAlias 
     } 
    } 
    compileSdkVersion 25 
    buildToolsVersion '25.0.2' 
    defaultConfig { 
     applicationId applicationId 
     minSdkVersion 15 
     targetSdkVersion 22 
     versionCode 1 
     versionName "1.0" 

     manifestPlaceholders = [onesignal_app_id: manifestPlaceholders , onesignal_google_project_number: "REMOTE"] 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      signingConfig signingConfigs.config 
     } 
    } 
    packagingOptions { 
     exclude 'libs/jackson-core-asl-1.9.13.jar' 
     exclude 'libs/jackson-mapper-asl-1.9.13.jar' 
     exclude 'META-INF/ASL2.0' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/NOTICE' 
    } 
    useLibrary 'org.apache.http.legacy' 
} 

allprojects { 
    repositories { 
     maven { url "https://jitpack.io" } 
     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.constraint:constraint-layout:1.0.2' 
    compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support:design:25.3.1' 
    compile 'com.android.support:support-annotations:25.3.1' 
    compile 'com.android.support:support-compat:25.3.1' 
    compile 'com.android.support:recyclerview-v7:25.3.1' 
    compile 'com.android.support:cardview-v7:25.3.1' 
    compile 'com.google.android.gms:play-services-places:11.0.2' 
    compile 'com.google.android.gms:play-services-gcm:11.0.2' 
    compile 'com.google.android.gms:play-services-location:11.0.2' 
    compile 'com.google.android.gms:play-services-analytics:11.0.2' 
    compile 'com.google.android.gms:play-services-maps:11.0.2' 
    compile 'com.fasterxml.jackson.core:jackson-core:2.8.8' 
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.8' 
    compile 'com.fasterxml.jackson.core:jackson-databind:2.8.8' 
    compile 'com.loopj.android:android-async-http:1.4.8' 
    compile 'com.squareup.okhttp3:okhttp:3.8.1' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.daimajia.swipelayout:library:[email protected]' 
    compile 'com.github.hamsaadev:Persian-Date-Picker-Dialog:V1.0' 
    compile 'com.onesignal:OneSignal:[email protected]' 
    compile 'com.android.support:support-v4:25.3.1' 
    testCompile 'junit:junit:4.12' 
} 

Ich versuche:

  1. gradle Einstellung Offline-Arbeit ist nicht markiert
  2. HTTP-Proxy
  3. entfernen http-Proxy

Proxy, aber das Problem hat zu erinnern.

android Studio-Version: 2.3.3

gradle.build (Modul: app):

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

    // NOTE: Do not place your application dependencies here; they belong 
    // in the individual module build.gradle files 
    classpath 'com.google.gms:google-services:3.1.0' 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 
+0

zum Internet und sync gradle –

Antwort

0

Update sdk zu 26.0.2 löse mein Problem.

0

Code unten nach unten In der app Ebene build.gradle

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

Dann synchronisieren Projekt. Vielleicht wird es Ihr Problem beheben

EDIT: Moonbloom Vorschlag Unter Berücksichtigung

Update-App-Ebene build.gradle mit:

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

statt

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

Hoffe, es hilft!

+0

tnx verbinden. aber nicht geändert. –

+0

hat sich der Fehler geändert? Wenn ja, bitte neuen Fehler aktualisieren. –

+0

Fehler nicht geändert. –

0

Jeder Ort, wo es entweder mavenCentral() oder jcenter() sagt, sollten Sie folgendes hinzufügen:

maven { url "https://maven.google.com" } 

Sie sollten auch beide mavenCentral() und jcenter() hinzufügen, wenn sie aus einem der Blöcke sind vermisst.

Diese Zeilen weisen Gradle grundsätzlich an, wo nach Bibliotheken gesucht werden soll, die Sie hinzufügen möchten. Das maven.google.com one ist neu und der einzige Ort, an dem die absolut neuesten Google Play-Bibliotheken gehostet werden.

+0

tnx.aber der Fehler des Gradle wurde nicht geändert. –

0

Code unten in der Botton von App-Ebene hinzufügen build.gradle

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

alle ändern Versionen von 11.0.2 auf 11.0.1

compile 'com.google.android.gms:play-services-maps:11.0.1' 
compile 'com.google.android.gms:play-services-location:11.0.1' 
compile 'com.google.android.gms:play-services-places:11.0.1' 
compile 'com.google.firebase:firebase-messaging:11.0.1' 
+0

Ich versuche 11.0.0, 11.0.1 und 11.0.2 aber löste mein Problem durch die Aktualisierung von SDK. –

+0

Ohh ... k danke dir –