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.71k stars 3.97k forks source link

šŸ› [firebase_messaging] An unknown error has occured on IOS #7251

Closed ShejaEddy closed 3 years ago

ShejaEddy commented 3 years ago

Bug report

Describe the bug Everything was working fine before and was deployed a week ago but now firebase can't seem to create a new token. I'm trying to call await FirebaseMessaging.instance.getToken(); I'm using the latest version, firebase_messageing: 10.0.9 I even tried to roll back to other versions but still getting the same error.

I have less users, <=10 users. There is no way I'm making too many requests.

Steps to reproduce

Steps to reproduce the behavior:

  1. Call await FirebaseMessaging.instance.getToken();
  2. See error or incorrect behavior
    FLTFirebaseMessaging: An error occurred while calling method Messaging#getToken, errorOrNil => {
    NSLocalizedFailureReason = "Too many server requests.";
    }
    [VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: [firebase_messaging/unknown] An unknown error has occurred.
    #0      MethodChannelFirebaseMessaging.getToken (package:firebase_messaging_platform_interface/src/method_channel/method_channel_messaging.dart:226:7)
    <asynchronous suspension>
    #1      _SignUpState._sendVerificationCode (package:shuri_parent/src/pages/sign_up.dart:343:25)
    <asynchronous suspension>
    #2      _SignUpState.build.<anonymous closure> (package:shuri_parent/src/pages/sign_up.dart:252:43)
    <asynchronous suspension>

Expected behavior

I expect to get the device token

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 master, 2.3.0-17.0.pre.121, on Mac OS X 10.15.7 19H1419 darwin-x64, locale en-RW) [āœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [āœ“] Xcode - develop for iOS and macOS [āœ“] Chrome - develop for the web [āœ“] Android Studio (version 4.2) [āœ“] VS Code (version 1.61.0) [āœ“] Connected device (2 available) ā€¢ No issues found! ```

Flutter dependencies

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

Click To Expand ``` dependencies: - android_intent 2.0.2 [flutter platform meta] - badges 1.2.0 [flutter] - cached_network_image 2.5.1 [flutter flutter_cache_manager octo_image] - charts_flutter 0.10.0 [charts_common collection flutter intl logging meta] - clippy_flutter 1.1.1 [flutter] - country_code_picker 1.7.0 [flutter modal_bottom_sheet] - cupertino_icons 1.0.3 - custom_info_window 1.0.1 [flutter google_maps_flutter] - data_connection_checker 0.3.4 - device_info 2.0.2 [flutter device_info_platform_interface] - dio 4.0.0 [http_parser path] - double_back_to_close 1.0.2+mit [flutter toast] - dropdown_search 0.6.3 [flutter] - firebase_core 1.8.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 2.2.4 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_messaging 10.0.9 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine] - flutter_country_picker 0.1.6 [flutter diacritic] - flutter_datetime_picker 1.5.1 [flutter] - flutter_icons 1.1.0 [flutter] - flutter_launcher_icons 0.9.2 [args image path yaml] - flutter_local_notifications 5.0.0+4 [flutter flutter_local_notifications_platform_interface platform timezone] - flutter_localizations 0.0.0 [flutter intl characters clock collection meta path typed_data vector_math] - flutter_native_splash 1.2.3 [args image meta path xml yaml universal_io] - flutter_polyline_points 1.0.0 [flutter http] - flutter_ringtone_player 3.0.0 [flutter] - flutter_simple_dependency_injection 2.0.0 - flutter_spinkit 5.1.0 [flutter] - geolocator 7.6.2 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web] - google_fonts 2.1.0 [flutter http path_provider crypto] - google_maps_flutter 2.0.9 [flutter flutter_plugin_android_lifecycle google_maps_flutter_platform_interface] - google_nav_bar 5.0.5 [flutter] - http 0.13.3 [async http_parser meta path pedantic] - image_cropper 1.4.1 [flutter] - image_picker 0.8.4+1 [flutter flutter_plugin_android_lifecycle image_picker_for_web image_picker_platform_interface] - in_app_update 2.0.0 [flutter] - intl 0.17.0 [clock path] - intl_phone_number_input 0.7.0+2 [flutter meta libphonenumber_plugin equatable collection] - introduction_screen 2.1.0 [flutter dots_indicator] - jwt_decode 0.3.1 - line_icons 2.0.1 [flutter] - motion_tab_bar_v2 0.2.4 [flutter vector_math] - photo_view 0.10.3 [flutter] - provider 5.0.0 [collection flutter nested] - settings_ui 1.0.0 [flutter] - shared_preferences 2.0.7 [flutter meta shared_preferences_linux shared_preferences_macos shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - shimmer 2.0.0 [flutter] - socket_io_client 0.9.12 [logging socket_io_common] - upgrader 3.5.1 [flutter device_info http package_info shared_preferences url_launcher version xml html] - url_launcher 6.0.10 [flutter meta url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] dev dependencies: - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data] transitive dependencies: - archive 3.1.2 [crypto path] - args 2.3.0 - async 2.7.0 [collection meta] - boolean_selector 2.1.0 [source_span string_scanner] - characters 1.1.0 - charcode 1.2.0 - charts_common 0.10.0 [collection intl logging meta vector_math] - clock 1.1.0 - collection 1.15.0 - cross_file 0.3.1+5 [flutter meta] - crypto 3.0.1 [collection typed_data] - csslib 0.17.0 [source_span] - device_info_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - diacritic 0.1.3 - dots_indicator 2.0.0 [flutter] - equatable 2.0.3 [collection meta] - fake_async 1.2.0 [clock collection] - ffi 1.1.2 - file 6.1.2 [meta path] - firebase_core_platform_interface 4.0.1 [collection flutter meta plugin_platform_interface] - firebase_core_web 1.1.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.1.4 [collection firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 3.0.7 [firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 2.0.7 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - flutter_blurhash 0.5.0 [flutter meta] - flutter_cache_manager 2.1.2 [flutter path_provider uuid http path sqflite pedantic clock file rxdart image] - flutter_local_notifications_platform_interface 3.0.0 [flutter plugin_platform_interface] - flutter_plugin_android_lifecycle 2.0.3 [flutter] - flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math] - geolocator_android 1.0.2 [flutter geolocator_platform_interface] - geolocator_apple 1.2.0 [flutter geolocator_platform_interface] - geolocator_platform_interface 2.3.4 [flutter plugin_platform_interface vector_math meta] - geolocator_web 2.0.6 [flutter flutter_web_plugins geolocator_platform_interface] - google_maps_flutter_platform_interface 2.1.1 [collection flutter meta plugin_platform_interface stream_transform] - html 0.15.0 [csslib source_span] - http_parser 4.0.0 [charcode collection source_span string_scanner typed_data] - image 3.0.4 [archive meta xml] - image_picker_for_web 2.1.3 [flutter flutter_web_plugins image_picker_platform_interface meta] - image_picker_platform_interface 2.4.1 [flutter http meta plugin_platform_interface cross_file] - js 0.6.3 - libphonenumber 2.0.2 [flutter meta] - libphonenumber_platform_interface 0.3.1 [flutter plugin_platform_interface] - libphonenumber_plugin 0.2.3 [flutter flutter_web_plugins libphonenumber_platform_interface libphonenumber_web libphonenumber] - libphonenumber_web 0.2.0+1 [flutter flutter_web_plugins js libphonenumber_platform_interface] - logging 0.11.4 - matcher 0.12.10 [stack_trace] - meta 1.4.0 - modal_bottom_sheet 1.0.0+1 [flutter] - nested 1.0.0 [flutter] - octo_image 0.3.0 [flutter flutter_blurhash] - package_info 2.0.2 [flutter] - path 1.8.0 - path_provider 2.0.4 [flutter path_provider_linux path_provider_macos path_provider_platform_interface path_provider_windows] - path_provider_linux 2.1.0 [flutter path path_provider_platform_interface xdg_directories] - path_provider_macos 2.0.2 [flutter] - path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface] - path_provider_windows 2.0.3 [ffi flutter meta path path_provider_platform_interface win32] - pedantic 1.11.1 - petitparser 4.1.0 [meta] - platform 3.0.2 - plugin_platform_interface 2.0.1 [meta] - process 4.2.3 [file path platform] - rxdart 0.25.0 - shared_preferences_linux 2.0.2 [file meta flutter path path_provider_linux shared_preferences_platform_interface] - shared_preferences_macos 2.0.2 [flutter shared_preferences_platform_interface] - shared_preferences_platform_interface 2.0.0 [flutter] - shared_preferences_web 2.0.2 [flutter flutter_web_plugins meta shared_preferences_platform_interface] - shared_preferences_windows 2.0.2 [flutter file meta path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - sky_engine 0.0.99 - socket_io_common 0.9.2 [logging] - source_span 1.8.1 [collection path term_glyph] - sqflite 2.0.0+4 [flutter sqflite_common path] - sqflite_common 2.0.1+1 [synchronized path meta] - stack_trace 1.10.0 [path] - stream_channel 2.1.0 [async] - stream_transform 2.0.0 - string_scanner 1.1.0 [charcode source_span] - synchronized 3.0.0 - term_glyph 1.2.0 - test_api 0.4.0 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - timezone 0.7.0 [path] - toast 0.1.5 [flutter] - typed_data 1.3.0 [collection] - universal_io 2.0.4 [collection crypto meta typed_data] - url_launcher_linux 2.0.2 [flutter] - url_launcher_macos 2.0.2 [flutter] - url_launcher_platform_interface 2.0.4 [flutter plugin_platform_interface] - url_launcher_web 2.0.4 [flutter flutter_web_plugins meta url_launcher_platform_interface] - url_launcher_windows 2.0.2 [flutter] - uuid 3.0.4 [crypto] - vector_math 2.1.0 - version 2.0.0 - win32 2.2.9 [ffi] - xdg_directories 0.2.0 [meta path process] - xml 5.1.2 [collection meta petitparser] - yaml 3.1.0 [collection source_span string_scanner] ```

darshankawar commented 3 years ago

(Channel master, 2.3.0-17.0.pre.121

@ShejaEddy You are on older version of master. Please upgrade to latest (Channel master, 2.6.0-12.0.pre.478) and try again to see if you still get same behavior or not.

ShejaEddy commented 3 years ago

I've upgraded to the latest flutter dev channel but still getting the same issue.

Flutter 2.6.0-11.0.pre ā€¢ channel dev ā€¢ https://github.com/flutter/flutter.git
Framework ā€¢ revision 4b330ddbed (6 weeks ago) ā€¢ 2021-09-16 17:29:58 -0700
Engine ā€¢ revision 5b81c6d615
Tools ā€¢ Dart 2.15.0 (build 2.15.0-116.0.dev)

Here is the flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[āœ“] Flutter (Channel dev, 2.6.0-11.0.pre, on Mac OS X 10.15.7 19H1419 darwin-x64, locale en-RW)
[āœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[āœ“] Xcode - develop for iOS and macOS (Xcode 12.4)
[āœ“] Chrome - develop for the web
[āœ“] Android Studio (version 4.2)
[āœ“] VS Code (version 1.61.0)
[āœ“] Connected device (2 available)

ā€¢ No issues found!
ShejaEddy commented 3 years ago

When I upgrade to the latest master channel I get this error:

    ../../flutter/.pub-cache/hosted/pub.dartlang.org/settings_ui-1.0.0/lib/src/cupertino_settings_item.dart:76:51: Error: A value of type 'ListTileThemeData' can't be assigned to a variable of type 'ListTileTheme'.
     - 'ListTileThemeData' is from 'package:flutter/src/material/list_tile.dart' ('../../flutter/packages/flutter/lib/src/material/list_tile.dart').
     - 'ListTileTheme' is from 'package:flutter/src/material/list_tile.dart' ('../../flutter/packages/flutter/lib/src/material/list_tile.dart').
        final ListTileTheme tileTheme = ListTileTheme.of(context);
ShejaEddy commented 3 years ago

Oh! my bad, I found the issue. My issue was a wrong api key of firebase in the GoogleServices-info.plist

Thanks for all the support you gave me.