ANR with FCM and Build Options Using IdSuffix

I have a problem with build options and FCM.

I defined 3 options: dev, qa, release

dev/qa have applicationIdSuffix '.dev'

release has no suffix

The google-services.json file has package names that are correctly defined, and I read that the google-services plugin reads it automatically during the build process.

When I run the dev option, everything works fine. But after that, if I switch to the release option and try to run, the application just freezes, giving the following trace:

ANR at xxx

Reason: broadcast intent {act = com.google.firebase.INSTANCE_ID_EVENT flg = 0x14 cmp = xxx / com.google.firebase.iid.FirebaseInstanceIdInternalReceiver (has additional features)}

The Dev option always works, but the start option also freezes at the beginning.

Possible related issues:

Firebase

. , . , Gradle - , .

, ? - Android Studio , , gradle? , .

Android , , .

.

. , . , Android , , , FCM , . - Android?

Android Studio/Laptop/ Gradle, , . , , Android.

+4
2

, .

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

    <service android:name="com.test.notification.MyFirebaseInstanceIDService">
        <intent-filter>
            <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
        </intent-filter>
    </service>
0

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

build.gradle

compile com.google.firebase:firebase-messaging:x.x.x

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.google.firebase:firebase-messaging:x.x.x'
}
apply plugin: 'com.google.gms.google-services'
0

Source: https://habr.com/ru/post/1675066/


All Articles