Flutterfire: 🐛 [firebase_messaging] Failed build to target macOS

Created on 17 Nov 2020  ·  17Comments  ·  Source: FirebaseExtended/flutterfire

/Users/ekasetiawans/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-8.0.0-dev.8/macos/Classes/FLTFirebaseMessagingPlugin.m:401:23: error: no visible @interface for 'FIRAuth' declares the selector 'canHandleNotification:'
  if ([[FIRAuth auth] canHandleNotification:userInfo]) {
       ~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~
/Users/ekasetiawans/Development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-8.0.0-dev.8/macos/Classes/FLTFirebaseMessagingPlugin.m:402:5: error: void method 'application:didReceiveRemoteNotification:' should not return a value [-Wreturn-type]
    return YES;
    ^      ~~~
1 warning and 2 errors generated.
messaging bug

Most helpful comment

Fix is published in latest dev release now. Thanks

All 17 comments

Hi @ekasetiawans
Can you please provide your flutter doctor -v and flutter pub deps -- --style=compact?
Could you try updating Cocoapods and running pod update?
Thank you

ekasetiawans@MacBookPro macos % flutter doctor -v
[✓] Flutter (Channel dev, 1.24.0-7.0.pre, on macOS 11.0.1 20B29 darwin-x64, locale en-ID)
    • Flutter version 1.24.0-7.0.pre at /Users/ekasetiawans/Development/flutter
    • Framework revision a0860f6e87 (3 weeks ago), 2020-10-29 20:07:34 -0700
    • Engine revision 073263e39d
    • Dart version 2.11.0 (build 2.11.0-260.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/ekasetiawans/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/ekasetiawans/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.2, Build version 12B45b
    • CocoaPods version 1.10.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.51.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.16.0

[✓] Connected device (3 available)
    • macOS (desktop)  • macos      • darwin-x64     • macOS 11.0.1 20B29 darwin-x64
    • Web Server (web) • web-server • web-javascript • Flutter Tools
    • Chrome (web)     • chrome     • web-javascript • Google Chrome 86.0.4240.198

• No issues found!
ekasetiawans@MacBookPro macos % flutter pub deps -- --style=compact
Changing current working directory to: /Users/ekasetiawans/Projects/RetGoo/Client/TSPM/TSPMMobile/mobile_tspm
Dart SDK 2.11.0-260.0.dev
Flutter SDK 1.24.0-7.0.pre
tspm_project 1.0.0+1

dependencies:
- cupertino_icons 1.0.0
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
- retgoo_sdk 0.0.7 [flutter flutter_localizations intl encrypt json_annotation provider xml crypto md2_tab_indicator flutter_zoom_drawer rive timeago shared_preferences webview_flutter flutter_local_notifications package_info firebase_core firebase_auth firebase_messaging google_sign_in cloud_firestore firebase_analytics grpc jaguar_jwt]

dev dependencies:
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]
- fontspec 0.0.1+1 [flutter]

transitive dependencies:
- args 1.6.0
- asn1lib 0.8.1
- async 2.5.0-nullsafety.2 [collection]
- auth_header 2.1.4
- boolean_selector 2.1.0-nullsafety.2 [source_span string_scanner]
- characters 1.1.0-nullsafety.4
- charcode 1.2.0-nullsafety.2
- clock 1.1.0-nullsafety.2
- cloud_firestore 0.14.3 [flutter meta quiver firebase_core firebase_core_platform_interface cloud_firestore_platform_interface cloud_firestore_web]
- cloud_firestore_platform_interface 2.2.0 [flutter meta collection firebase_core plugin_platform_interface]
- cloud_firestore_web 0.2.1 [flutter flutter_web_plugins http_parser meta firebase_core firebase_core_web cloud_firestore_platform_interface js]
- collection 1.15.0-nullsafety.4
- convert 2.1.1 [charcode typed_data]
- crypto 2.1.5 [collection convert typed_data]
- encrypt 4.1.0 [args asn1lib clock collection crypto pointycastle]
- fake_async 1.2.0-nullsafety.2 [clock collection]
- ffi 0.1.3
- file 5.2.1 [intl meta path]
- firebase 7.3.2 [http http_parser js]
- firebase_analytics 6.2.0 [meta flutter firebase_core firebase_analytics_web firebase_analytics_platform_interface]
- firebase_analytics_platform_interface 1.0.3 [flutter meta]
- firebase_analytics_web 0.1.1 [flutter flutter_web_plugins firebase firebase_analytics_platform_interface meta]
- firebase_auth 0.18.3 [meta firebase_core firebase_core_platform_interface firebase_auth_platform_interface firebase_auth_web flutter]
- firebase_auth_platform_interface 2.1.3 [flutter meta firebase_core plugin_platform_interface]
- firebase_auth_web 0.3.2 [flutter flutter_web_plugins meta http_parser intl firebase_core firebase_core_web firebase_auth_platform_interface js]
- firebase_core 0.5.2 [firebase_core_platform_interface flutter quiver meta firebase_core_web]
- firebase_core_platform_interface 2.0.0 [flutter meta plugin_platform_interface quiver]
- firebase_core_web 0.2.1 [firebase_core_platform_interface flutter flutter_web_plugins meta js]
- firebase_messaging 8.0.0-dev.8 [meta flutter firebase_core firebase_core_platform_interface firebase_messaging_platform_interface]
- firebase_messaging_platform_interface 1.0.0-dev.5 [flutter meta firebase_core plugin_platform_interface]
- fixnum 0.10.11
- flutter_local_notifications 3.0.1+4 [flutter platform flutter_local_notifications_platform_interface timezone]
- flutter_local_notifications_platform_interface 2.0.0+1 [flutter plugin_platform_interface]
- flutter_localizations 0.0.0 [flutter intl characters collection meta path typed_data vector_math]
- flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math]
- flutter_zoom_drawer 1.0.4 [flutter]
- google_sign_in 4.5.6 [google_sign_in_platform_interface flutter meta google_sign_in_web]
- google_sign_in_platform_interface 1.1.2 [flutter meta quiver]
- google_sign_in_web 0.9.2 [google_sign_in_platform_interface flutter flutter_web_plugins meta js]
- googleapis_auth 0.2.12 [crypto http]
- graphs 0.2.0
- grpc 2.8.0 [async crypto fixnum googleapis_auth meta http http2 protobuf]
- http 0.12.2 [http_parser path pedantic]
- http2 1.0.1
- http_parser 3.1.4 [charcode collection source_span string_scanner typed_data]
- intl 0.16.1 [path]
- jaguar_jwt 2.1.6 [auth_header crypto]
- js 0.6.3-nullsafety.2
- json_annotation 3.1.0
- matcher 0.12.10-nullsafety.2 [stack_trace]
- md2_tab_indicator 1.0.2 [flutter]
- meta 1.3.0-nullsafety.5
- nested 0.0.4 [flutter]
- package_info 0.4.3+2 [flutter]
- path 1.8.0-nullsafety.2
- path_provider_linux 0.0.1+2 [path xdg_directories path_provider_platform_interface flutter]
- path_provider_platform_interface 1.0.4 [flutter meta platform plugin_platform_interface]
- path_provider_windows 0.0.4+3 [path_provider_platform_interface meta path flutter ffi win32]
- pedantic 1.9.2 [meta]
- petitparser 3.1.0 [meta]
- platform 2.2.1
- plugin_platform_interface 1.0.3 [meta]
- pointycastle 2.0.0
- process 3.0.13 [file intl meta path platform]
- protobuf 1.1.0 [fixnum]
- provider 4.3.2+2 [flutter nested collection]
- quiver 2.1.5 [matcher meta]
- rive 0.6.2+2 [flutter graphs meta]
- shared_preferences 0.5.12+4 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_preferences_windows]
- shared_preferences_linux 0.0.2+4 [file flutter meta path path_provider_linux shared_preferences_platform_interface]
- shared_preferences_macos 0.0.1+11 [shared_preferences_platform_interface flutter]
- shared_preferences_platform_interface 1.0.4 [meta flutter]
- shared_preferences_web 0.1.2+7 [shared_preferences_platform_interface flutter flutter_web_plugins meta]
- shared_preferences_windows 0.0.1+3 [shared_preferences_platform_interface flutter ffi file meta path path_provider_platform_interface path_provider_windows]
- sky_engine 0.0.99
- source_span 1.8.0-nullsafety.3 [charcode collection path term_glyph]
- stack_trace 1.10.0-nullsafety.5 [path]
- stream_channel 2.1.0-nullsafety.2 [async]
- string_scanner 1.1.0-nullsafety.2 [charcode source_span]
- term_glyph 1.2.0-nullsafety.2
- test_api 0.2.19-nullsafety.4 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
- timeago 2.0.28
- timezone 0.5.9 [path]
- typed_data 1.3.0-nullsafety.4 [collection]
- vector_math 2.1.0-nullsafety.4
- webview_flutter 1.0.7 [flutter]
- win32 1.7.4 [ffi]
- xdg_directories 0.1.2 [meta path process]
- xml 4.5.1 [collection convert meta petitparser]
ekasetiawans@MacBookPro macos % 

