致命异构:升级到com.android.support:support-v4:25.0.1后的IntentService [RegIntentService]

时间:2016-11-27 21:42:08

标签: java android android-studio google-cloud-messaging

我正在使用MacBook Pro,Android Studio 2.2。我有最新的SDK。今天,我升级了我的应用程序的依赖项,如下所示(支持库曾经是版本23):

compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.8.1'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.android.support:support-v4:25.0.1'
compile 'com.android.support:design:25.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'

compile 'com.android.support:multidex:1.0.1'

minSDK(15)没有变化,但targetSDK为25以匹配支持库。我清理了项目并重建了。然后通过usb将其加载到android 4.1.1设备。这曾经有效,但在更改之后,它在启动时崩溃,并带有以下堆栈跟踪:

W/dalvikvm: threadid=24: thread exiting with uncaught exception (group=0x42075468)
E/AndroidRuntime: FATAL EXCEPTION: IntentService[RegIntentService]
                  java.lang.IllegalAccessError: tried to access method android.support.v4.content.ContextCompat.<init>:(Ljava/lang/String;)V from class com.google.android.gms.iid.zzd
                      at com.google.android.gms.iid.zzd.zzdL(Unknown Source)
                      at com.google.android.gms.iid.zzd.<init>(Unknown Source)
                      at com.google.android.gms.iid.zzd.<init>(Unknown Source)
                      at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
                      at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
                      at com.moapy.eyeniaras.satdostum.RegistrationIntentService.onHandleIntent(RegistrationIntentService.java:54)
                      at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
                      at android.os.Handler.dispatchMessage(Handler.java:99)
                      at android.os.Looper.loop(Looper.java:155)
                      at android.os.HandlerThread.run(HandlerThread.java:60)

RegistrationIntentService.java:54有:

InstanceID instanceID = InstanceID.getInstance(this);

调试它,我意识到如果没有这一行应用程序启动,但一旦通过该点它就会停止。试图解决这个问题,但无法找到解决方案,谷歌搜索问题,但没有任何用处。

感谢任何帮助!

1 个答案:

答案 0 :(得分:0)

将Google Play服务更新到最新版本和Android支持库到最新版本。 9.8用于谷歌播放服务,25.0.1用于Android支持库似乎使其有效。