firebase / FirebaseUI-Flutter

Apache License 2.0
91 stars 79 forks source link

🐛 [iOS]. Google Sign In not Working #110

Closed nickf2k closed 9 months ago

nickf2k commented 9 months ago

Is there an existing issue for this?

What plugin is this bug for?

Firebase UI Auth, Firebase UI OAuth Google

What platform(s) does this bug affect?

iOS

List of dependencies used.

flutter pub deps -s list
Dart SDK 3.1.2
Flutter SDK 3.13.4
ncvc_app 1.0.0+1

dependencies:
- flutter 0.0.0
  - characters 1.3.0
  - collection 1.17.2
  - material_color_utilities 0.5.0
  - meta 1.9.1
  - vector_math 2.1.4
  - web 0.1.4-beta
  - sky_engine any
- cupertino_icons 1.0.6
- firebase_core 2.15.1
  - firebase_core_platform_interface ^4.8.0
  - firebase_core_web ^2.7.0
  - flutter any
  - meta ^1.8.0
- go_router 10.1.2
  - collection ^1.15.0
  - flutter any
  - flutter_web_plugins any
  - logging ^1.0.0
  - meta ^1.7.0
- firebase_auth 4.9.0
  - firebase_auth_platform_interface ^6.18.0
  - firebase_auth_web ^5.8.0
  - firebase_core ^2.15.1
  - firebase_core_platform_interface ^4.8.0
  - flutter any
  - meta ^1.8.0
- firebase_ui_auth 1.8.0
  - email_validator ^2.1.17
  - firebase_auth ^4.9.0
  - firebase_core ^2.15.1
  - firebase_dynamic_links ^5.3.4
  - firebase_ui_localizations ^1.6.1
  - firebase_ui_oauth ^1.4.11
  - firebase_ui_shared ^1.3.1
  - flutter any
  - flutter_localizations any
- google_fonts 5.1.0
  - flutter any
  - http ^1.0.0
  - path_provider ^2.0.0
  - crypto ^3.0.0
- flutter_native_splash 2.3.2
  - args ^2.4.2
  - flutter any
  - flutter_web_plugins any
  - js ^0.6.7
  - html ^0.15.4
  - image ^4.0.17
  - meta ^1.9.1
  - path ^1.8.3
  - universal_io ^2.2.2
  - xml ^6.3.0
  - yaml ^3.1.2
- get_it 7.6.4
  - async ^2.11.0
  - collection ^1.17.1
- dartz 0.10.1
- flutter_bloc 8.1.3
  - bloc ^8.1.1
  - flutter any
  - provider ^6.0.0
- path_provider 2.1.1
  - flutter any
  - path_provider_android ^2.1.0
  - path_provider_foundation ^2.3.0
  - path_provider_linux ^2.2.0
  - path_provider_platform_interface ^2.1.0
  - path_provider_windows ^2.2.0
- equatable 2.0.5
  - collection ^1.15.0
  - meta ^1.3.0
- firebase_ui_oauth_google 1.2.11
  - firebase_auth ^4.9.0
  - firebase_ui_oauth ^1.4.11
  - flutter any
  - google_sign_in ^6.1.0
- google_sign_in 6.1.5
  - flutter any
  - google_sign_in_android ^6.1.0
  - google_sign_in_ios ^5.5.0
  - google_sign_in_platform_interface ^2.4.0
  - google_sign_in_web ^0.12.0

dev dependencies:
- flutter_test 0.0.0
  - flutter any
  - test_api 0.6.0
  - matcher 0.12.16
  - path 1.8.3
  - fake_async 1.3.1
  - clock 1.1.1
  - stack_trace 1.11.0
  - vector_math 2.1.4
  - async 2.11.0
  - boolean_selector 2.1.1
  - characters 1.3.0
  - collection 1.17.2
  - material_color_utilities 0.5.0
  - meta 1.9.1
  - source_span 1.10.0
  - stream_channel 2.1.1
  - string_scanner 1.2.0
  - term_glyph 1.2.1
  - web 0.1.4-beta
