0

I'm using google services 1.5.0-beta2, building with Android Studio.

I've just implemented OneSignal on my project, and for some devices it's causing this exception and crashing on startup:

java.lang.RuntimeException: Unable to get provider com.google.android.gms.measurement.AppMeasurementContentProvider: android.content.res.Resources$NotFoundException: String resource ID #0x7f060042
    at android.app.ActivityThread.installProvider(ActivityThread.java:5177)
    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4769)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4709)
    at android.app.ActivityThread.-wrap1(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5443)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)   
Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x7f060042
    at android.content.res.Resources.getText(Resources.java:312)
    at android.content.res.Resources.getString(Resources.java:400)
    at com.google.android.gms.measurement.zza.<init>(Unknown Source)
    at com.google.android.gms.measurement.zza.zzaR(Unknown Source)
    at com.google.android.gms.measurement.internal.zzn.zziJ(Unknown Source)
    at com.google.android.gms.measurement.internal.zzz.zza(Unknown Source)
    at com.google.android.gms.measurement.internal.zzw.<init>(Unknown Source)
    at com.google.android.gms.measurement.internal.zzaa.zzDj(Unknown Source)
    at com.google.android.gms.measurement.internal.zzw.zzaT(Unknown Source)
    at com.google.android.gms.measurement.AppMeasurementContentProvider.onCreate(Unknown Source)
    at android.content.ContentProvider.attachInfo(ContentProvider.java:1748)
    at android.content.ContentProvider.attachInfo(ContentProvider.java:1723)
    at android.app.ActivityThread.installProvider(ActivityThread.java:5174)
    ... 10 more

Dependency list:

dependencies {
    //compile 'com.google.android.gms:play-services:+'
    compile('com.afollestad.material-dialogs:core:0.8.5.9') {
        transitive = true
    }
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.google.android.gms:play-services-analytics:8.4.0'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
    compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
    compile 'io.nlopez.smartadapters:library:1.3.0'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.koushikdutta.ion:ion:2.+'
    compile 'com.jakewharton:process-phoenix:1.0.2'
    compile 'com.karumi:dexter:2.2.2'
    compile 'com.android.support:design:23.4.0'
    compile 'com.onesignal:OneSignal:2.+@aar'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
    compile 'com.google.android.gms:play-services-analytics:8.4.0'
    compile "com.google.android.gms:play-services-location:8.4.0"
    //compile 'com.github.hotchemi.PermissionsDispatcher:permissionsdispatcher:2.1.1'
}
enalbu
  • 33
  • 5
  • What version of Google Play services are you including in your project? Are you building Android Studio? Can you provide your `dependencies {...}` list? – jkasten May 20 '16 at 09:39
  • Edited with the answer to the question you asked me (I though it would be interesting if someone has the same question) – enalbu May 20 '16 at 10:24
  • Thanks, I don't see any `com.google.android.gms` version conflicts but not sure if some of your other plugins are including their own version. Can you run the following from the terminal and add the output to your question? `gradle dependencies --configuration compile` – jkasten May 21 '16 at 01:14
  • Have you tried changing the `classpath 'com.google.gms:google-services:1.5.0-beta2'` to `classpath 'com.google.gms:google-services:1.5.0'`? Based on the previous [SO Question](http://stackoverflow.com/questions/35166441/google-play-services-exception-com-google-android-gms-common-googleplayservices/35166792#35166792) and a [reported bug](https://code.google.com/p/android/issues/detail?id=193112) that other programmers also encountered; both suggests to downgrade or use `classpath 'com.google.gms:google-services:1.5.0'`. I hope this helps. – Android Enthusiast May 22 '16 at 06:55

0 Answers0