2017-07-22 115 views
0

搖籃錯誤:搖籃建有一些錯誤

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' 
} 

我嘗試:

  1. gradle這個設置脫機工作未選中
  2. http代理
  3. 刪除HTTP代理

代理但問題提醒。

機器人工作室版本:2.3.3

gradle.build(模塊: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

版本連接到互聯網和同步gradle這個 –

回答

0

更新sdk到26.0.2解決我的問題。

0

添加以下代碼底部的app水平build.gradle

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

然後同步您的項目。也許這將解決您的問題

編輯: 考慮Moonbloom的建議,

更新應用水平build.gradle有:

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

,而不是

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

希望它能幫助!

+0

TNX。但沒有改變。 –

+0

有錯誤更改?如果是,請更新新錯誤。 –

+0

錯誤沒有改變。 –

0

的任何地方,它說無論是mavenCentral()jcenter(),您應該添加以下內容:

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

您還應該添加這兩種mavenCentral()jcenter()如果他們從任何塊丟失。

這些行基本上告訴Gradle在哪裏尋找你試圖包含的庫。 maven.google.com是新的,也是絕對最新的Google Play圖書館的唯一宿主。

+0

tnx.but gradle的錯誤沒有改變。 –

0

添加以下代碼的應用程序級的鈕的build.gradle

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

改變一切從11.0.2至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

我嘗試11.0.0,11.0.1和11.0。2但通過升級sdk解決了我的問題。 –

+0

哦... k謝謝 –