- flutter_lints 2.0.3
  - lints ^2.0.0
- hive_generator 2.0.1
  - build ^2.0.0
  - source_gen ^1.0.0
  - hive ^2.0.4
  - analyzer >=4.6.0 <7.0.0
  - source_helper ^1.1.0
- build_runner 2.4.6
  - analyzer >=4.4.0 <7.0.0
  - args ^2.0.0
  - async ^2.5.0
  - build >=2.1.0 <2.5.0
  - build_config >=1.1.0 <1.2.0
  - build_daemon ^4.0.0
  - build_resolvers ^2.0.0
  - build_runner_core ^7.2.0
  - code_builder ^4.2.0
  - collection ^1.15.0
  - crypto ^3.0.0
  - dart_style ^2.0.0
  - frontend_server_client ^3.0.0
  - glob ^2.0.0
  - graphs ^2.2.0
  - http_multi_server ^3.0.0
  - io ^1.0.0
  - js ^0.6.3
  - logging ^1.0.0
  - meta ^1.3.0
  - mime ^1.0.0
  - package_config ^2.0.0
  - path ^1.8.0
  - pool ^1.5.0
  - pub_semver ^2.0.0
  - pubspec_parse ^1.0.0
  - shelf ^1.0.0
  - shelf_web_socket ^1.0.0
  - stack_trace ^1.10.0
  - stream_transform ^2.0.0
  - timing ^1.0.0
  - watcher ^1.0.0
  - web_socket_channel ^2.0.0
  - yaml ^3.0.0
- freezed 2.4.2
  - analyzer ^6.0.0
  - build ^2.3.1
  - build_config ^1.1.0
  - collection ^1.15.0
  - meta ^1.9.1
  - source_gen ^1.2.3
  - freezed_annotation ^2.4.1
  - json_annotation ^4.6.0
- json_serializable 6.7.1
  - analyzer >=5.12.0 <7.0.0
  - async ^2.8.0
  - build ^2.0.0
  - build_config >=0.4.4 <2.0.0
  - collection ^1.14.0
  - json_annotation >=4.8.1 <4.9.0
  - meta ^1.3.0
  - path ^1.8.0
  - pub_semver ^2.0.0
  - pubspec_parse ^1.0.0
  - source_gen ^1.3.2
  - source_helper ^1.3.0
- flutter_launcher_icons 0.13.1
  - args ^2.3.2
  - checked_yaml ^2.0.2
  - cli_util ^0.4.0
  - image ^4.0.15
  - json_annotation ^4.8.0
  - path ^1.8.2
  - yaml ^3.1.1

transitive dependencies:
- _fe_analyzer_shared 64.0.0
  - meta ^1.9.0
- _flutterfire_internals 1.3.5
  - collection ^1.0.0
  - firebase_core ^2.15.1
  - firebase_core_platform_interface ^4.8.0
  - flutter any
  - meta ^1.8.0
- analyzer 6.2.0
  - _fe_analyzer_shared ^64.0.0
  - collection ^1.17.0
  - convert ^3.0.0
  - crypto ^3.0.0
  - glob ^2.0.0
  - meta ^1.7.0
  - package_config ^2.0.0
  - path ^1.8.0
  - pub_semver ^2.0.0
  - source_span ^1.8.0
  - watcher ^1.0.0
  - yaml ^3.0.0
- archive 3.3.9
  - crypto ^3.0.0
  - path ^1.8.0
  - pointycastle ^3.6.2
- args 2.4.2
- async 2.11.0
  - collection ^1.15.0
  - meta ^1.1.7
- bloc 8.1.2
  - meta ^1.3.0
- boolean_selector 2.1.1
  - source_span ^1.8.0
  - string_scanner ^1.1.0
- build 2.4.1
  - analyzer >=1.5.0 <7.0.0
  - async ^2.5.0
  - convert ^3.0.0
  - crypto ^3.0.0
  - glob ^2.0.0
  - logging ^1.0.0
  - meta ^1.3.0
  - package_config ^2.1.0
  - path ^1.8.0
