我有一个运行谷歌分析的应用程序通过谷歌播放服务7.8依赖于gradle。它在Lollipop设备上运行得非常好,但在KitKat启动时崩溃(4.4.4)。这是堆栈跟踪:
java.lang.NoClassDefFoundError: com.google.android.gms.common.internal.zzx
at com.google.android.gms.analytics.internal.zzf.zzX(Unknown Source)
at com.google.android.gms.analytics.GoogleAnalytics.getInstance(Unknown Source)
at com.xxx.xxx.getTracker(AppController.java:453)
at com.xxx.xxx.onCreate(AppController.java:112)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4328)
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)
我不知道这可能来自哪里。任何帮助将不胜感激。
编辑:以下是我的顶级gradle dependecies
dependencies {
compile 'com.anupcowkur:reservoir:2.1'
compile 'com.google.android.gms:play-services-base:7.8.0'
compile('com.facebook.android:facebook-android-sdk:3.21.1') {
exclude module: 'bolts-android'
}
compile('com.crashlytics.sdk.android:crashlytics:2.4.0@aar') {
transitive = true
}
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.mcxiaoke.volley:library:1.0.15'
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.splitwise:tokenautocomplete:2.0@aar'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.googlecode.libphonenumber:libphonenumber:7.0.6'
compile fileTree(include: 'Parse-*.jar', dir: 'libs')
compile fileTree(include: 'libScanpay/*', dir: 'libs')
compile fileTree(include: 'AppRate_*.jar', dir: 'libs')
compile fileTree(include: 'bolts-android-*.jar', dir: 'libs')
compile 'org.lucasr.twowayview:twowayview:0.1.4'
compile 'com.android.support:support-v4:22.2.1'
compile 'com.google.android.gms:play-services:7.8.0'
compile 'com.google.android.gms:play-services-analytics:7.8.0'
}
答案 0 :(得分:1)
通过在我的AppController中添加MultiDex.install(context)
来解决。