capacitor-community / fcm

Enable Firebase Cloud Messaging for Capacitor apps
https://capacitor.ionicframework.com/docs/
MIT License
237 stars 83 forks source link

[Android] Package io.stewan.capacitor.fcm.FCMPlugin does not exist #44

Closed chvonrohr closed 4 years ago

chvonrohr commented 4 years ago

I started a new issue with the same title I found an existing issue ;) But steps mentioned did not help. I also tried ./gradlew --refresh-dependencies and amending capacitor.settings.gradle as in #43 - but did not help.

Any ideas, what I could do to force copying plugin files and install all needed dependencies?

image

To Reproduce Steps according to Android Setup: https://github.com/capacitor-community/fcm Using gradle 6.1

Expected behavior Should find import of io.stewan.capacitor.fcm.FCMPlugin. I also tried to copy java files manually to the src/ folder, but then Firebase Classes can't be found.

Screenshots Where should the java package be placed? image

Additional context Gradle 6.1 Andriod Studio 4.0

stewones commented 4 years ago

fixed in 1.0.6 please check out the android breaking change on changelog

chvonrohr commented 4 years ago

YOU ARE MARVELOUS! Thank you.

It works, except one thing: The imports import com.google.firebase.iid.FirebaseInstanceId; and import com.google.firebase.messaging.FirebaseMessaging; could not be found in FCMPlugin.java. It's listed under "External Libraries", but still not found.

I added implementation 'com.google.firebase:firebase-messaging:20.2.1' to my build.gradle what did it so far. But I guess there is still something wrong (maybe only in my setup).

stewones commented 4 years ago

That’s weird @chvonrohr , did you run npx cap sync android after npm install?

chvonrohr commented 4 years ago

my fault, sorry @stewwan For any reason, I had also capacitor-fcm installed. After removing this and clean build, all was good again.