- build_config 1.1.1
  - checked_yaml ^2.0.0
  - json_annotation ^4.5.0
  - path ^1.8.0
  - pubspec_parse ^1.0.0
  - yaml ^3.0.0
- build_daemon 4.0.0
  - built_collection ^5.0.0
  - built_value ^8.1.0
  - http_multi_server ^3.0.0
  - logging ^1.0.0
  - path ^1.8.0
  - pool ^1.5.0
  - shelf ^1.0.0
  - shelf_web_socket ^1.0.0
  - stream_transform ^2.0.0
  - watcher ^1.0.0
  - web_socket_channel ^2.0.0
- build_resolvers 2.3.2
  - analyzer >=5.12.0 <7.0.0
  - async ^2.5.0
  - build ^2.0.0
  - collection ^1.17.0
  - convert ^3.1.1
  - crypto ^3.0.0
  - graphs >=1.0.0 <3.0.0
  - logging ^1.0.0
  - package_config ^2.0.0
  - path ^1.8.0
  - pool ^1.5.0
  - pub_semver ^2.0.0
  - stream_transform ^2.0.0
  - yaml ^3.0.0
- build_runner_core 7.2.10
  - async ^2.5.0
  - build ^2.4.0
  - build_config ^1.0.0
  - build_resolvers ^2.0.0
  - collection ^1.15.0
  - convert ^3.0.0
  - crypto ^3.0.0
  - glob ^2.0.0
  - graphs ^2.0.0
  - json_annotation ^4.8.1
  - logging ^1.2.0
  - meta ^1.3.0
  - package_config ^2.0.0
  - path ^1.8.0
  - pool ^1.5.0
  - timing ^1.0.0
  - watcher ^1.0.0
  - yaml ^3.0.0
- built_collection 5.1.1
- built_value 8.6.2
  - built_collection ^5.0.0
  - collection ^1.15.0
  - fixnum ^1.0.0
  - meta ^1.3.0
- characters 1.3.0
- checked_yaml 2.0.3
  - json_annotation ^4.3.0
  - source_span ^1.8.0
  - yaml ^3.0.0
- cli_util 0.4.0
  - meta ^1.3.0
  - path ^1.8.0
- clock 1.1.1
- code_builder 4.6.0
  - built_collection ^5.0.0
  - built_value ^8.0.0
  - collection ^1.15.0
  - matcher ^0.12.10
  - meta ^1.3.0
- collection 1.17.2
- convert 3.1.1
  - typed_data ^1.3.0
- crypto 3.0.3
  - typed_data ^1.3.0
- csslib 1.0.0
  - source_span ^1.8.0
- dart_style 2.3.3
  - analyzer ^6.2.0
  - args >=1.0.0 <3.0.0
  - path ^1.0.0
  - pub_semver >=1.4.4 <3.0.0
  - source_span ^1.4.0
- desktop_webview_auth 0.0.13
  - crypto ^3.0.3
  - flutter any
  - http ^1.0.0
  - flutter_web_plugins any
  - plugin_platform_interface ^2.1.4
- email_validator 2.1.17
- fake_async 1.3.1
  - clock ^1.1.0
  - collection ^1.15.0
- ffi 2.1.0
- file 7.0.0
  - meta ^1.9.1
  - path ^1.8.3
- firebase_auth_platform_interface 6.18.0
  - _flutterfire_internals ^1.3.5
  - collection ^1.16.0
  - firebase_core ^2.15.1
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_auth_web 5.8.0
  - firebase_auth_platform_interface ^6.18.0
  - firebase_core ^2.15.1
  - firebase_core_web ^2.7.0
  - flutter any
  - flutter_web_plugins any
  - http_parser ^4.0.0
  - js ^0.6.3
  - meta ^1.8.0
