0

GoogleマップのアクティビティをAndroidアプリケーションで使用しているうちに、このエラーが発生します。バージョン「com.google.android.gms:play-services:11.8.0」のキャッシュがありません

「com.google.android.gms:play-services:11.8.0」を解決できませんでした。

プロジェクトレベル Gradleのファイル:

buildscript { 

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

    // NOTE: Do not place your application dependencies here; they belong 
    // in the individual module build.gradle files 
} 
} 
allprojects { 
    repositories { 
     jcenter() 
     google() 
    } 
} 
task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

アプリケーションレベル Gradleのファイル:

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' 
    testCompile 'junit:junit:4.12' 
    //noinspection GradleCompatible 
    implementation 'com.android.support:appcompat-v7:26.1.0' 
    implementation 'com.google.android.gms:play-services:11.8.0' 
} 
+0

Android SDKマネージャの「エクストラ」に「Googleリポジトリ」もインストールされていることを確認してください。 –

+0

はい、私はすでにそれをインストールしました。 –

+0

[Failed To Resolve:com.google.firebase:firebase-firestore:11.4.2]の複​​製があります(https://stackoverflow.com/questions/46569165/failed-to-resolve-com-google-firebasefirebase-firestore11- 4-2) –

答えて

9

だから、最終的に私は、私はそれがそのバージョンのプレイサービスのためにキャッシュされたファイルを見つけることができなかった理由ですGradleのオフラインモードをオンにしました、

を答えを得ました。

私はそれをオフにして(ファイル設定 - ビルド、実行、展開 - グラード)、再度プロジェクトを同期し、いくつかのファイルがダウンロードされています。

2

あなたは、プロジェクトレベルGradleのの内側に、このクラスパスを含める必要があります。

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

と同様にアプリレベルbuild.gradle内部。

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

に戻ります。Erro:プラグインのIDが 'com.google.gms.google-services'が見つかりません。 –

関連する問題