无法解析意图服务 Android [英] Failed to resolve Intent Service Android

查看:19
本文介绍了无法解析意图服务 Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am getting following error when trying to configure Push Notification:

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 中有不同的口味:

I have different flavors in gradle:

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

My code package name is : com.ebr.apps.ebr My product flavor package is: com.ebr.apps.ebr.development

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

I have placed google-services.json in 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>

我查看了很多示例,但仍然出现此错误.

I have looked at many example but still getting this error.

推荐答案

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

I found the solution, the problem was that Instabug GCMListener was conflicting with my GCMListener. I set the priority of my gcm listener and it started working.

<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>

这篇关于无法解析意图服务 Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