0

My android app is crashing on older devices, it crashes as soon as it press run. I cannot work out where the error is, and if I put breakpoints it appears to crash before any of them fire. Here is the logcat...

05-19 08:10:53.847 7782-7788/com.appname.appname I/dalvikvm: Debugger is active
05-19 08:10:53.851 7782-7782/com.appname.appname I/System.out: Debugger has connected
05-19 08:10:53.851 7782-7782/com.appname.appname I/System.out: waiting for debugger to settle...
05-19 08:10:54.055 7782-7782/com.appname.appname I/System.out: waiting for debugger to settle...
05-19 08:10:54.255 7782-7782/com.appname.appname I/System.out: waiting for debugger to settle...
05-19 08:10:54.455 7782-7782/com.appname.appname I/System.out: waiting for debugger to settle...
05-19 08:10:54.655 7782-7782/com.appname.appname I/System.out: waiting for debugger to settle...
05-19 08:10:54.855 7782-7782/com.appname.appname I/System.out: waiting for debugger to settle...
05-19 08:10:55.059 7782-7782/com.appname.appname I/System.out: waiting for debugger to settle...
05-19 08:10:55.259 7782-7782/com.appname.appname I/System.out: waiting for debugger to settle...
05-19 08:10:55.459 7782-7782/com.appname.appname I/System.out: debugger has settled (1419)
05-19 08:10:55.463 7782-7782/com.appname.appname W/dalvikvm: VFY: unable to resolve static field 10394 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
05-19 08:10:55.463 7782-7782/com.appname.appname D/dalvikvm: VFY: replacing opcode 0x60 at 0x0012
05-19 08:10:55.467 7782-7782/com.appname.appname I/dalvikvm: Could not find method android.app.AppOpsManager.checkPackage, referenced from method com.google.android.gms.common.zze.zzb
05-19 08:10:55.467 7782-7782/com.appname.appname W/dalvikvm: VFY: unable to resolve virtual method 134: Landroid/app/AppOpsManager;.checkPackage (ILjava/lang/String;)V
05-19 08:10:55.467 7782-7782/com.appname.appname D/dalvikvm: VFY: replacing opcode 0x6e at 0x0011
05-19 08:10:55.467 7782-7782/com.appname.appname I/dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.zze.zzi
05-19 08:10:55.467 7782-7782/com.appname W/dalvikvm: VFY: unable to resolve virtual method 495: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
05-19 08:10:55.467 7782-7782/com.appname.appname D/dalvikvm: VFY: replacing opcode 0x6e at 0x000b
05-19 08:10:55.559 7782-7782/com.appname.appname I/GMPM: App measurement is starting up, version: 8487
05-19 08:10:55.559 7782-7782/com.appname.appname I/GMPM: To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE
05-19 08:10:55.567 7782-7782/com.appname.appname W/dalvikvm: VFY: unable to resolve static field 10394 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
05-19 08:10:55.567 7782-7782/com.appname.appname D/dalvikvm: VFY: replacing opcode 0x60 at 0x000c
05-19 08:10:55.567 7782-7782/com.appname.appname D/AndroidRuntime: Shutting down VM
05-19 08:10:55.567 7782-7782/com.appname.appname W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xa4c35648)
05-19 08:10:55.571 7782-7782/com.appname.appname E/AndroidRuntime: FATAL EXCEPTION: main
                                                                      java.lang.NoClassDefFoundError: com.google.android.gms.R$string
                                                                          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:1214)
                                                                          at android.content.ContentProvider.attachInfo(ContentProvider.java:1189)
                                                                          at android.app.ActivityThread.installProvider(ActivityThread.java:4879)
                                                                          at android.app.ActivityThread.installContentProviders(ActivityThread.java:4485)
                                                                          at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4425)
                                                                          at android.app.ActivityThread.access$1300(ActivityThread.java:141)
                                                                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
                                                                          at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                          at android.os.Looper.loop(Looper.java:137)
                                                                          at android.app.ActivityThread.main(ActivityThread.java:5103)
                                                                          at java.lang.reflect.Method.invokeNative(Native Method)
                                                                          at java.lang.reflect.Method.invoke(Method.java:525)
                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
                                                                          at dalvik.system.NativeStart.main(Native Method)
Amit Vaghela
  • 22,772
  • 22
  • 86
  • 142
Adam Katz
  • 6,999
  • 11
  • 42
  • 74

1 Answers1

1

Make sure you have not added google-play-services_lib project as library in Libraries (under Modules). If you have, you can go to Libraries and simply remove it. Google Play Library Should Not Appear In Libraries.

make sure you have no duplicate libraries.

For example,

If you are using SDK of Facebook it has it's own support library in it's libs folder. If you are using support library in your project then compiler throws error. Solution is, point your project and Facebook (and other modules if you have) to a (one) support library

check answer here for more details.

Community
  • 1
  • 1
Amit Vaghela
  • 22,772
  • 22
  • 86
  • 142