无法解析MyFirebaseMessagingService

时间:2016-09-08 14:04:09

标签: java android firebase

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.nazriel.sadio_v1">

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme.NoActionBar">
    <activity android:name=".activities.homescreen_activity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".activities.SignInActivity" />

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

    <service
        android:name=".MyFirebaseInstanceIdService"
        android:exported="true">
        <intent-filter>
            <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
        </intent-filter>
    </service>


</application>

我几天前就已经有了FirebaseMessaging service工作了,现在它显示无法解决MyfirebaseMessagingService,它说它没有路可走。请有人帮我这个吗?如果我在我的申请声明之后移动它,它会显示好但我无法生成。

1 个答案:

答案 0 :(得分:0)

App Manifest guide解释了以句号开头的类名的使用:

  

但是,如果字符串的第一个字符是句点,则   应用程序的包名称(由元素指定)   包属性)附加到字符串。

您发布的XML是完整的清单吗?如果是这样,您将错过封闭的manifest元素:

<manifest package="com.example.project" . . . >
    <application . . . >
        <service android:name=".MyFirebaseMessagingService" . . . >
            . . .
        </service>
        . . .
    </application>
</manifest>

如果您有清单元素,请检查它是否具有包属性。然后验证您的服务类是否已在该包中定义。