应用程序在启动时崩溃

时间:2017-01-30 16:14:45

标签: android gradle dependencies location google-play-services

我的应用在启动时因更改使用Google Play定位服务而崩溃。是因为我正在编译版本8.4.0吗?我尝试使用8.3.0版本的服务,但我没有成功。

Sub search()
Range("B1:B7").Find("abc").Activate
End Sub

这是我的build.gradle文件

01-30 17:58:48.394 7665-7665/? E/AndroidRuntime: FATAL EXCEPTION: main
                                             Process: com.example.eskimo, PID: 7665
                                             java.lang.NoSuchMethodError: No static method zzz(Ljava/lang/Object;)Ljava/lang/Object; in class Lcom/google/android/gms/common/internal/zzx; or its super classes (declaration of 'com.google.android.gms.common.internal.zzx' appears in /data/data/com.example.eskimo/files/instant-run/dex/slice-com.google.android.gms-play-services-base-10.0.1_a42d2fa8b24ba1e57daa64ccb04411c53a7591a5-classes.dex)
                                                 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:1789)
                                                 at android.content.ContentProvider.attachInfo(ContentProvider.java:1764)
                                                 at android.app.ActivityThread.installProvider(ActivityThread.java:6767)
                                                 at android.app.ActivityThread.installContentProviders(ActivityThread.java:6362)
                                                 at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6302)
                                                 at android.app.ActivityThread.access$1800(ActivityThread.java:222)
                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1861)
                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                 at android.os.Looper.loop(Looper.java:158)
                                                 at android.app.ActivityThread.main(ActivityThread.java:7229)
                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

2 个答案:

答案 0 :(得分:3)

在您的gradle文件中,play-services-maps条目是重复的,最后一行是8.4和10.0.1。如果你想使用8.4,我会删除第二个。

Android 2.3及更高版本的设备应该会自动更新播放服务,因此您可以删除对8.4的引用并使用10.0.1,这样它就更新了。

答案 1 :(得分:0)

解决了它:

compile 'com.google.android.gms:play-services-gcm:10.0.1'

compile 'com.google.android.gms:play-services-gcm:10.0.1'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.google.android.gms:play-services-location:10.0.1'