- firebase_core_platform_interface 4.8.0
  - collection ^1.0.0
  - flutter any
  - flutter_test any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_core_web 2.7.0
  - firebase_core_platform_interface ^4.8.0
  - flutter any
  - flutter_web_plugins any
  - js ^0.6.3
  - meta ^1.8.0
- firebase_dynamic_links 5.3.5
  - firebase_core ^2.15.1
  - firebase_core_platform_interface ^4.8.0
  - firebase_dynamic_links_platform_interface ^0.2.6+5
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_dynamic_links_platform_interface 0.2.6+5
  - _flutterfire_internals ^1.3.5
  - firebase_core ^2.15.1
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_ui_localizations 1.6.1
  - flutter any
  - flutter_localizations any
  - path ^1.8.2
- firebase_ui_oauth 1.4.11
  - desktop_webview_auth ^0.0.13
  - firebase_auth ^4.9.0
  - firebase_ui_auth ^1.8.0
  - firebase_ui_shared ^1.3.1
  - flutter_svg ^2.0.7
  - flutter any
- firebase_ui_shared 1.3.1
  - flutter any
- fixnum 1.1.0
- flutter_localizations 0.0.0
  - flutter any
  - intl 0.18.1
  - characters 1.3.0
  - clock 1.1.1
  - collection 1.17.2
  - material_color_utilities 0.5.0
  - meta 1.9.1
  - path 1.8.3
  - vector_math 2.1.4
  - web 0.1.4-beta
- flutter_svg 2.0.7
  - flutter any
  - vector_graphics ^1.1.7
  - vector_graphics_codec ^1.1.7
  - vector_graphics_compiler ^1.1.7
- flutter_web_plugins 0.0.0
  - flutter any
  - characters 1.3.0
  - collection 1.17.2
  - material_color_utilities 0.5.0
  - meta 1.9.1
  - vector_math 2.1.4
  - web 0.1.4-beta
- freezed_annotation 2.4.1
  - collection ^1.15.0
  - json_annotation ^4.6.0
  - meta ^1.7.0
- frontend_server_client 3.2.0
  - async ^2.5.0
  - path ^1.8.0
- glob 2.1.2
  - async ^2.5.0
  - collection ^1.15.0
  - file >=6.1.3 <8.0.0
  - path ^1.8.0
  - string_scanner ^1.1.0
- google_identity_services_web 0.2.1+1
  - js ^0.6.4
  - meta ^1.3.0
- google_sign_in_android 6.1.19
  - flutter any
  - google_sign_in_platform_interface ^2.2.0
- google_sign_in_ios 5.6.3
  - flutter any
  - google_sign_in_platform_interface ^2.2.0
- google_sign_in_platform_interface 2.4.2
  - flutter any
  - plugin_platform_interface ^2.1.0
  - quiver ^3.0.0
- google_sign_in_web 0.12.0+4
  - flutter any
  - flutter_web_plugins any
  - google_identity_services_web ^0.2.1
  - google_sign_in_platform_interface ^2.4.0
  - http >=0.13.0 <2.0.0
  - js ^0.6.3
- graphs 2.3.1
  - collection ^1.1.0
- hive 2.2.3
  - meta ^1.3.0
  - crypto ^3.0.0
- html 0.15.4
  - csslib >=0.17.0 <2.0.0
  - source_span ^1.8.0
- http 1.1.0
  - async ^2.5.0
  - http_parser ^4.0.0
  - meta ^1.3.0
- http_multi_server 3.2.1
  - async ^2.5.0
- http_parser 4.0.2
  - collection ^1.15.0
  - source_span ^1.8.0
  - string_scanner ^1.1.0
  - typed_data ^1.3.0
- image 4.0.17
  - archive ^3.1.2
  - meta ^1.3.0
  - xml ^6.0.1
- intl 0.18.1
  - clock ^1.1.0
  - meta ^1.0.2
  - path ^1.8.0
- io 1.0.4
  - meta ^1.3.0
  - path ^1.8.0
  - string_scanner ^1.1.0
- js 0.6.7
  - meta ^1.7.0
- json_annotation 4.8.1
  - meta ^1.4.0
