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

🐛 [firebase_auth] iOS crashes when signing in with Apple #9638

Closed
felixgabler opened this issue Sep 29, 2022 · 14 comments · Fixed by #9644
Closed

🐛 [firebase_auth] iOS crashes when signing in with Apple #9638

felixgabler opened this issue Sep 29, 2022 · 14 comments · Fixed by #9644
Assignees
Labels
platform: ios Issues / PRs which are specifically for iOS. plugin: auth resolution: fixed A fix has been merged or is pending merge from a PR. type: bug Something isn't working type: crash A compile error or crash

Comments

@felixgabler
Copy link

Bug report

Describe the bug
When I try to sign in with my Apple ID using await _auth.signInWithProvider(appleProvider) the app crashes on iOS. On Android it works fine.

The console output:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[3]'
*** First throw call stack:
(0x18049d0fc 0x198cd7d64 0x1805a6564 0x1805b16e0 0x18045a514 0x180478ebc 0x1049f8968 0x1049f8528 0x1049f0b34 0x1049f2520 0x18010d924 0x18010f670 0x18011db70 0x180455d84 0x18040ff5c 0x180423468 0x19bfae38c 0x182dc5088 0x182b43958 0x1046b34e8 0x105871aa4)
libc++abi: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001b79d7964 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`:
->  0x1b79d7964 <+8>:  b.lo   0x1b79d7984               ; <+40>
    0x1b79d7968 <+12>: pacibsp
    0x1b79d796c <+16>: stp    x29, x30, [sp, #-0x10]!
    0x1b79d7970 <+20>: mov    x29, sp
Target 0: (Runner) stopped.

Device logs of the crash:

Last Exception Backtrace:
0   CoreFoundation                	       0x18049d0fc __exceptionPreprocess + 220
1   libobjc.A.dylib               	       0x198cd7d64 objc_exception_throw + 60
2   CoreFoundation                	       0x1805a6564 -[__NSCFString characterAtIndex:].cold.1 + 0
3   CoreFoundation                	       0x1805b16e0 -[__NSPlaceholderDictionary initWithCapacity:].cold.1 + 0
4   CoreFoundation                	       0x18045a514 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 320
5   CoreFoundation                	       0x180478ebc +[NSDictionary dictionaryWithObjects:forKeys:count:] + 60
6   Runner                        	       0x104cc4968 +[FLTFirebaseAuthPlugin getNSDictionaryFromAuthCredential:] + 316
7   Runner                        	       0x104cc4528 -[FLTFirebaseAuthPlugin getNSDictionaryFromAuthResult:] + 168
8   Runner                        	       0x104cbcb34 __49-[FLTFirebaseAuthPlugin handleMethodCall:result:]_block_invoke.295 + 72
9   Runner                        	       0x104cbe520 handleSignInWithApple + 196
10  libdispatch.dylib             	       0x18010d924 _dispatch_call_block_and_release + 32
11  libdispatch.dylib             	       0x18010f670 _dispatch_client_callout + 20
12  libdispatch.dylib             	       0x18011db70 _dispatch_main_queue_callback_4CF + 944
13  CoreFoundation                	       0x180455d84 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
14  CoreFoundation                	       0x18040ff5c __CFRunLoopRun + 2540
15  CoreFoundation                	       0x180423468 CFRunLoopRunSpecific + 600
16  GraphicsServices              	       0x19bfae38c GSEventRunModal + 164
17  UIKitCore                     	       0x182dc5088 -[UIApplication _run] + 1100
18  UIKitCore                     	       0x182b43958 UIApplicationMain + 2092
19  Runner                        	       0x10497f4e8 main + 64
20  dyld                          	       0x105869aa4 start + 520

Steps to reproduce

Steps to reproduce the behavior:

  1. Set up an apple provider with scopes 'email' and 'name' (but it also crashes without)
final appleProvider = auth.AppleAuthProvider()
      ..addScope('email')
      ..addScope('name');
  1. Call FirebaseAuth.instance.signInWithProvider(appleProvider)
  2. In the iOS dialog, select that you want to share name and use email relay
  3. Use face ID or password to authorize the sign in with Apple
  4. The app just crashes

Expected behavior

The app should sign me in with my Apple ID and return name and email in the userCredential.user.providerData.

Sample project

If required, I can take the time to set something up but for iOS I feel like it is super complicated with new App ID, Team ID etc. Or am I missing a simple way to share it?

Here is the relevant code I use (copied from my app).

Future<String?> signInWithApple() async {
    final appleProvider = AppleAuthProvider()
      ..addScope('email')
      ..addScope('name');
    final UserCredential userCredential;
    if (kIsWeb) {
      userCredential = await FirebaseAuth.instance.signInWithPopup(appleProvider);
    } else {
      userCredential = await FirebaseAuth.instance.signInWithProvider(appleProvider);
      // CRASHES HERE
    }

    // OTHER BUG: name and email are not returned on iOS
   return userCredential.user?.providerData.firstOrNull?.displayName;
}

Additional context

Tested both on a simulator and a real device. I always removed the Apple ID from the app between tests using the Apple ID settings. Also tried flutter clean and removing the scopes name and email.

The scopes actually also do not seem to work correctly with the new signInWithProvider (also not with linkWithProvider) in my testing with the previous version of this package. They do not return a name and email. Should I create another issue about this?

I previously used sign_in_with_apple but replaced it and set everything up according to https://firebase.google.com/docs/auth/flutter/federated-auth#ios. It works well for Android for both sign in and linking. It also returns the name and email correctly.


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.3.3, on macOS 12.6 21G115 darwin-arm, locale en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.2.2)
[✓] Connected device (4 available)
[✓] HTTP Host Availability

• No issues found!

Flutter dependencies

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

Click To Expand
Dart SDK 2.18.2
Flutter SDK 3.3.3
weo_app 1.2.0-alpha.1

dependencies:
- another_xlider 1.1.2 [flutter]
- app_settings 4.1.8 [flutter]
- async 2.9.0 [collection meta]
- background_fetch 1.1.0 [flutter]
- badges 2.0.3 [flutter]
- better_player 0.0.81 [flutter cupertino_icons wakelock meta flutter_widget_from_html_core visibility_detector path_provider collection xml]
- cached_network_image 3.2.2 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web]
- characters 1.2.1
- clock 1.1.1
- cloud_firestore 3.5.0 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
- cloud_functions 3.3.9 [cloud_functions_platform_interface cloud_functions_web firebase_core firebase_core_platform_interface flutter]
- collection 1.16.0
- connectivity_plus 2.3.7 [flutter connectivity_plus_platform_interface connectivity_plus_linux connectivity_plus_macos connectivity_plus_web connectivity_plus_windows]
- crypto 3.0.2 [typed_data]
- decimal 2.3.0 [rational]
- equatable 2.0.5 [collection meta]
- expandable_bottom_bar 2.0.2 [flutter]
- file_picker 5.2.0+1 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path win32]
- firebase_analytics 9.3.7 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter]
- firebase_auth 3.11.0 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_core 1.24.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 2.8.12 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- firebase_dynamic_links 4.3.9 [firebase_core firebase_core_platform_interface firebase_dynamic_links_platform_interface flutter meta plugin_platform_interface]
- firebase_messaging 13.0.4 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- firebase_performance 0.8.3+2 [firebase_core firebase_core_platform_interface firebase_performance_platform_interface firebase_performance_web flutter]
- firebase_storage 10.3.10 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter]
- fl_chart 0.55.2 [flutter equatable]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
- flutter_cache_manager 3.3.0 [clock collection file flutter http path path_provider pedantic rxdart sqflite uuid]
- flutter_chat_types 3.4.5 [equatable json_annotation meta]
- flutter_chat_ui 1.6.4 [diffutil_dart equatable flutter flutter_chat_types flutter_link_previewer flutter_parsed_text intl meta photo_view url_launcher visibility_detector]
- flutter_contacts 1.1.5 [flutter]
- flutter_health_fit 0.1.0 [flutter]
- flutter_linkify 5.0.2 [flutter linkify]
- flutter_local_notifications 11.0.1 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone]
- flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math]
- flutter_native_timezone 2.0.0 [flutter_web_plugins flutter js]
- flutter_page_transition 0.1.6 [flutter]
- flutter_reaction_button 2.0.1+2 [flutter]
- flutter_speed_dial 6.0.0 [flutter]
- flutter_svg 1.1.5 [flutter meta path_drawing vector_math xml]
- freezed_annotation 2.1.0 [collection json_annotation meta]
- geolocator 9.0.2 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web geolocator_windows]
- get 4.6.5 [flutter]
- google_fonts 3.0.1 [flutter http path_provider crypto]
- google_geocoding 0.2.0 [flutter http]
- google_place 0.4.7 [http]
- google_sign_in 5.4.2 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web]
- image_cropper 3.0.0 [flutter image_cropper_platform_interface image_cropper_for_web]
- image_picker 0.8.5+3 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface]
- in_app_review 2.0.4 [flutter in_app_review_platform_interface]
- intl 0.17.0 [clock path]
- json_annotation 4.6.0 [meta]
- lottie 1.4.3 [archive flutter path vector_math]
- meilisearch 0.6.0 [dio crypto]
- open_filex 4.1.1 [flutter ffi]
- package_info_plus 1.4.3+1 [flutter package_info_plus_platform_interface package_info_plus_linux package_info_plus_macos package_info_plus_windows package_info_plus_web]
- permission_handler 10.0.2 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface]
- phone_number 1.0.0 [flutter meta]
- pref 2.6.0 [flutter logging shared_preferences]
- rxdart 0.27.5
- scroll_to_index 3.0.1 [flutter]
- share_plus 4.4.0 [meta mime flutter share_plus_platform_interface share_plus_linux share_plus_macos share_plus_windows share_plus_web]
- timezone 0.9.0 [path]
- url_launcher 6.1.6 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
- uuid 3.0.6 [crypto]
- wakelock 0.6.2 [flutter meta wakelock_macos wakelock_platform_interface wakelock_web wakelock_windows]
- youtube_explode_dart 1.12.1 [collection freezed_annotation html http http_parser json_annotation meta xml]

dev dependencies:
- build_runner 2.2.1 [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]
- dart_code_metrics 4.19.1 [analyzer analyzer_plugin ansicolor args collection crypto file glob html meta path source_span xml yaml]
- flutter_lints 2.0.1 [lints]
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph]
- freezed 2.1.0+1 [analyzer build build_config collection meta source_gen freezed_annotation json_annotation]
- intl_utils 2.7.0 [analyzer archive args dart_style http intl path petitparser yaml]
- json_serializable 6.3.1 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper]

dependency overrides:
- json_annotation 4.6.0 [meta]

transitive dependencies:
- _fe_analyzer_shared 47.0.0 [meta]
- _flutterfire_internals 1.0.1 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
- analyzer 4.7.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- analyzer_plugin 0.10.0 [analyzer collection dart_style pub_semver yaml]
- ansicolor 2.0.1
- archive 3.3.1 [crypto path]
- args 2.3.1
- boolean_selector 2.1.0 [source_span string_scanner]
- build 2.3.1 [analyzer async convert crypto glob logging meta path]
- build_config 1.1.0 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 3.1.0 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 2.0.10 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml]
- build_runner_core 7.2.4 [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.1 [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]
- checked_yaml 2.0.1 [json_annotation source_span yaml]
- cloud_firestore_platform_interface 5.7.6 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- cloud_firestore_web 2.8.9 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js]
- cloud_functions_platform_interface 5.1.18 [firebase_core flutter meta plugin_platform_interface]
- cloud_functions_web 4.3.7 [cloud_functions_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js]
- code_builder 4.3.0 [built_collection built_value collection matcher meta]
- connectivity_plus_linux 1.3.1 [flutter connectivity_plus_platform_interface meta nm]
- connectivity_plus_macos 1.2.4 [connectivity_plus_platform_interface flutter]
- connectivity_plus_platform_interface 1.2.1 [flutter meta plugin_platform_interface]
- connectivity_plus_web 1.2.4 [connectivity_plus_platform_interface flutter_web_plugins flutter js]
- connectivity_plus_windows 1.2.2 [connectivity_plus_platform_interface flutter]
- convert 3.0.2 [typed_data]
- cross_file 0.3.3+2 [js meta]
- csslib 0.17.2 [source_span]
- cupertino_icons 1.0.5
- dart_style 2.2.4 [analyzer args path pub_semver source_span]
- dbus 0.7.8 [args ffi meta xml]
- diffutil_dart 3.0.0
- dio 4.0.6 [http_parser path]
- fake_async 1.3.1 [clock collection]
- ffi 2.0.1
- file 6.1.4 [meta path]
- firebase 9.0.3 [http http_parser js]
- firebase_analytics_platform_interface 3.3.6 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_analytics_web 0.4.2+6 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js]
- firebase_auth_platform_interface 6.10.0 [collection firebase_core flutter meta plugin_platform_interface]
- firebase_auth_web 4.6.0 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta]
- firebase_core_platform_interface 4.5.1 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 1.7.3 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_crashlytics_platform_interface 3.2.18 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_dynamic_links_platform_interface 0.2.3+14 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_platform_interface 4.1.6 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 3.1.6 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta]
- firebase_performance_platform_interface 0.1.1+18 [_flutterfire_internals firebase_core flutter plugin_platform_interface]
- firebase_performance_web 0.1.1+7 [_flutterfire_internals firebase firebase_core firebase_core_web firebase_performance_platform_interface flutter flutter_web_plugins js]
- firebase_storage_platform_interface 4.1.18 [collection firebase_core flutter meta plugin_platform_interface]
- firebase_storage_web 3.3.8 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta]
- fixnum 1.0.1
- flutter_blurhash 0.7.0 [flutter]
- flutter_link_previewer 3.0.1 [flutter flutter_chat_types flutter_linkify html http linkify meta url_launcher]
- flutter_local_notifications_linux 1.0.0 [flutter flutter_local_notifications_platform_interface dbus path xdg_directories]
- flutter_local_notifications_platform_interface 6.0.0 [flutter plugin_platform_interface]
- flutter_parsed_text 2.2.1 [flutter]
- flutter_plugin_android_lifecycle 2.0.7 [flutter]
- flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math]
- flutter_widget_from_html_core 0.8.5+3 [csslib flutter fwfh_text_style html]
- frontend_server_client 2.1.3 [async path]
- fwfh_text_style 2.22.08+1 [flutter]
- geolocator_android 4.1.3 [flutter geolocator_platform_interface]
- geolocator_apple 2.2.2 [flutter geolocator_platform_interface]
- geolocator_platform_interface 4.0.6 [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.0 [async collection file path string_scanner]
- google_sign_in_android 6.1.1 [flutter google_sign_in_platform_interface]
- google_sign_in_ios 5.5.0 [flutter google_sign_in_platform_interface]
- google_sign_in_platform_interface 2.3.0 [flutter plugin_platform_interface quiver]
- google_sign_in_web 0.10.2 [flutter flutter_web_plugins google_sign_in_platform_interface js]
- graphs 2.1.0 [collection]
- html 0.15.0 [csslib source_span]
- http 0.13.5 [async http_parser meta path]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.1 [collection source_span string_scanner typed_data]
- image_cropper_for_web 1.0.2 [flutter flutter_web_plugins image_cropper_platform_interface js]
- image_cropper_platform_interface 3.0.2 [flutter plugin_platform_interface http]
- image_picker_android 0.8.5+3 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface]
- image_picker_for_web 2.1.10 [flutter flutter_web_plugins image_picker_platform_interface]
- image_picker_ios 0.8.6+1 [flutter image_picker_platform_interface]
- image_picker_platform_interface 2.6.2 [cross_file flutter http plugin_platform_interface]
- in_app_review_platform_interface 2.0.4 [flutter url_launcher plugin_platform_interface platform]
- io 1.0.3 [meta path string_scanner]
- js 0.6.4
- linkify 4.1.0
- lints 2.0.0
- logging 1.0.2
- matcher 0.12.12 [stack_trace]
- material_color_utilities 0.1.5
- meta 1.8.0
- mime 1.0.2
- nm 0.5.0 [dbus]
- octo_image 1.0.2 [flutter flutter_blurhash]
- package_config 2.1.0 [path]
- package_info_plus_linux 1.0.5 [package_info_plus_platform_interface flutter path]
- package_info_plus_macos 1.3.0 [flutter]
- package_info_plus_platform_interface 1.0.2 [flutter meta plugin_platform_interface]
- package_info_plus_web 1.0.5 [flutter flutter_web_plugins http meta package_info_plus_platform_interface]
- package_info_plus_windows 2.1.0 [package_info_plus_platform_interface ffi flutter win32]
- 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 2.0.11 [flutter path_provider_android path_provider_ios path_provider_linux path_provider_macos path_provider_platform_interface path_provider_windows]
- path_provider_android 2.0.20 [flutter path_provider_platform_interface]
- path_provider_ios 2.0.11 [flutter path_provider_platform_interface]
- path_provider_linux 2.1.7 [ffi flutter path path_provider_platform_interface xdg_directories]
- path_provider_macos 2.0.6 [flutter path_provider_platform_interface]
- path_provider_platform_interface 2.0.5 [flutter platform plugin_platform_interface]
- path_provider_windows 2.1.3 [ffi flutter path path_provider_platform_interface win32]
- pedantic 1.11.1
- permission_handler_android 10.0.0 [flutter permission_handler_platform_interface]
- permission_handler_apple 9.0.4 [flutter permission_handler_platform_interface]
- permission_handler_platform_interface 3.8.0 [flutter meta plugin_platform_interface]
- permission_handler_windows 0.1.0 [flutter permission_handler_platform_interface]
- petitparser 5.0.0 [meta]
- photo_view 0.14.0 [flutter]
- platform 3.1.0
- plugin_platform_interface 2.1.3 [meta]
- pool 1.5.1 [async stack_trace]
- process 4.2.4 [file path platform]
- pub_semver 2.1.1 [collection meta]
- pubspec_parse 1.2.1 [checked_yaml collection json_annotation pub_semver yaml]
- quiver 3.1.0 [matcher]
- rational 2.2.0
- share_plus_linux 3.0.0 [share_plus_platform_interface file flutter meta url_launcher]
- share_plus_macos 3.0.1 [share_plus_platform_interface flutter]
- share_plus_platform_interface 3.0.3 [flutter meta mime plugin_platform_interface]
- share_plus_web 3.0.1 [share_plus_platform_interface url_launcher flutter flutter_web_plugins meta]
- share_plus_windows 3.0.1 [share_plus_platform_interface flutter meta url_launcher]
- shared_preferences 2.0.15 [flutter shared_preferences_android shared_preferences_ios shared_preferences_linux shared_preferences_macos shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
- shared_preferences_android 2.0.13 [flutter shared_preferences_platform_interface]
- shared_preferences_ios 2.1.1 [flutter shared_preferences_platform_interface]
- shared_preferences_linux 2.1.1 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface]
- shared_preferences_macos 2.0.4 [flutter shared_preferences_platform_interface]
- shared_preferences_platform_interface 2.1.0 [flutter plugin_platform_interface]
- shared_preferences_web 2.0.4 [flutter flutter_web_plugins shared_preferences_platform_interface]
- shared_preferences_windows 2.1.1 [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.2 [shelf stream_channel web_socket_channel]
- sky_engine 0.0.99
- source_gen 1.2.5 [analyzer async build dart_style glob meta path source_span yaml]
- source_helper 1.3.3 [analyzer collection source_gen]
- source_span 1.9.0 [collection path term_glyph]
- sqflite 2.1.0 [flutter sqflite_common path]
- sqflite_common 2.3.0 [synchronized path meta]
- stack_trace 1.10.0 [path]
- stream_channel 2.1.0 [async]
- stream_transform 2.0.0
- string_scanner 1.1.1 [source_span]
- synchronized 3.0.0+3
- term_glyph 1.2.1
- test_api 0.4.12 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- timing 1.0.0 [json_annotation]
- typed_data 1.3.1 [collection]
- url_launcher_android 6.0.19 [flutter url_launcher_platform_interface]
- url_launcher_ios 6.0.17 [flutter url_launcher_platform_interface]
- url_launcher_linux 3.0.1 [flutter url_launcher_platform_interface]
- url_launcher_macos 3.0.1 [flutter url_launcher_platform_interface]
- url_launcher_platform_interface 2.1.1 [flutter plugin_platform_interface]
- url_launcher_web 2.0.13 [flutter flutter_web_plugins url_launcher_platform_interface]
- url_launcher_windows 3.0.1 [flutter url_launcher_platform_interface]
- vector_math 2.1.2
- visibility_detector 0.3.3 [flutter]
- wakelock_macos 0.4.0 [flutter flutter_web_plugins wakelock_platform_interface]
- wakelock_platform_interface 0.3.0 [flutter meta]
- wakelock_web 0.4.0 [flutter flutter_web_plugins js wakelock_platform_interface]
- wakelock_windows 0.2.1 [flutter wakelock_platform_interface win32]
- watcher 1.0.1 [async path]
- web_socket_channel 2.2.0 [async crypto stream_channel]
- win32 3.0.0 [ffi]
- xdg_directories 0.2.0+2 [meta path process]
- xml 6.1.0 [collection meta petitparser]
- yaml 3.1.1 [collection source_span string_scanner]

@felixgabler felixgabler added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Sep 29, 2022
@nkndy
Copy link

nkndy commented Sep 30, 2022

👍 - Also seeing the same issue and the same error.

One other test note: After app restart the auth object is valid and available. ie the auth user then exists in our app state on next restart. So crash occurs after successful login. Crash is critical closes app completely, doesn't just hang. Closing the dialog and not attempting to login does not crash.

@darshankawar darshankawar added the triage Issue is currently being triaged. label Sep 30, 2022
@darshankawar
Copy link

Thanks for the report @felixgabler
Using the code sample provided, I am able to replicate this issue using latest plugin version and on stable version (3.3.3) which throws below error log:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[3]'
*** First throw call stack:
(0x182549d3c 0x1998c36a8 0x182642940 0x18264cb58 0x182509bec 0x182526f7c 0x104393c64 0x104393678 0x104387afc 0x10438a668 0x10438a70c 0x104d99124 0x1822151a4 0x1822161a8 0x1821c25e0 0x182505888 0x1824c3188 0x1824d5e1c 0x1a28549a0 0x184d09b90 0x184a9f16c 0x1043783e0 0x1047b4250)
libc++abi: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001bc6519e8 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
->  0x1bc6519e8 <+8>:  b.lo   0x1bc651a04               ; <+36>
    0x1bc6519ec <+12>: stp    x29, x30, [sp, #-0x10]!
    0x1bc6519f0 <+16>: mov    x29, sp
    0x1bc6519f4 <+20>: bl     0x1bc64d670               ; cerror_nocancel
Target 0: (Runner) stopped.
Lost connection to device.

Also verified using previous plugin version (3.10.0) and replicates.

@darshankawar darshankawar added plugin: auth platform: ios Issues / PRs which are specifically for iOS. type: crash A compile error or crash and removed Needs Attention This issue needs maintainer attention. triage Issue is currently being triaged. labels Sep 30, 2022
@darshankawar
Copy link

/cc @Lyokone

@briouyaasmae
Copy link

if you need a solution right now and it's urgent to work with apple sign in you can use firebase_auth: 3.9.0 it works perfectly

@Lyokone Lyokone self-assigned this Sep 30, 2022
@Lyokone
Copy link
Contributor

Lyokone commented Sep 30, 2022

Thanks for the report, I'm looking into this

@felixgabler
Copy link
Author

if you need a solution right now and it's urgent to work with apple sign in you can use firebase_auth: 3.9.0 it works perfectly

Does it also correctly return name and email according to the scopes? That's also a major blocker for us

@Lyokone
Copy link
Contributor

Lyokone commented Sep 30, 2022

@felixgabler If I'm not mistaken, for security reasons, Apple returns the Name and the Email only on the first sign-in, if you don't catch them at this time, you cannot retrieve them again. Might need to double-check that, but please open another PR concerning this issue.

@briouyaasmae
Copy link

@felixgabler If I'm not mistaken, for security reasons, Apple returns the Name and the Email only on the first sign-in, if you don't catch them at this time, you cannot retrieve them again. Might need to double-check that, but please open another PR concerning this issue.

yes it returns only for first sign-in

@briouyaasmae
Copy link

if you need a solution right now and it's urgent to work with apple sign in you can use firebase_auth: 3.9.0 it works perfectly

Does it also correctly return name and email according to the scopes? That's also a major blocker for us

yes it does, but to mention for apple it returns email and fullname only in first sign in after that it returns null, so you should store them in secure storage if you want to reuse them

@felixgabler
Copy link
Author

felixgabler commented Sep 30, 2022

@felixgabler If I'm not mistaken, for security reasons, Apple returns the Name and the Email only on the first sign-in, if you don't catch them at this time, you cannot retrieve them again. Might need to double-check that, but please open another PR concerning this issue.

yes it returns only for first sign-in

Thanks for looking into it again! I know that it doesn't work on subsequent logins but normally it works when I disconnect my apple ID in the apple ID settings (https://appleid.apple.com/account/manage). For example, it does work with sign in with apple on Android.

I was just curious whether you know if it broke somewhere between these versions.

Will open another issue later.

@Lyokone
Copy link
Contributor

Lyokone commented Sep 30, 2022

I've opened #9644 that fixes the issue, will probably be merged and released early next week

@GeylanKalafMohe
Copy link

This need to be fixed as soon as possible! It's very urgent.

@GeylanKalafMohe
Copy link

if you need a solution right now and it's urgent to work with apple sign in you can use firebase_auth: 3.9.0 it works perfectly

Does not work, unfortunately. Still crashes!

@darshankawar darshankawar added the resolution: fixed A fix has been merged or is pending merge from a PR. label Oct 3, 2022
@Lyokone
Copy link
Contributor

Lyokone commented Oct 3, 2022

The fix was released in v3.11.1 thanks for your patience.

@firebase firebase locked and limited conversation to collaborators Nov 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: ios Issues / PRs which are specifically for iOS. plugin: auth resolution: fixed A fix has been merged or is pending merge from a PR. type: bug Something isn't working type: crash A compile error or crash
Projects
None yet
6 participants