【问题标题】:Crash on Firebase message - service file not foundFirebase 消息崩溃 - 未找到服务文件
【发布时间】:2020-09-22 17:34:15
【问题描述】:

我能够构建和运行这个应用,但是当收到 Firebase 消息时,应用崩溃了:

java.lang.RuntimeException: Unable to create service com.myapp.MyFirebaseMessagingService:
  java.lang.ClassNotFoundException: 
Didn't find class "com.myapp.MyFirebaseMessagingService" on path: DexPathList[[zip file "/data/app/~~SctCMq9gW9e2EQFxhI0GiA==/com.myapp-Dt1ZpS77Njywg1USKxic5Q==/base.apk", zip file "/data/app/~~SctCMq9gW9e2EQFxhI0GiA==/com.myapp-Dt1ZpS77Njywg1USKxic5Q==/split_config.en.apk", zip file "/data/app/~~SctCMq9gW9e2EQFxhI0GiA==/com.myapp-Dt1ZpS77Njywg1USKxic5Q==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/~~SctCMq9gW9e2EQFxhI0GiA==/com.myapp-Dt1ZpS77Njywg1USKxic5Q==/lib/x86, /system/lib, /system_ext/lib, /product/lib]]

在 AndroidManifest.xml 我有:

<service
   android:name=".MyFirebaseMessagingService"
   android:exported="false"
   tools:ignore="MissingClass">
   <intent-filter>
       <action android:name="com.google.firebase.MESSAGING_EVENT" />
   </intent-filter>
</service>

MyFirebaseMessagingService.kt 存在于src/main/java/com/myapp/ 目录下。

(虽然路径中的这个 java 很可疑,但它是由 Android Studio 生成的。)

我错过了什么?

【问题讨论】:

    标签: android firebase kotlin service firebase-cloud-messaging


    【解决方案1】:

    愚蠢的消息。 原因是 - 服务文件中缺少包。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-12
      • 1970-01-01
      • 2016-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-21
      • 1970-01-01
      相关资源
      最近更新 更多