- lints 2.1.1
- logging 1.2.0
- matcher 0.12.16
  - async ^2.10.0
  - meta ^1.8.0
  - stack_trace ^1.10.0
  - term_glyph ^1.2.0
  - test_api >=0.5.0 <0.7.0
- material_color_utilities 0.5.0
  - collection ^1.15.0
- meta 1.9.1
- mime 1.0.4
- nested 1.0.0
  - flutter any
- package_config 2.1.0
  - path ^1.8.0
- path 1.8.3
- path_parsing 1.0.1
  - vector_math ^2.1.0
  - meta ^1.3.0
- path_provider_android 2.2.0
  - flutter any
  - path_provider_platform_interface ^2.1.0
- path_provider_foundation 2.3.1
  - flutter any
  - path_provider_platform_interface ^2.1.0
- path_provider_linux 2.2.1
  - ffi >=1.1.2 <3.0.0
  - flutter any
  - path ^1.8.0
  - path_provider_platform_interface ^2.1.0
  - xdg_directories >=0.2.0 <2.0.0
- path_provider_platform_interface 2.1.1
  - flutter any
  - platform ^3.0.0
  - plugin_platform_interface ^2.1.0
- path_provider_windows 2.2.1
  - ffi ^2.0.0
  - flutter any
  - path ^1.8.0
  - path_provider_platform_interface ^2.1.0
  - win32 >=2.1.0 <6.0.0
- petitparser 5.4.0
  - meta ^1.9.0
- platform 3.1.2
- plugin_platform_interface 2.1.6
  - meta ^1.3.0
- pointycastle 3.7.3
  - collection ^1.15.0
  - convert ^3.0.0
  - js ^0.6.3
- pool 1.5.1
  - async ^2.5.0
  - stack_trace ^1.10.0
- provider 6.0.5
  - collection ^1.15.0
  - flutter any
  - nested ^1.0.0
- pub_semver 2.1.4
  - collection ^1.15.0
  - meta ^1.3.0
- pubspec_parse 1.2.3
  - checked_yaml ^2.0.1
  - collection ^1.15.0
  - json_annotation ^4.8.0
  - pub_semver ^2.0.0
  - yaml ^3.0.0
- quiver 3.2.1
  - matcher ^0.12.10
- shelf 1.4.1
  - async ^2.5.0
  - collection ^1.15.0
  - http_parser ^4.0.0
  - path ^1.8.0
  - stack_trace ^1.10.0
  - stream_channel ^2.1.0
- shelf_web_socket 1.0.4
  - shelf ^1.1.0
  - stream_channel ^2.1.0
  - web_socket_channel ^2.0.0
- sky_engine 0.0.99
- source_gen 1.4.0
  - analyzer >=5.2.0 <7.0.0
  - async ^2.5.0
  - build ^2.1.0
  - dart_style ^2.0.0
  - glob ^2.0.0
  - path ^1.8.0
  - source_span ^1.8.0
  - yaml ^3.0.0
- source_helper 1.3.4
  - analyzer >=5.12.0 <7.0.0
  - collection ^1.15.0
  - source_gen ^1.0.0
- source_span 1.10.0
  - collection ^1.15.0
  - path ^1.8.0
  - term_glyph ^1.2.0
- stack_trace 1.11.0
  - path ^1.8.0
- stream_channel 2.1.1
  - async ^2.5.0
- stream_transform 2.1.0
- string_scanner 1.2.0
  - source_span ^1.8.0
- term_glyph 1.2.1
- test_api 0.6.0
  - async ^2.5.0
  - boolean_selector ^2.1.0
  - collection ^1.15.0
  - meta ^1.3.0
  - source_span ^1.8.0
  - stack_trace ^1.10.0
  - stream_channel ^2.1.0
  - string_scanner ^1.1.0
  - term_glyph ^1.2.0
- timing 1.0.1
  - json_annotation ^4.3.0
- typed_data 1.3.2
  - collection ^1.15.0
- universal_io 2.2.2
  - collection ^1.17.0
  - meta ^1.9.0
  - typed_data ^1.3.0
- vector_graphics 1.1.7
  - flutter any
  - vector_graphics_codec 1.1.7
- vector_graphics_codec 1.1.7
- vector_graphics_compiler 1.1.7
  - args ^2.3.0
  - meta ^1.7.0
  - path_parsing ^1.0.1
  - xml ^6.3.0
  - vector_graphics_codec 1.1.7
- vector_math 2.1.4
- watcher 1.1.0
  - async ^2.5.0
  - path ^1.8.0
- web 0.1.4-beta
- web_socket_channel 2.4.0
  - async ^2.5.0
  - crypto ^3.0.0
  - stream_channel ^2.1.0
- win32 5.0.7
  - ffi ^2.1.0
- xdg_directories 1.0.3
  - meta ^1.3.0
  - path ^1.8.0
- xml 6.3.0
  - collection ^1.17.0
  - meta ^1.9.0
  - petitparser ^5.4.0
- yaml 3.1.2
  - collection ^1.15.0
  - source_span ^1.8.0
  - string_scanner ^1.1.0

Steps to reproduce

  1. create main.dart
    
    void main() async {
    WidgetsFlutterBinding.ensureInitialized();
    // FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
    await initDependencies();
    await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
    FirebaseUIAuth.configureProviders([
    EmailAuthProvider(),
    GoogleProvider(
        clientId: googleClientId,
        redirectUri: 'https://ncvc-app.firebaseapp.com/__/auth/handler'),
    ]);
    runApp(const MyApp());
    }

class MyApp extends StatelessWidget { const MyApp({super.key});

// This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp.router( title: 'Flutter Demo', theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), useMaterial3: true, ), routerConfig: AppRouter.router, // home: const MyHomePage(title: 'Flutter Demo Home Page'), ); } }


2. then setting up for router using go_router to navigate to Login Screen

class LoginScreen extends StatelessWidget { const LoginScreen({Key? key}) : super(key: key);

@override Widget build(BuildContext context) { return Scaffold( body: SignInScreen( showAuthActionSwitch: true, actions: [ AuthStateChangeAction((context, state) { final user = switch (state) { SignedIn(user: final user) => user, CredentialLinked(user: final user) => user, UserCreated(credential: final cred) => cred.user, _ => null, };

        switch (user) {
          case User(emailVerified: true):
            context.go(AppPage.home.toPath);
          case User(emailVerified: false, email: final String _):
            context.go(AppPage.home.toPath);
        }
      }),
      ForgotPasswordAction((context, email) {}),
    ],
  ),
);

} }

3. run app with iOS Simulator
4. tap Sign in with Google
NOTE: Sign in with Google still work with Android emulator

### Expected Behavior

Sign in with Google work

### Actual Behavior

App crash, i got an error:

Lost connection to device. Failed to send request: {"jsonrpc":"2.0","id":"109","method":"resume","params":{"isolateId":"isolates/3700648802678399"}} Failed to send request: {"jsonrpc":"2.0","id":"110","method":"invoke","params":{"isolateId":"isolates/3700648802678399","targetId":"objects/199","selector":"toString","argumentIds":[],"disableBreakpoints":true}} Failed to send request: {"jsonrpc":"2.0","id":"111","method":"invoke","params":{"isolateId":"isolates/3700648802678399","targetId":"objects/200","selector":"toString","argumentIds":[],"disableBreakpoints":true}}



### Additional Information

_No response_
nickf2k commented 9 months ago

After 3 hours, I tried the solution in this article and it worked. https://stackoverflow.com/questions/42197729/app-getting-crash-when-click-on-googlesignin-button thanks for reading

thefirebanks commented 9 months ago

@nickf2k I tried the solution in that link and I'm still running into the issue. What exactly did you end up adding to Info.plist?

thefirebanks commented 9 months ago

My personal issue is that the app crashes but doesn't give ANY error message, so I don't know how to debug it... I tried:

But no result...