Android错误:java.lang.NoClassDefFoundError:com.google.android.gms.R $ string

时间:2016-01-24 16:33:41

标签: java android

我一直在修复我的Android应用程序以在新版本上运行,并且出现了这个错误。我不知道为什么,因为它构建好,但不运行。

01-24 11:27:40.978 4709-4709/com.sousheelvunnam.scrimmage E/AndroidRuntime: FATAL EXCEPTION: main
                                                                        Process: com.sousheelvunnam.scrimmage, PID: 4709
                                                                        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:1591)
                                                                            at android.content.ContentProvider.attachInfo(ContentProvider.java:1562)
                                                                            at android.app.ActivityThread.installProvider(ActivityThread.java:4774)
                                                                            at android.app.ActivityThread.installContentProviders(ActivityThread.java:4369)
                                                                            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4309)
                                                                            at android.app.ActivityThread.access$1500(ActivityThread.java:135)
                                                                            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
                                                                            at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                            at android.os.Looper.loop(Looper.java:136)
                                                                            at android.app.ActivityThread.main(ActivityThread.java:5001)
                                                                            at java.lang.reflect.Method.invokeNative(Native Method)
                                                                            at java.lang.reflect.Method.invoke(Method.java:515)
                                                                            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
                                                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
                                                                            at dalvik.system.NativeStart.main(Native Method)

以下是我的依赖项:

dependencies {
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile 'com.parse.bolts:bolts-android:1.1.2'
compile 'com.android.support:support-v13:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile('com.twitter.sdk.android:twitter:1.1.0@aar') {
    transitive = true;
}

1 个答案:

答案 0 :(得分:0)

如果您的sdk中已经安装了Google Play服务。

您应该在应用标记内的清单中添加此行

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />