gpt4 book ai didi

android - Firebase 消息传递 NoSuchMethodError.zzUr 异常

转载 作者:可可西里 更新时间:2023-11-01 18:54:59 25 4
gpt4 key购买 nike

我正在尝试将 FCM 集成到 android 项目中,因为它写在 Firebase documentation 中。 .

我的应用程序的 gradle:

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
...
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:support-v4:20.0.0'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-config:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.0.2'
compile 'com.google.firebase:firebase-crash:9.2.0'
compile 'com.google.android.gms:play-services-ads:9.2.0'
compile 'com.google.android.gms:play-services-analytics:9.2.0'
compile 'com.google.android.gms:play-services-games:9.2.0'
}

apply plugin: 'com.google.gms.google-services'

list .xml:

<service
android:name=".MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>

和 MyFirebaseMesagingService:

public class MyFirebaseMessagingService extends FirebaseMessagingService {

@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Log.i("info", "From: " + remoteMessage.getFrom());
Log.i("info", "Notification Message Body: " + remoteMessage.getNotification().getBody());
}

但是当我发送推送时,我得到的是:

java.lang.NoSuchMethodError: com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzUr
at com.google.firebase.messaging.FirebaseMessagingService.zzz(Unknown Source)
at com.google.firebase.iid.zzb.onStartCommand(Unknown Source)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2805)
at android.app.ActivityThread.access$1900(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1437)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5299)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)

无法谷歌。有人遇到过吗?

最佳答案

尝试使用相同版本运行所有服务。在这种情况下,更改:

compile 'com.google.firebase:firebase-messaging:9.0.2'

compile 'com.google.firebase:firebase-messaging:9.2.0'

并检查是否发生同样的问题。

关于android - Firebase 消息传递 NoSuchMethodError.zzUr 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38200664/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com