0

I'm currently using Google Maps on a app that I'm developing and suddenly my app started to throw an error when I run the app on my phone.

10-22 22:19:41.921 26626-26626/? E/GMPM: GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.

I have seen similar post regarding this issue and I've tried most of those solutions. The majority suggest to add apply plugin: 'com.google.gms.google-services' at the end of the app.gradle along with classpath 'com.google.gms:google-services:3.0.0' on my apps gradle.

I' also have the google-services.json added on the path app/

None of these solutions have worked, does anyone has another workaround?

These are my current 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
 }

App specific 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'
  }
Jose Bernhardt
  • 887
  • 1
  • 10
  • 24

1 Answers1

0

Please ensure that your device have the Google Play Services APK.

As described in the Google Play services overview, Google Play delivers service updates for users on Android 2.3 and higher through the Google Play Store app. However, updates might not reach all users immediately, so your app should verify the version available before attempting to perform API transactions.

And as noted in the documentation,

Note: Because it is hard to anticipate the state of each device, you must always check for a compatible Google Play services APK before you access Google Play services features.

Furthermore, you may want to also try suggested solution in this SO post wherein updating from play-services:8.4.0 to play-services:9.2.0 fixed the issue.

Hope that helps!

Community
  • 1
  • 1
Teyam
  • 7,686
  • 3
  • 15
  • 22