2016-10-23 18 views
0

私は現在開発中のアプリでGoogleマップを使用しています。突然、私の携帯電話でアプリを実行するとエラーが発生し始めました。Googleサービスの初期化に失敗しました。状況:10

10-22 22:19:41.921 26626-26626 /? E/GMPM:GoogleServiceの初期化に失敗しました。ステータス:10、Googleサービスの初期化に必要なリソースが見つかりませんでした: 'R.string.google_app_id'考えられる原因にgoogle-services.jsonまたはcom.google.gms.google-services gradle pluginがありません。

私はこの問題に関して同様の記事を見ており、私はそれらのソリューションのほとんどを試しました。大多数はapp.gradleの末尾にapply plugin: 'com.google.gms.google-services'を追加し、私のアプリのgradleにはclasspath 'com.google.gms:google-services:3.0.0'を追加することをお勧めします。

私もgoogle-services.jsonがパスに追加した」これらのソリューションのapp/

なしに働いていない、誰もが別の回避策を持っているのでしょうか?

これらは私の現在のgradles

// 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.2.2' 




    // NOTE: Do not place your application dependencies here; they belong 
    // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
    jcenter() 
    } 
    } 

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

アプリの特定のGradle

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 23 
buildToolsVersion "23.0.2" 

defaultConfig { 
    applicationId "com.example.josebernhardt.rpvc_" 
    minSdkVersion 17 
    targetSdkVersion 23 
    versionCode 1 
    versionName "1.0" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

    dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
testCompile 'junit:junit:4.12' 
compile 'com.android.support:appcompat-v7:23.3.0' 
compile 'com.android.support:design:23.3.0' 
compile 'com.google.android.gms:play-services:8.4.0' 
    } 

答えて

0

くださいensure that your device have the Google Play Services APKです。

Google Playは、Google Play services overviewに記載されているとおり、Google Playストアアプリを通じて、Android 2.3以降のユーザー向けのサービスアップデートを配信します。ただし、更新がすべてのユーザーにすぐに届くとは限りません。したがって、は、APIトランザクションを実行する前に、使用可能なバージョンを確認する必要があります。

そしてdocumentationで述べたように、

注:それは、各デバイスの状態を予測することは困難であるためは、あなたはいつもあなたの前に互換性のGoogle PlayサービスのAPKをチェックする必要がありますGoogle Playサービスの機能にアクセスします。

さらに、あなたもplay-services:8.4.0からplay-services:9.2.0問題を修正する更新特徴このSO postで解決策を提案しようとする場合があります。

希望に役立ちます!

関連する問題