capacitor-community / fcm

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

Firebase InstanceID has been removed - iOS builds failing #67

Closed denisLoncaric closed 3 years ago

denisLoncaric commented 3 years ago

Describe the bug We are using fastlane to build iOS apps. Since 11th of May 2021 our builds are failing with error message:

`@capacitor-community/fcm/ios/Plugin/Plugin/Plugin.swift:7:8: no such module 'FirebaseInstanceID'

import FirebaseInstanceID`

The Firebase iOS SDK (v8.0.0) is now available and Firebase InstanceID has been removed.

There is a migration guide on how to move from Instance ID to Firebase Installations.

Expected behavior After migration there should be no issues with this plugin.

damienromito commented 3 years ago

I have the same probleme

Capture d’écran 2021-05-12 à 19 48 13

puopg commented 3 years ago

Bump, yup im hitting the same thing. Can someone mention what changed please?

chvonrohr commented 3 years ago

We fixed the version for firebase in the podfile so its working meanwhile

puopg commented 3 years ago

Awesome, same here, that ended up working:

For those who may care:

target 'App' do
  capacitor_pods
  # Add your Pods here
  pod 'FirebaseCore', '~> 7.9.0'
  pod 'Firebase/Messaging', '~> 7.9.0'
end
typeoneerror commented 3 years ago

Should probably update https://github.com/capacitor-community/fcm/blob/master/ios/Plugin/Podfile#L9-L10 to @puopg's change above.

Can submit a PR if it helps!

chvonrohr commented 3 years ago

Same problem for Android here. App crashes when trying to register Push Notification

caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/iid/FirebaseInstanceId;
        at com.getcapacitor.plugin.PushNotifications.register(PushNotifications.java:83)
java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.iid.FirebaseInstanceId" on path:

I assume this is the same problem but for Android. Any recommendations how to fix that (e.g. define version in build.gradle)?

Update Nevermind: this was a problem with a different plugin that was requesting a newer firebase-messaging version

iOlivier commented 3 years ago

I also found a solution without having to change the plugin package.

You can go to ios/App/Podfile and add the desired FirebaseCore version like this underneath the existing pods:

def capacitor_pods
  # Automatic Capacitor Pod dependencies, do not delete
  pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
  pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
  pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
  pod 'CapacitorCommunityFcm', :path => '../../node_modules/@capacitor-community/fcm'
  pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
  # Do not delete

  pod 'FirebaseCore', '~> 7.11.0'
end

After you did the change, don't forget to run pod update.

Dave-Nandwa commented 3 years ago

@iOlivier and what 'Firebase/Messaging' version did you input as well? Still 7.11.0?

stewones commented 3 years ago

@denisLoncaric can you check if this remains an issue on latest plugin version (v1.1.2) ? Thank you

magiclockers commented 3 years ago

@stewones seems issue still occur in v1.1.2? just tested Screen Shot 2021-06-11 at 4 52 54 PM

stewones commented 3 years ago

fixed on v2, please have a try @magiclockers

nkCreation commented 2 years ago

and for capacitor 2 users ?

stewones commented 2 years ago

For those having issues with cap v2, try adding this in your app podfile

target 'App' do
  capacitor_pods
  # Add your Pods here
  pod 'Firebase/Messaging', '~> 7.11.0'
end