capacitor-community / fcm

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

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

Closed nikoskip closed 5 years ago

nikoskip commented 5 years ago

Hi,

I'm trying to use this plugin but I'm having trouble when I try to build on Android. I follow the README guide step by step but it seems that the Java package is not being included. These are the commands I'm running before building on Android Studio:

npm run build
npx cap copy 
npx cap open android

Any ideas?

Thanks!

stewones commented 5 years ago

that's kinda weird. did you npm install capacitor-fcm?

also try to invalidate cache and restart on android studio before building

nikoskip commented 5 years ago

Yes, I have installed capacitor-fcm:

 "dependencies": {
    "@capacitor/android": "^1.0.0-beta.22",
    "@capacitor/cli": "^1.0.0-beta.22",
    "@capacitor/core": "^1.0.0-beta.22",
    "@ionic/core": "^4.3.1",
    "@ionic/vue": "0.0.4",
    "capacitor-fcm": "0.0.5",
    "core-js": "^2.6.5",
    "vue": "^2.6.10",
    "vue-audio-recorder": "^3.0.1",
    "vue-router": "^3.0.6"
  }

I just tried invalidating cache and restarting Android Studio with no luck.

Android Studio is unable to resolve the package 😢

image

stewones commented 5 years ago

try this import io.stewan.capacitor.fcm.FCMPlugin;

nikoskip commented 5 years ago

It didn't work 😞

image

Any other ideas?

nikoskip commented 5 years ago

BTW, this is how I created my project: https://www.smashingmagazine.com/2018/07/mobile-apps-capacitor-vue-js/

I'm using Capacitor to build my native app and not Ionic. Could be the problem?

stewones commented 5 years ago

Can you share a small repo?

I’ve tested only with ionic-angular but it's supposed to work with any framework

On Thu, 9 May 2019 at 11:04 Nikolas notifications@github.com wrote:

BTW, this is how I created my project: https://www.smashingmagazine.com/2018/07/mobile-apps-capacitor-vue-js/

I'm using Capacitor to build my native app and not Ionic. Could be the problem?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/stewwan/capacitor-fcm/issues/5#issuecomment-490918868, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFPXEZFRSAOYVFFGUOZGFTPUQVPVANCNFSM4HLVRV4A .

stewones commented 5 years ago

@nikoskip

does this plugin module appear in Android studio?

also you must run npx cap sync after a plugin install

nikoskip commented 5 years ago

That was the solution, awesome!

I really appreciate your help, thanks for your time 👍

adelynx commented 3 years ago

For the version @capacitor-community/fcm replace import io.stewan.capacitor.fcm.FCMPlugin; with import com.getcapacitor.community.fcm.FCMPlugin;