I have try pod update but still failed
@markusaksli-nc

Could you try clearing your pub cache and building again?

Could you try clearing your pub cache and building again?

I have done it and the result still can't build with the same error message.

I have also tried deleting the macos folder and creating it again using flutter create . but it remains the same.

Have you also done flutter clean between builds?

Have you also done flutter clean between builds?

yes, it's the first thing I always do when a build failure occurs.

I doubt this is a pod issue but in case it is you can also try:

  1. In macos folder pod install --repo-update
  2. In macos folder rm podfile.lock and pod install
  3. rm -rf ~/.cocoapods/repos and pod setup

I doubt this is a pod issue but in case it is you can also try:

  1. In ios folder pod install --repo-update
  2. In ios folder rm podfile.lock and pod install
  3. rm -rf ~/.cocoapods/repos and pod setup

Are you sure? this issue arose when my target platform was macos. There is no problem like this for iOS.

i have tried for macos folder but it still fails.

Yeah sorry I meant macos.

The plugin doesn't exactly work on macOS yet anyway but it should at least compile. At this point you could try setting up a fresh project with the official example code and seeing if that changes things.

If not, then could you your provide flutter run -v with the error,

@markusaksli-nc okay, let me try


Hey @ekasetiawans. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

after I tried to make a new project. This problem occurs when we use the firebase_messaging and firebase_auth plugins on the same project.

Not sure what this could be caused by at this point.

Fix landing shortly, sorry for the delay

Thanks @Salakar

Fix is published in latest dev release now. Thanks

Was this page helpful?
0 / 5 - 0 ratings