firebase / flutterfire

πŸ”₯ A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.57k stars 3.94k forks source link

πŸ› [Firebase_messaging] iOS: 'FirebaseMessaging.h' file not found in NotificationService.m for Simulators on Apple Silicon #10815

Closed simplenotezy closed 1 year ago

simplenotezy commented 1 year ago

Bug report

Describe the bug I followed this guide: https://firebase.flutter.dev/docs/messaging/apple-integration#step-3---use-the-extension-helper

However, after adding the extension helper I am getting error:

app/ios/ImageNotification/NotificationService.m:9:9 'FirebaseMessaging.h' file not found

My Podfile:


target 'ImageNotification' do
  pod 'GoogleUtilities' # https://github.com/firebase/flutterfire/issues/4583
  use_frameworks!
  pod 'Firebase/Messaging'
end

And for runner:

target 'Runner' do
  pod 'GoogleUtilities'

  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))

end

I have tried everything like deleting all pods, removing the lock file, running flutter clean, updating the repo, etc.

Expected behavior

Should run without issues

Sample project

Providing a minimal example project which demonstrates the bug in isolation from your main App greatly enhances the chance of a timely fix. Please link to the public repository URL.


Additional context

Add any other context about the problem here.


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` Doctor summary (to see all details, run flutter doctor -v): [βœ“] Flutter (Channel stable, 3.7.8, on macOS 13.3.1 22E261 darwin-arm64, locale en-DK) [βœ“] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) [βœ“] Xcode - develop for iOS and macOS (Xcode 14.3) [βœ“] Android Studio (version 2021.1) [βœ“] VS Code (version 1.77.3) [βœ“] Connected device (3 available) [βœ“] HTTP Host Availability β€’ No issues found! ```

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand ``` dependencies: - amplitude_flutter 3.14.0 [flutter flutter_web_plugins js] - animate_do 3.0.2 [flutter] - app_tracking_transparency 2.0.3 [flutter] - appsflyer_sdk 6.9.3 [flutter] - async 2.10.0 [collection meta] - auto_route 6.3.0 [flutter path collection meta] - auto_size_text 3.0.0 [flutter] - cached_network_image 3.2.3 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web] - collection 1.17.0 - contacts_service 0.6.3 [flutter collection quiver] - cupertino_icons 1.0.5 - custom_lint 0.3.3 [analyzer analyzer_plugin args async ci cli_util collection freezed_annotation json_annotation meta package_config path pub_semver pubspec_parse rxdart uuid yaml] - custom_rounded_rectangle_border 0.2.0-nullsafety.0 [flutter] - dart_emoji 0.2.0+2 [characters] - dio 5.1.1 [http_parser meta path] - dismissible_page 1.0.2 [flutter] - dotted_border 2.0.0+3 [flutter path_drawing] - dropdown_button2 1.9.4 [flutter] - firebase_analytics 10.2.1 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_core 2.10.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 3.1.1 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_messaging 14.4.1 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - flutter 0.0.0 [characters collection js material_color_utilities meta vector_math sky_engine] - flutter_app_badger 1.5.0 [flutter] - flutter_cache_manager 3.3.0 [clock collection file flutter http path path_provider pedantic rxdart sqflite uuid] - flutter_dotenv 5.0.2 [flutter] - flutter_keyboard_visibility 5.4.0 [meta flutter_keyboard_visibility_platform_interface flutter_keyboard_visibility_linux flutter_keyboard_visibility_macos flutter_keyboard_visibility_web flutter_keyboard_visibility_windows flutter] - flutter_mobx 2.0.6+5 [flutter mobx] - flutter_native_image 0.0.6+1 [flutter] - flutter_native_splash 2.2.19 [args flutter flutter_web_plugins js html image meta path universal_io xml yaml] - flutter_riverpod 2.3.5 [collection flutter meta riverpod state_notifier] - flutter_secure_storage 8.0.0 [flutter flutter_secure_storage_linux flutter_secure_storage_macos flutter_secure_storage_platform_interface flutter_secure_storage_web flutter_secure_storage_windows meta] - flutter_sms 2.3.3 [flutter flutter_web_plugins plugin_platform_interface url_launcher] - flutter_svg 2.0.5 [flutter vector_graphics vector_graphics_codec vector_graphics_compiler] - flutter_translate 4.0.3 [flutter universal_io intl] - freezed_annotation 2.2.0 [collection json_annotation meta] - geolocator 9.0.2 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web geolocator_windows] - giphy_get 3.2.0 [flutter flutter_localizations provider extended_image flutter_staggered_grid_view meta http url_launcher] - google_fonts 4.0.3 [flutter http path_provider crypto] - graphql_flutter 5.1.2 [graphql gql_exec flutter meta path_provider path connectivity_plus hive plugin_platform_interface flutter_hooks] - http 0.13.5 [async http_parser meta path] - image_cropper 3.0.2 [flutter image_cropper_platform_interface image_cropper_for_web] - image_picker 0.8.7+3 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface] - in_app_review 2.0.6 [flutter in_app_review_platform_interface] - intercom_flutter 7.6.9 [flutter flutter_web_plugins intercom_flutter_platform_interface intercom_flutter_web] - intl 0.17.0 [clock path] - is_first_run 1.0.0 [flutter shared_preferences] - json_annotation 4.8.0 [meta] - mime 1.0.4 - mobx 2.1.4 [meta] - multiple_random_choice 0.1.3+1 - package_info_plus 3.1.0 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface win32] - path_provider 2.0.14 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows] - permission_handler 10.2.0 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface] - phone_form_field 7.0.6 [flutter flutter_localizations circle_flags phone_numbers_parser dart_countries intl diacritic] - provider 6.0.5 [collection flutter nested] - pull_to_refresh 2.0.0 [flutter] - qr_flutter 4.0.0 [flutter qr] - reorderables 0.6.0 [flutter] - riverpod_annotation 2.1.0 [meta riverpod] - riverpod_lint 1.3.0 [analyzer analyzer_plugin collection custom_lint_builder meta path riverpod riverpod_analyzer_utils source_span yaml] - screenshot_callback 2.0.3 [flutter] - sembast 3.4.3+1 [meta path synchronized] - share_plus 6.3.2 [cross_file meta mime flutter flutter_web_plugins share_plus_platform_interface file url_launcher_web url_launcher_windows url_launcher_linux url_launcher_platform_interface ffi win32] - shared_preferences 2.1.0 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - simple_tooltip 1.2.0 [flutter] - skeletons 0.0.3 [flutter] - sliver_tools 0.2.10 [flutter] - sms_autofill 2.2.0 [pin_input_text_field flutter] - snapkit 2.0.0 [flutter http path_provider] - social_share 2.3.1 [flutter path_provider] - storybook_flutter 0.12.0 [collection device_frame flutter freezed_annotation nested pointer_interceptor provider recase] - swipe_deck 1.0.0 [flutter] - swipeable_page_route 0.3.0 [black_hole_flutter collection flutter list_diff meta] - synchronized 3.0.1 - timeago 3.3.0 [intl] - uni_links 0.5.1 [flutter uni_links_platform_interface uni_links_web] - url_launcher 6.1.10 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - video_player 2.6.1 [flutter html video_player_android video_player_avfoundation video_player_platform_interface video_player_web] - visibility_detector 0.4.0+2 [flutter] dev dependencies: - auto_route_generator 6.2.0 [build source_gen analyzer path build_runner code_builder dart_style xml args glob auto_route] - build_runner 2.3.3 [args async analyzer build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml] - flutter_lints 2.0.1 [lints] - flutter_localizations 0.0.0 [flutter intl characters clock collection js material_color_utilities meta path vector_math] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection js matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph] - freezed 2.3.2 [analyzer build build_config collection meta source_gen freezed_annotation json_annotation] - json_serializable 6.6.1 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper] - mobx_codegen 2.2.0 [analyzer build build_resolvers meta mobx path source_gen] - riverpod_generator 2.2.0 [analyzer build build_config collection crypto meta path riverpod_analyzer_utils riverpod_annotation source_gen] dependency overrides: - web_socket_channel 2.2.0 [async crypto stream_channel] transitive dependencies: - _fe_analyzer_shared 58.0.0 [meta] - _flutterfire_internals 1.1.1 [collection firebase_core firebase_core_platform_interface flutter meta] - analyzer 5.10.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - analyzer_plugin 0.11.2 [analyzer collection dart_style pub_semver yaml] - archive 3.3.7 [crypto path pointycastle] - args 2.4.0 - black_hole_flutter 1.0.1 [collection flutter meta] - boolean_selector 2.1.1 [source_span string_scanner] - build 2.3.1 [analyzer async convert crypto glob logging meta path] - build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml] - build_daemon 3.1.1 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 2.2.0 [analyzer async build collection crypto graphs logging path package_config pool pub_semver stream_transform yaml] - build_runner_core 7.2.7 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pool timing watcher yaml] - built_collection 5.1.1 - built_value 8.4.4 [built_collection collection fixnum meta] - cached_network_image_platform_interface 2.0.0 [flutter flutter_cache_manager] - cached_network_image_web 1.0.2 [flutter flutter_cache_manager cached_network_image_platform_interface] - characters 1.2.1 - checked_yaml 2.0.2 [json_annotation source_span yaml] - ci 0.1.0 - circle_flags 1.0.4 [flutter flutter_svg] - cli_util 0.4.0 [meta path] - clock 1.1.1 - code_builder 4.4.0 [built_collection built_value collection matcher meta] - connectivity_plus 3.0.4 [flutter flutter_web_plugins connectivity_plus_platform_interface js meta nm] - connectivity_plus_platform_interface 1.2.4 [flutter meta plugin_platform_interface] - convert 3.1.1 [typed_data] - cross_file 0.3.3+4 [js meta] - crypto 3.0.2 [typed_data] - csslib 0.17.2 [source_span] - custom_lint_builder 0.3.3 [analyzer analyzer_plugin collection custom_lint custom_lint_core glob hotreloader meta path pubspec_parse rxdart] - custom_lint_core 0.3.3 [analyzer analyzer_plugin collection custom_lint matcher meta path pubspec_parse source_span yaml] - dart_countries 3.0.3 - dart_style 2.3.0 [analyzer args path pub_semver source_span] - dbus 0.7.8 [args ffi meta xml] - device_frame 1.1.0 [freezed_annotation flutter] - diacritic 0.1.3 - extended_image 6.4.1 [extended_image_library flutter meta] - extended_image_library 3.4.1 [crypto flutter http_client_helper path path_provider] - fake_async 1.3.1 [clock collection] - ffi 2.0.1 - file 6.1.4 [meta path] - firebase_analytics_platform_interface 3.4.1 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.5.2+1 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_core_platform_interface 4.6.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.3.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.4.1 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 4.3.1 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 3.3.1 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - fixnum 1.1.0 - flutter_blurhash 0.7.0 [flutter] - flutter_hooks 0.18.6 [flutter] - flutter_keyboard_visibility_linux 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_keyboard_visibility_macos 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_keyboard_visibility_platform_interface 2.0.0 [flutter meta plugin_platform_interface] - flutter_keyboard_visibility_web 2.0.0 [flutter_keyboard_visibility_platform_interface flutter_web_plugins flutter] - flutter_keyboard_visibility_windows 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_plugin_android_lifecycle 2.0.9 [flutter] - flutter_secure_storage_linux 1.1.3 [flutter flutter_secure_storage_platform_interface] - flutter_secure_storage_macos 3.0.0 [flutter flutter_secure_storage_platform_interface] - flutter_secure_storage_platform_interface 1.0.1 [flutter plugin_platform_interface] - flutter_secure_storage_web 1.1.1 [flutter flutter_secure_storage_platform_interface flutter_web_plugins js] - flutter_secure_storage_windows 2.0.0 [flutter flutter_secure_storage_platform_interface] - flutter_staggered_grid_view 0.6.2 [flutter] - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math] - frontend_server_client 3.2.0 [async path] - geolocator_android 4.1.7 [flutter geolocator_platform_interface] - geolocator_apple 2.2.5 [flutter geolocator_platform_interface] - geolocator_platform_interface 4.0.7 [flutter plugin_platform_interface vector_math meta] - geolocator_web 2.1.6 [flutter flutter_web_plugins geolocator_platform_interface] - geolocator_windows 0.1.1 [flutter geolocator_platform_interface] - glob 2.1.1 [async collection file path string_scanner] - gql 0.14.0 [collection meta source_span] - gql_dedupe_link 2.0.3+1 [async gql_exec gql_link meta] - gql_error_link 0.2.3+1 [async gql_exec gql_link meta] - gql_exec 0.4.3 [collection gql meta] - gql_http_link 0.4.5 [gql gql_exec gql_link http http_parser meta] - gql_link 0.5.1 [gql gql_exec meta] - gql_transform_link 0.2.2+1 [gql_exec gql_link] - graphql 5.1.3 [meta path gql gql_exec gql_link gql_http_link gql_transform_link gql_error_link gql_dedupe_link hive normalize http collection web_socket_channel stream_channel rxdart uuid] - graphs 2.2.0 [collection] - hive 2.2.3 [meta crypto] - hotreloader 3.0.6 [collection logging path stream_transform vm_service watcher] - html 0.15.2 [csslib source_span] - http_client_helper 2.0.3 [http] - http_multi_server 3.2.1 [async] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - image 4.0.15 [archive meta xml] - image_cropper_for_web 1.0.3 [flutter flutter_web_plugins image_cropper_platform_interface js] - image_cropper_platform_interface 3.0.3 [flutter plugin_platform_interface http] - image_picker_android 0.8.6+7 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface] - image_picker_for_web 2.1.12 [flutter flutter_web_plugins image_picker_platform_interface] - image_picker_ios 0.8.7+3 [flutter image_picker_platform_interface] - image_picker_platform_interface 2.6.3 [cross_file flutter http plugin_platform_interface] - in_app_review_platform_interface 2.0.4 [flutter url_launcher plugin_platform_interface platform] - intercom_flutter_platform_interface 1.2.3 [flutter plugin_platform_interface] - intercom_flutter_web 0.2.3 [flutter flutter_web_plugins intercom_flutter_platform_interface uuid] - io 1.0.4 [meta path string_scanner] - js 0.6.5 [meta] - lints 2.0.1 - list_diff 2.0.1 [async] - logging 1.1.1 - matcher 0.12.13 [meta stack_trace] - material_color_utilities 0.2.0 - meta 1.8.0 - nested 1.0.0 [flutter] - nm 0.5.0 [dbus] - normalize 0.7.2 [gql collection] - octo_image 1.0.2 [flutter flutter_blurhash] - package_config 2.1.0 [path] - package_info_plus_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - path 1.8.2 - path_drawing 1.0.1 [vector_math meta path_parsing flutter] - path_parsing 1.0.1 [vector_math meta] - path_provider_android 2.0.25 [flutter path_provider_platform_interface] - path_provider_foundation 2.2.2 [flutter path_provider_platform_interface] - path_provider_linux 2.1.10 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_platform_interface 2.0.6 [flutter platform plugin_platform_interface] - path_provider_windows 2.1.5 [ffi flutter path path_provider_platform_interface win32] - pedantic 1.11.1 - permission_handler_android 10.2.0 [flutter permission_handler_platform_interface] - permission_handler_apple 9.0.8 [flutter permission_handler_platform_interface] - permission_handler_platform_interface 3.9.0 [flutter meta plugin_platform_interface] - permission_handler_windows 0.1.2 [flutter permission_handler_platform_interface] - petitparser 5.1.0 [meta] - phone_number_metadata 5.0.4 [path dart_countries] - phone_numbers_parser 7.0.2 [phone_number_metadata meta dart_countries] - pin_input_text_field 4.5.0 [flutter] - platform 3.1.0 - plugin_platform_interface 2.1.4 [meta] - pointer_interceptor 0.9.3+4 [flutter] - pointycastle 3.7.3 [collection convert js] - pool 1.5.1 [async stack_trace] - process 4.2.4 [file path platform] - pub_semver 2.1.3 [collection meta] - pubspec_parse 1.2.2 [checked_yaml collection json_annotation pub_semver yaml] - qr 2.1.0 [meta] - quiver 3.2.1 [matcher] - recase 4.1.0 - riverpod 2.3.5 [meta stack_trace state_notifier] - riverpod_analyzer_utils 0.3.0 [analyzer collection crypto custom_lint_core freezed_annotation meta path source_span] - rxdart 0.27.7 - share_plus_platform_interface 3.2.1 [cross_file flutter meta mime plugin_platform_interface path_provider uuid] - shared_preferences_android 2.1.2 [flutter shared_preferences_platform_interface] - shared_preferences_foundation 2.2.1 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.2.0 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_platform_interface 2.2.0 [flutter plugin_platform_interface] - shared_preferences_web 2.1.0 [flutter flutter_web_plugins shared_preferences_platform_interface] - shared_preferences_windows 2.2.0 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - shelf 1.4.0 [async collection http_parser path stack_trace stream_channel] - shelf_web_socket 1.0.3 [shelf stream_channel web_socket_channel] - sky_engine 0.0.99 - source_gen 1.2.7 [analyzer async build dart_style glob path source_span yaml] - source_helper 1.3.3 [analyzer collection source_gen] - source_span 1.9.1 [collection path term_glyph] - sqflite 2.2.6 [flutter sqflite_common path] - sqflite_common 2.4.3 [synchronized path meta] - stack_trace 1.11.0 [path] - state_notifier 0.7.2+1 [meta] - stream_channel 2.1.1 [async] - stream_transform 2.1.0 - string_scanner 1.2.0 [source_span] - term_glyph 1.2.1 - test_api 0.4.16 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - timing 1.0.1 [json_annotation] - typed_data 1.3.1 [collection] - uni_links_platform_interface 1.0.0 [flutter plugin_platform_interface] - uni_links_web 0.1.0 [flutter flutter_web_plugins uni_links_platform_interface] - universal_io 2.2.0 [collection meta typed_data] - url_launcher_android 6.0.27 [flutter url_launcher_platform_interface] - url_launcher_ios 6.1.4 [flutter url_launcher_platform_interface] - url_launcher_linux 3.0.4 [flutter url_launcher_platform_interface] - url_launcher_macos 3.0.5 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.1.2 [flutter plugin_platform_interface] - url_launcher_web 2.0.16 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.0.5 [flutter url_launcher_platform_interface] - uuid 3.0.7 [crypto] - vector_graphics 1.1.5 [flutter vector_graphics_codec] - vector_graphics_codec 1.1.5 - vector_graphics_compiler 1.1.5 [args meta path_parsing xml vector_graphics_codec] - vector_math 2.1.4 - video_player_android 2.4.4 [flutter video_player_platform_interface] - video_player_avfoundation 2.4.4 [flutter video_player_platform_interface] - video_player_platform_interface 6.1.0 [flutter plugin_platform_interface] - video_player_web 2.0.16 [flutter flutter_web_plugins video_player_platform_interface] - vm_service 11.3.0 - watcher 1.0.2 [async path] - win32 3.1.4 [ffi] - xdg_directories 1.0.0 [meta path process] - xml 6.2.2 [collection meta petitparser] - yaml 3.1.1 [collection source_span string_scanner] ```

