4

I try to add FCM to my app in order to send push notifications. But I had a problem.

I do everything according to Google tutorial

add to the project build.gradle:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0-alpha05'
        classpath 'com.google.gms:google-services:3.1.1'
    }
}

add to the app build.gradle

dependencies {
    ...
    compile 'com.google.firebase:firebase-core:11.8.0'
    compile 'com.google.firebase:firebase-messaging:11.8.0'
}
apply plugin: 'com.google.gms.google-services'

but after adding

    compile 'com.google.firebase:firebase-core:11.8.0'
    compile 'com.google.firebase:firebase-messaging:11.8.0'

and sync the project, I have received the build error -

Default Activity not found

screenshot

In case of removing firebase dependencies from gradle, everything is ok and the app is running correctly. Of course, I have updated everything (SDK, gradle version, etc.)

I'm developing instant app so the project in modulated (app, instantapp, base, feature, etc.).

Does anybody know why that is happening?

Rohit Suthar
  • 3,528
  • 1
  • 42
  • 48
Stonek
  • 643
  • 9
  • 14
  • can you follow this link and do step wise as mention https://codelabs.developers.google.com/codelabs/android-instant-apps/#0 – Prags Dec 21 '17 at 02:59
  • can you check https://stackoverflow.com/questions/47909531/you-should-have-at-least-one-active-apk-that-is-mapped-to-site-sample-com-via?answertab=active#tab-top – Prags Dec 21 '17 at 13:41

1 Answers1

1

Firebase Cloud Messaging is not yet supported- reference document

Default Activity not found, for their case, is because the 'app' config launch option is set to Default Activity - it should be set to URL Otherwise, Default Activity option requires an in the 'app' module's manifest that has

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
Prags
  • 2,457
  • 2
  • 21
  • 38