π [firebase_crashlytics] Cannot convert value of type 'UnsafeRawPointer' in ios
Bug report
After added firebase_crashlytics project not building for ios.
Swift Compiler Error (Xcode): Cannot convert value of type 'UnsafeRawPointer' to expected argument type 'UnsafePointer<pb_byte_t>?' (aka 'Optional<UnsafePointer<UInt8>>')
/ios/Pods/FirebaseSessions/FirebaseSessions/Sources/SessionStartEvent.swift:191:55
Flutter doctor
Click To Expand
[!] Flutter (Channel stable, 3.7.6, on macOS 12.1 21C52 darwin-arm64, locale ru-RU)
! Warning: dart on your path resolves to /opt/homebrew/Cellar/dart/2.15.1/libexec/bin/dart, which is not inside your
current Flutter SDK checkout at /Applications/flutter. Consider adding /Applications/flutter/bin to the front of your path.
[β] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[β] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[β] Chrome - develop for the web
[β] Android Studio (version 2022.1)
[β] VS Code (version 1.76.2)
[β] Connected device (3 available)
[β] HTTP Host Availability
Flutter dependencies
Click To Expand
Dart SDK 2.19.3 Flutter SDK 3.7.6 client 1.1.3+1
dependencies:
- bloc_concurrency 0.2.1 [bloc stream_transform]
- cached_network_image 3.2.3 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web]
- carousel_slider 4.2.1 [flutter]
- connectivity_plus 3.0.3 [flutter flutter_web_plugins connectivity_plus_platform_interface js meta nm]
- dio 4.0.6 [http_parser path]
- easy_mask 2.0.1 [flutter]
- equatable 2.0.5 [collection meta]
- firebase_core 2.9.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 3.1.0 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- firebase_messaging 14.4.0 [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_bloc 8.1.2 [flutter bloc provider]
- flutter_localizations 0.0.0 [flutter intl characters clock collection js material_color_utilities meta path vector_math]
- flutter_secure_storage 7.0.1 [flutter flutter_secure_storage_linux flutter_secure_storage_macos flutter_secure_storage_platform_interface flutter_secure_storage_web flutter_secure_storage_windows meta]
- flutter_svg 1.1.6 [flutter meta path_drawing vector_math xml]
- freezed_annotation 2.2.0 [collection json_annotation meta]
- go_router 6.5.2 [collection flutter flutter_web_plugins logging meta]
- google_fonts 4.0.3 [flutter http path_provider crypto]
- grouped_list 5.1.2 [flutter]
- hive 2.2.3 [meta crypto]
- hive_flutter 1.1.0 [flutter hive path_provider path]
- http 0.13.5 [async http_parser meta path]
- hydrated_bloc 9.1.0 [bloc hive meta synchronized]
- image_picker 0.8.7+1 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface]
- intl 0.17.0 [clock path]
- loading_animation_widget 1.2.0+4 [flutter]
- path 1.8.2
- path_provider 2.0.14 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows]
- percent_indicator 4.2.3 [flutter]
- provider 6.0.5 [collection flutter nested]
- read_more_text 0.0.5 [flutter]
- rxdart 0.27.7
- 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]
- shimmer 2.0.0 [flutter]
- syncfusion_flutter_datepicker 20.4.54 [flutter intl syncfusion_flutter_core]
- table_calendar 3.0.8 [flutter intl simple_gesture_detector]
- 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]
- yandex_mapkit 3.2.0 [flutter_plugin_android_lifecycle equatable collection flutter]
dev dependencies:
- 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_launcher_icons 0.11.0 [args checked_yaml cli_util image json_annotation path yaml]
- flutter_lints 1.0.4 [lints]
- flutter_native_splash 2.2.16 [args flutter flutter_web_plugins js html image meta path universal_io xml yaml]
- 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]
- hive_generator 2.0.0 [build source_gen hive analyzer source_helper]
- json_serializable 6.6.1 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper]
transitive dependencies:
- _fe_analyzer_shared 58.0.0 [meta]
- _flutterfire_internals 1.1.0 [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]
- archive 3.3.6 [crypto path pointycastle]
- args 2.4.0
- async 2.10.0 [collection meta]
- bloc 8.1.1 [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]
- cli_util 0.3.5 [meta path]
- clock 1.1.1
- code_builder 4.4.0 [built_collection built_value collection matcher meta]
- collection 1.17.0
- 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]
- dart_style 2.3.0 [analyzer args path pub_semver source_span]
- dbus 0.7.8 [args ffi meta xml]
- fake_async 1.3.1 [clock collection]
- ffi 2.0.1
- file 6.1.4 [meta path]
- 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.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_platform_interface 4.3.0 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 3.3.0 [_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_cache_manager 3.3.0 [clock collection file flutter http path path_provider pedantic rxdart sqflite uuid]
- 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 2.0.1 [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 1.1.3 [flutter flutter_secure_storage_platform_interface]
- flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math]
- frontend_server_client 3.2.0 [async path]
- glob 2.1.1 [async collection file path string_scanner]
- graphs 2.2.0 [collection]
- html 0.15.2 [csslib source_span]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- image 3.3.0 [archive meta xml]
- image_picker_android 0.8.6+6 [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+2 [flutter image_picker_platform_interface]
- image_picker_platform_interface 2.6.3 [cross_file flutter http plugin_platform_interface]
- io 1.0.4 [meta path string_scanner]
- js 0.6.5 [meta]
- json_annotation 4.8.0 [meta]
- lints 1.0.1
- logging 1.1.1
- matcher 0.12.13 [meta stack_trace]
- material_color_utilities 0.2.0
- meta 1.8.0
- mime 1.0.4
- nested 1.0.0 [flutter]
- nm 0.5.0 [dbus]
- octo_image 1.0.2 [flutter flutter_blurhash]
- package_config 2.1.0 [path]
- path_drawing 1.0.1 [vector_math meta path_parsing flutter]
- path_parsing 1.0.1 [vector_math meta]
- path_provider_android 2.0.24 [flutter path_provider_platform_interface]
- path_provider_foundation 2.2.1 [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
- petitparser 5.1.0 [meta]
- platform 3.1.0
- plugin_platform_interface 2.1.4 [meta]
- pointycastle 3.7.2 [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]
- shared_preferences_android 2.1.0 [flutter shared_preferences_platform_interface]
- shared_preferences_foundation 2.2.0 [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]
- simple_gesture_detector 0.2.0 [flutter]
- 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]
- stream_channel 2.1.1 [async]
- stream_transform 2.1.0
- string_scanner 1.2.0 [source_span]
- syncfusion_flutter_core 20.4.54 [vector_math flutter]
- synchronized 3.0.1
- 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]
- universal_io 2.2.0 [collection meta typed_data]
- url_launcher_android 6.0.26 [flutter url_launcher_platform_interface]
- url_launcher_ios 6.1.3 [flutter url_launcher_platform_interface]
- url_launcher_linux 3.0.4 [flutter url_launcher_platform_interface]
- url_launcher_macos 3.0.4 [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_math 2.1.4
- watcher 1.0.2 [async path]
- web_socket_channel 2.3.0 [async crypto stream_channel]
- win32 3.1.3 [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]
Thanks for the report. I am able to replicate this using cloud_firestore plugin example and by adding firebase_crashlytics to it which gives below error:
Running pod install...
Running Xcode build...
Xcode build done. 21.9s
Failed to build iOS app
Swift Compiler Error (Xcode): Cannot convert value of type 'UnsafeRawPointer' to expected argument type 'UnsafePointer<pb_byte_t>?' (aka 'Optional<UnsafePointer<UInt8>>')
/Users/dhs/Documents/NCFlutter/flutterfire/packages/cloud_firestore/cloud_firestore/example/ios/Pods/FirebaseSessions/FirebaseSessions/Sources/SessionStartEvent.swift:191:55
Uncategorized (Xcode): Command CompileSwift failed with a nonzero exit code
Could not build the application for the simulator.
Error launching application on iPhone 13.
Saw something similar in another report: https://github.com/firebase/flutterfire/issues/10709#issuecomment-1494147462
/cc @Lyokone
Having the same issue on my M1 Mac -- started happening when I added cloud_functions: ^4.0.13 to my app. I've already had several other firebase dependencies such as crashlytics
pod repo update
also tried and still have error
I fixed this issue by going into the Swift file and changing the offending line to:
let bytes = (transportBytes as NSData).bytes.bindMemory(to: pb_byte_t.self, capacity: transportBytes.count)
Though I had to unlock the dependency and that doesn't feel sustainable long term
(transportBytes as NSData).bytes.bindMemory(to: pb_byte_t.self, capacity: transportBytes.count)
Thats helps, thanks!
Dont think this issue should be closed since the root cause hasnt been fixed
@darshankawar you can't possibly suggest that editing Firebase source code locally is an acceptable solution. Please, reopen this issue. We're also facing this problem with Firebase Crashlytics now.
Thank you @pandora-house.
Just to give you some more details, the build fails for versions 3.1.0 and 3.1.1. Version 3.0.17 is OK.
I'm using Flutter version 3.7.11.
For some reason, neither I or any of our developers can reproduce the issues locally - we only hit it when running on CI.
I run fluter clean and pod upgrade, etc. but I can always build locally. I am on macOS 13.1.
I hit the issue when running a clean build on Azure DevOps using macOS 11 and 12.
Hi @lukaszciastko, with your Azure DevOps pipeline you should try to use "macOS-12" vmImage, it has XCode 13.4.1Β and Xcode build with latest firebase_crashlytics should works.
the same error
I have the same issue too
Same here
Hello, I can't reproduce the issue locally using XCode 14.3 and firebase_crashlytics: 3.1.2.
Any of you can give more information on your setup?
@Lyokone i use xcode 13.2.1
@brux88 Can you update to the latest version of XCode?
Can confirm that this is reproducable on Xcode 13.2.1. Works fine on my newer computer with Xcode 14.3. For me upgrading Xcode to 14.3 on my older computer is not an option, 14.3 is not compatible with Big Sur and Big Sur cannot be upgraded on said computer.
You have some unofficial options to upgrade macOS on older macs that Apple no longer supports. Unfortunately, we will always try to support as many versions of XCode as possible but will only provide support for the latest version.
This is something Google ~~should~~ could fix in the Firebase native SDK, the same issue plagues React Native Firebase, as it uses the same native iOS SDK. This should be somewhat easy to fix using conditional compilation, if I'm not totally mistaken.
Hey @pandora-house. 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!