darshankawar commented 1 year ago

Thanks for the report @simplenotezy

I followed this guide: https://firebase.flutter.dev/docs/messaging/apple-integration#step-3---use-the-extension-helper

This document reference is now archived and all flutterfire related documents have been moved to https://firebase.google.com/docs/cloud-messaging/flutter/client#install_the_fcm_plugin so going forward, please refer documentation from this new domain.

Having said that, I tried to find extension helper related section reference in the new domain but couldn't find it :(, so I am not sure if the instructions mentioned in the archived documentation have changed or not. I'll keep looking to see if I get new link of it.

Meantime, can you check this comment and see if it helps in your case ?

simplenotezy commented 1 year ago

Thanks for your fast reply @darshankawar - I'll keep looking as well, and will keep you posted, if I find anything. Greatly appreciate you'll keep looking as well.

It was set to iOS 16, but changing it didn't seem to help unfortunately

simplenotezy commented 1 year ago

Oh, interesting. I notice now that it is only for simulators that it fails to build. If I run it on my own real device, it runs fine.

I checked the firebase_messaging build settings under the pod_runner, and I have a suspision that it might be due to "Excluded architectures" when running a simulator on my ARM macbook:

image
simplenotezy commented 1 year ago

This seemed to fix the issue:

ios/Runner.xcodeproj/project.pbxproj

@@ -633,6 +633,7 @@
                                CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
                                DEVELOPMENT_TEAM = XXXX;
                                ENABLE_BITCODE = NO;
+                               "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
                                INFOPLIST_FILE = Runner/Info.plist;
                                LD_RUNPATH_SEARCH_PATHS = (
                                        "$(inherited)",
@@ -687,6 +688,8 @@
                                CODE_SIGN_STYLE = Automatic;
                                CURRENT_PROJECT_VERSION = 1;
                                DEVELOPMENT_TEAM = XXXX;
+                               "EXCLUDED_ARCHS[sdk=iphoneos*]" = armv7;
+                               "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
                                GCC_C_LANGUAGE_STANDARD = gnu11;
                                GENERATE_INFOPLIST_FILE = YES;
                                INFOPLIST_FILE = ImageNotification/Info.plist;

Now it builds for both iOS Simulator and on my real device.

Steps to fix:

  1. Open the xcode project
  2. Open project navigator (top right folder icon)
  3. Click the "Runner"
  4. Go to "Build settings"
  5. Click ImageNotification target
  6. Under "Excluded Architectures" set the following:
    • Any iOS SDK: armv7
    • Any iOS Simulator SDK: arm64
  7. It should now work on both simulator and real device

image

simplenotezy commented 1 year ago

So for some reason once in our CI/CD builds fail still, despite I am able to create the build locally without issue. The CI/CD outputs the following (truncated some irrelevant parts to keep output to a minimum):

Click To Expand ``` flutter build ios --release --no-codesign --build-name $VERSION_NAME --build-number $INCREMENTED_VERSION_CODE shell: /bin/bash -e {0} env: FLUTTER_VERSION: 3.7.8 FLUTTER_CHANNEL: stable LANE: closed_beta GITHUB_REF: refs/tags/v2.8.2 VERSION_CODE: 287 INCREMENT_VERSION_CODE: 1000 FLUTTER_ROOT: /Users/runner/hostedtoolcache/flutter/3.7.8-stable/x64 PUB_CACHE: /Users/runner/hostedtoolcache/flutter/3.7.8-stable/x64/.pub-cache ##[endgroup] Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device. Building *** for device (ios-release)... Running pod install... 66.6s CocoaPods' output: ↳ Preparing Analyzing dependencies Inspecting targets to integrate Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``) Using `ARCHS` setting to build architectures of target `Pods-ImageNotification`: (``) Finding Podfile changes - Firebase - Flutter - GoogleUtilities - amplitude_flutter - app_tracking_transparency - appsflyer_sdk - connectivity_plus - contacts_service - firebase_analytics - firebase_core - firebase_crashlytics - firebase_messaging - flutter_app_badger - flutter_keyboard_visibility - flutter_native_image - flutter_native_splash - flutter_secure_storage - flutter_sms - geolocator_apple - image_cropper - image_picker_ios - in_app_review - intercom_flutter - package_info_plus - path_provider_foundation - permission_handler_apple - screenshot_callback - share_plus - shared_preferences_foundation - sms_autofill - snapkit - social_share - sqflite - uni_links - url_launcher_ios - video_player_avfoundation Fetching external sources -> Fetching podspec for `Flutter` from `Flutter` -> Fetching podspec for `amplitude_flutter` from `.symlinks/plugins/amplitude_flutter/ios` -> Fetching podspec for `app_tracking_transparency` from `.symlinks/plugins/app_tracking_transparency/ios` -> Fetching podspec for `appsflyer_sdk` from `.symlinks/plugins/appsflyer_sdk/ios` -> Fetching podspec for `connectivity_plus` from `.symlinks/plugins/connectivity_plus/ios` -> Fetching podspec for `contacts_service` from `.symlinks/plugins/contacts_service/ios` -> Fetching podspec for `firebase_analytics` from `.symlinks/plugins/firebase_analytics/ios` firebase_analytics: Using Firebase SDK version '10.7.0' defined in 'firebase_core' -> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios` firebase_core: Using Firebase SDK version '10.7.0' defined in 'firebase_core' -> Fetching podspec for `firebase_crashlytics` from `.symlinks/plugins/firebase_crashlytics/ios` Warning: firebase_app_id_file.json file does not exist. This may cause issues in upload-symbols. If this error is unexpected, try running flutterfire configure again. firebase_crashlytics: Using Firebase SDK version '10.7.0' defined in 'firebase_core' -> Fetching podspec for `firebase_messaging` from `.symlinks/plugins/firebase_messaging/ios` firebase_messaging: Using Firebase SDK version '10.7.0' defined in 'firebase_core' -> Fetching podspec for `flutter_app_badger` from `.symlinks/plugins/flutter_app_badger/ios` -> Fetching podspec for `flutter_keyboard_visibility` from `.symlinks/plugins/flutter_keyboard_visibility/ios` -> Fetching podspec for `flutter_native_image` from `.symlinks/plugins/flutter_native_image/ios` -> Fetching podspec for `flutter_native_splash` from `.symlinks/plugins/flutter_native_splash/ios` -> Fetching podspec for `flutter_secure_storage` from `.symlinks/plugins/flutter_secure_storage/ios` Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies. To update the CocoaPods specs, run: pod repo update -> Fetching podspec for `flutter_sms` from `.symlinks/plugins/flutter_sms/ios` -> Fetching podspec for `geolocator_apple` from `.symlinks/plugins/geolocator_apple/ios` -> Fetching podspec for `image_cropper` from `.symlinks/plugins/image_cropper/ios` -> Fetching podspec for `image_picker_ios` from `.symlinks/plugins/image_picker_ios/ios` -> Fetching podspec for `in_app_review` from `.symlinks/plugins/in_app_review/ios` -> Fetching podspec for `intercom_flutter` from `.symlinks/plugins/intercom_flutter/ios` -> Fetching podspec for `package_info_plus` from `.symlinks/plugins/package_info_plus/ios` -> Fetching podspec for `path_provider_foundation` from `.symlinks/plugins/path_provider_foundation/ios` -> Fetching podspec for `permission_handler_apple` from `.symlinks/plugins/permission_handler_apple/ios` -> Fetching podspec for `screenshot_callback` from `.symlinks/plugins/screenshot_callback/ios` -> Fetching podspec for `share_plus` from `.symlinks/plugins/share_plus/ios` -> Fetching podspec for `shared_preferences_foundation` from `.symlinks/plugins/shared_preferences_foundation/ios` -> Fetching podspec for `sms_autofill` from `.symlinks/plugins/sms_autofill/ios` -> Fetching podspec for `snapkit` from `.symlinks/plugins/snapkit/ios` -> Fetching podspec for `social_share` from `.symlinks/plugins/social_share/ios` -> Fetching podspec for `sqflite` from `.symlinks/plugins/sqflite/ios` -> Fetching podspec for `uni_links` from `.symlinks/plugins/uni_links/ios` -> Fetching podspec for `url_launcher_ios` from `.symlinks/plugins/url_launcher_ios/ios` -> Fetching podspec for `video_player_avfoundation` from `.symlinks/plugins/video_player_avfoundation/ios` Resolving dependencies of `Podfile` Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/` CocoaPods 1.12.1 is available. To update use: `gem install cocoapods` For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.12.1 CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: Specs/0/8/4/GoogleUtilities/7.11.1/GoogleUtilities.podspec.json modified during this run! Returning local CDN: trunk Relative path: Specs/0/3/5/Firebase/10.8.0/Firebase.podspec.json modified during this run! Returning local CDN: trunk Relative path: Specs/0/3/5/Firebase/10.6.0/Firebase.podspec.json modified during this run! Returning local CDN: trunk Relative path: Specs/f/4/d/Amplitude/8.15.2/Amplitude.podspec.json modified during this run! Returning local CDN: trunk Relative path: Specs/7/a/c/AppsFlyerFramework/6.10.1/AppsFlyerFramework.podspec.json modified during this run! Returning local CDN: trunk Relative path: Specs/a/6/2/Intercom/14.1.0/Intercom.podspec.json modified during this run! Returning local CDN: trunk Relative path: Specs/4/2/c/FlutterMacOS/3.0.0/FlutterMacOS.podspec.json modified during this run! Returning local CDN: trunk Relative path: Specs/7/0/b/SnapSDK/2.4.0/SnapSDK.podspec.json modified during this run! Returning local CDN: trunk Relative path: Specs/f/4/e/FMDB/2.7.5/FMDB.podspec.json modified during this run! Returning local CDN: trunk Relative path: Specs/3/7/4/TOCropViewController/2.6.1/TOCropViewController.podspec.json modified during this run! Returning local CDN: trunk Relative path: Specs/d/d/6/ReachabilitySwift/5.0.0/ReachabilitySwift.podspec.json modified during this run! Returning local [!] CocoaPods could not find compatible versions for pod "Intercom": In snapshot (Podfile.lock): Intercom (= 14.0.7, ~> 14.0.7) In Podfile: intercom_flutter (from `.symlinks/plugins/intercom_flutter/ios`) was resolved to 7.5.0, which depends on Intercom (~> 14.1.0) You have either: * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`. * changed the constraints of dependency `Intercom` inside your development pod `intercom_flutter`. You should run `pod update Intercom` to apply changes you've made. /usr/local/lib/ruby/gems/3.0.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:317:in `raise_error_unless_state' /usr/local/lib/ruby/gems/3.0.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:299:in `block in unwind_for_conflict' :90:in `tap' /usr/local/lib/ruby/gems/3.0.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `unwind_for_conflict' /usr/local/lib/ruby/gems/3.0.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:257:in `process_topmost_state' /usr/local/lib/ruby/gems/3.0.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve' /usr/local/lib/ruby/gems/3.0.0/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve' /usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.0/lib/cocoapods/resolver.rb:94:in `resolve' /usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.0/lib/cocoapods/installer/analyzer.rb:1082:in `block in resolve_dependencies' /usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.0/lib/cocoapods/user_interface.rb:64:in `section' /usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.0/lib/cocoapods/installer/analyzer.rb:1080:in `resolve_dependencies' /usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.0/lib/cocoapods/installer/analyzer.rb:125:in `analyze' /usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:422:in `analyze' /usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:244:in `block in resolve_dependencies' /usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.0/lib/cocoapods/user_interface.rb:64:in `section' /usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:243:in `resolve_dependencies' /usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:162:in `install!' /usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.0/lib/cocoapods/command/install.rb:52:in `run' /usr/local/lib/ruby/gems/3.0.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run' /usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.0/lib/cocoapods/command.rb:52:in `run' /usr/local/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.0/bin/pod:55:in `' /usr/local/lib/ruby/gems/3.0.0/bin/pod:25:in `load' /usr/local/lib/ruby/gems/3.0.0/bin/pod:25:in `
' Error output from CocoaPods: ↳ [!] The version of CocoaPods used to generate the lockfile (1.12.1) is higher than the version of the current executable (1.12.0). Incompatibility issues may arise. Error running pod install ##[error]Process completed with exit code 1. Post job cleanup. [command]/usr/local/bin/git version git version 2.40.0 Copying '/Users/runner/.gitconfig' to '/Users/runner/work/_temp/24bffb27-4eaa-4c94-9452-4c9703b4a432/.gitconfig' Temporarily overriding HOME='/Users/runner/work/_temp/24bffb27-4eaa-4c94-9452-4c9703b4a432' before making global git config changes Adding repository directory to the temporary git global config as a safe directory [command]/usr/local/bin/git config --global --add safe.directory /Users/runner/work/app/app [command]/usr/local/bin/git config --local --name-only --get-regexp core\.sshCommand [command]/usr/local/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :" [command]/usr/local/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader http.https://github.com/.extraheader [command]/usr/local/bin/git config --local --unset-all http.https://github.com/.extraheader [command]/usr/local/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :" Cleaning up orphan processes ```
darshankawar commented 1 year ago

Thanks for the update. The phone architecture is arm64, so if we add "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; , it will run on simulators properly.

Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies. To update the CocoaPods specs, run: pod repo update

Can you try running pod repo update as suggested and see if it fixes the error ? Ideally it should. Alternatively, deleting the podfile.lock and then running the app again is another way.

simplenotezy commented 1 year ago

Thanks for the update. The phone architecture is arm64, so if we add "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; , it will run on simulators properly.

Exactly! So it works now which is great.

Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies. To update the CocoaPods specs, run: pod repo update

Can you try running pod repo update as suggested and see if it fixes the error ? Ideally it should. Alternatively, deleting the podfile.lock and then running the app again is another way.

I tried deleting podfile.lock, deleting pods, all cache, running pod update etc, still to no avail. However I am begnning to think it's not related to this issue at all to be honest, although I'd love some help as to what I can do. Perhaps it's more suited for Intercom repo.

If I run flutter build ios --release --no-codesign locally on my ARM machine it works, but when that runs in Github actions using a x64 machine, it seems to break there.

darshankawar commented 1 year ago

Thanks for the update. I'll keep this issue open for team's input on expected behavior in the case of reported behavior and also on the documentation part.

/cc @Lyokone

simplenotezy commented 1 year ago

FYI I got the CI/CD working miraculously today, by doing the exact same thing I did yesterday (deleting Podfile.lock and running pod repo update). Not sure why, but I don't complain!

darshankawar commented 1 year ago

Good to know that the issue is resolved. I'll close this based on above comment. If you see the error again, write in comments and I'll reopen it.

simplenotezy commented 1 year ago

Hey @darshankawar I think the only thing would be to update the documentation for how to enabled image notifications, I think a lot of people would need that, and it was difficult to find up-to-date information.

darshankawar commented 1 year ago

Thanks for the feedback @simplenotezy. I suggest you to open a new documentation issue so that we can address and track it properly.