我的Android应用程序在旧设备上崩溃,一旦按下运行就会崩溃。我无法解决错误的位置,如果我放置了断点,它们会在任何一个触发之前崩溃。这是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)
答案 0 :(得分:1)
确保您未在库(在模块下)中添加 google-play-services_lib 项目作为库。如果有,您可以去图书馆并删除它。 Google Play图书馆不应出现在图书馆中。
确保您没有重复的库。
例如,
如果您使用的是Facebook的SDK,它的libs文件夹中有自己的支持库。如果您在项目中使用支持库,则编译器会抛出错误。解决方案是,将您的项目和Facebook(以及其他模块,如果有)指向(一个)支持库
查看答案here了解详情。