【问题标题】:Failed to resolve Intent Service Android无法解决 Intent 服务 Android
【发布时间】:2016-06-06 20:11:47
【问题描述】:

尝试配置推送通知时出现以下错误:

06-07 01:05:59.735 18708-18708/com.ebr.apps.ebr.development E/FirebaseInstanceId: Failed to resolve target intent service, skipping classname enforcement
06-07 01:05:59.735 18708-18708/com.ebr.apps.ebr.development E/FirebaseInstanceId: Error while delivering the message: ServiceIntent not found.

我在gradle中有不同的口味:

我的代码包名是:com.ebr.apps.ebr 我的产品风味包是:com.ebr.apps.ebr.development

我已将 google-services.json 放入 app/src/development

清单:

    <permission
        android:name="${applicationId}.permission.C2D_MESSAGE"
        android:protectionLevel="signature"/>

    <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>

         <receiver
            android:name="com.google.android.gms.gcm.GcmReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                <category android:name="${applicationId}" />
            </intent-filter>
        </receiver>

        <service
            android:name=".GCM.PushNotificationService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
            </intent-filter>
        </service>

我查看了很多示例,但仍然收到此错误。

【问题讨论】:

    标签: android push-notification google-cloud-messaging intentservice


    【解决方案1】:

    我找到了解决方案,问题是 Instabug GCMListener 与我的 GCMListener 冲突。我设置了我的 gcm 监听器的优先级,它开始工作了。

    <service
        android:name=".GCM.PushNotificationService"
        android:exported="false">
        <intent-filter android:priority="10000">
            <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
        </intent-filter>
    </service>
    

    【讨论】:

    【解决方案2】:

    如果您来自搜索引擎:您可能也遇到了这个错误,它也会影响当前版本 com.google.android.gms:play-services-gcm:9.8.0

    https://github.com/firebase/quickstart-android/issues/72

    目前还无法重现该错误,并且尚未完全了解这种情况是如何发生的,但您可能有兴趣关注该主题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多