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

flutter_apns will casue error when initializing Firebase #99

Open
kidozh opened this issue Aug 10, 2022 · 3 comments
Open

flutter_apns will casue error when initializing Firebase #99

kidozh opened this issue Aug 10, 2022 · 3 comments

Comments

@kidozh
Copy link

kidozh commented Aug 10, 2022

As is illustrated in the title, the plugin will cause the following error when firebase is initilized:

[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0      FirebaseCoreHostApi.initializeCore (package:firebase_core_platform_interface/src/pigeon/messages.pigeon.dart:199:7)
<asynchronous suspension>
#1      MethodChannelFirebase._initializeCore (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:29:44)
<asynchronous suspension>
#2      MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:73:7)
<asynchronous suspension>
#3      Firebase.initializeApp (package:firebase_core/src/firebase.dart:40:31)
<asynchronous suspension>
#4      main (package:fulcrum/main.dart:18:3)
<asynchronous suspension>

the error comes from the line

await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);

In this issue, the author points out that flutter_apns doesn't using the upgraded version of flutterfire and make it happen.

I upgraded all the dependencies including flutter_apns (1.6.0) and firebase_messaging (12.0.1) and this error still occurs. After removing flutter_apns, the firebase can normally get initialized without any error. When adding it back to the dependencies and without adding any code, the Unhandled Exception shows up when initializing firebase messaging.

So there is a conflict between flutter_apns and firebase_messaging but I don't know the exact reason.

@conradfeyt
Copy link

Getting the same issue with 1.6.0

@sseen
Copy link

sseen commented Sep 14, 2022

Also encountered the same problem, before updating, you can avoid it this way.

flutter_apns: #^1.6.0
    git: https://github.com/sseen/flutter-apns.git

@heyask
Copy link

heyask commented Nov 22, 2022

adding following option in info.plist solved this problem.

<key>flutter_apns.disable_swizzling</key>
<true/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants