Cannot access 'android.app.Application' which is a supertype of 'com.theapp.name.Application' - FCM

Viewed 229

I've followed the guide to implement FCM and everything works fine except the onbackgroundMessage handle so I started to read carefully the steps I had to follow and noticed the class Application I created complains about

"Cannot access 'android.app.Application' which is a supertype of 'com.theapp.name.Application'. Check your module classpath for missing or conflicting dependencies"

The case is that the official guide to implement FCM with flutter suppose that the app use Java but my app was created with Kotlin. So I did some search and created the Application class in the Kotlin folder where is MainActivity too and I think there's something messed up because the io.flutter.pluggins is in the java folder. Also in AndroidManifest.xml in the line:

android:name=".Application"

I get this error: Application must extend android.app.Application and on the line:

    android:name=".MainActivity"

The same warning: MainActivity must extend android.app.Activity

Anyone can help me with this, please?

0 Answers
Related