Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[firebase_messaging] Unresolved reference: firebasemessaging #1558

Closed
VictorUvarov opened this issue Dec 5, 2019 · 10 comments
Closed

[firebase_messaging] Unresolved reference: firebasemessaging #1558

VictorUvarov opened this issue Dec 5, 2019 · 10 comments
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) type: bug Something isn't working

Comments

@VictorUvarov
Copy link

Describe the bug
In the README for background messages. The example for Application.java imports import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService; If you create a new project there is no FlutterFirebaseMessagingService class in the Java code android.main.java.io.flutter.plugins folder. Are we supposed to create this class ourselves?

To Reproduce
Steps to reproduce the behavior:

  1. Create new flutter project
  2. read README

Expected behavior
An implementation example of how to handle import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;

Additional context
Maybe I am wrong and somehow the Flutter firebase_messaging injects the code?

@VictorUvarov VictorUvarov added the type: bug Something isn't working label Dec 5, 2019
@mohitjadav86
Copy link

mohitjadav86 commented Dec 5, 2019

in my case there is same issue i solve this by
creating an new MainActivity.java

public class MainActivity extends FlutterActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    GeneratedPluginRegistrant.registerWith(this);
  }
}

Hope this one can help you

@baobabCode
Copy link

It is what I have in this class already, unfortunately it doesn't work.

@iapicca iapicca added the impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) label Dec 6, 2019
@iapicca
Copy link

iapicca commented Dec 6, 2019

Hi @VictorUvarov
does the solution proposed by @Mohitjadav works for you?

Hi @DjivaCanessane
can you please provide your updated flutter doctor -v
and your flutter run --verbose?
Also, to better address the issue, would be helpful
if you could post a minimal code sample
or the steps to reproduce the problem.
Thank you

@iapicca iapicca added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Dec 6, 2019
@VictorUvarov
Copy link
Author

VictorUvarov commented Dec 6, 2019

@Mohitjadav solutions is what flutter automatically creates in the MainActivity.java or MainActivity.kt. My question is related to FCM and having to create my own FlutterApplication and my own FlutterFirebaseMessagingService as shown in the README. Do I have to create my own FlutterFirebaseMessagingService to handle background messages correctly? @iapicca

@VictorUvarov
Copy link
Author

Does the service work in Kotlin or only Java?

@kaparray
Copy link

@VictorUvarov In my project on Kotlin not works

@msarkrish
Copy link

@kaparray Are you solved this problem and written code in Kotlin. I need that in Kotlin. i have one doubt why we need to create new kotlin file Application.kt because i already have some native code in mainActivity file with kotlin.

@iapicca
Copy link

iapicca commented Feb 12, 2020

Could everyone who still has this problem please file a new issue with the exact descriptions what happens, logs and the output of 'flutter doctor -v' please.
All system setups can be slightly different so it's always better to open new issues and reference related issues.

@JFernandoGomez
Copy link

Please add the correct implementation guide for the latest version of Flutter which enables MainActivity.kt and kotlin file

@firebase firebase locked and limited conversation to collaborators Aug 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants