Closed lvlrSajjad closed 3 years ago
Hi @lvlrSajjad There was an issue to track this before but it got closed due to a potential fix https://github.com/FirebaseExtended/flutterfire/issues/4088.
Are you seeing this every time on iOS? Have you carefully followed https://firebase.flutter.dev/docs/installation/ios and https://firebase.flutter.dev/docs/messaging/apple-integration? Thank you
@markusaksli-nc Hi! 1- Yes I see this every time on iOS.
2- Yes. Because It works with the 7.0.3 version. (Our app is in production and users are already using it with 7.0.3).
But we have been forced to upgrade it to 8.0.0-dev.14 to be able to build our project with the latest firebase core version.
@markusaksli-nc I don't know how but now it returned a token!
I'll test it more times :-D
Yes, it might be a server-side problem because I didn't change anything and now it returns a token!
I'll close this issue for now.
@markusaksli-nc It's happened again on a physical device.
Sometimes it doesn't have this error and returns the token but sometimes it does I don't know why.
I have same issue. Any news update?
i have the same issue. And we need a new version to be able to build our project with the latest firebase core version. @markusaksli-nc
different results for each start (Map or String)
Update on this error this time I have received something extra.
[VERBOSE-2:profiler_metrics_ios.mm(184)] Error retrieving thread information: (ipc/send) invalid destination port
FLTFirebaseMessaging: An error occurred while calling method Messaging#getToken, errorOrNil => {
NSErrorFailingURLKey = "https://device-provisioning.googleapis.com/checkin";
NSErrorFailingURLStringKey = "https://device-provisioning.googleapis.com/checkin";
NSLocalizedDescription = "Could not connect to the server.";
NSUnderlyingError = "Error Domain=kCFErrorDomainCFNetwork Code=-1004 \"(null)\" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}";
"_NSURLErrorFailingURLSessionTaskErrorKey" = "LocalDataTask <E5FFE1BE-A6DD-4644-ACA6-14EE52DBA6AB>.<34>";
"_NSURLErrorRelatedURLSessionTaskErrorKey" = (
"LocalDataTask <E5FFE1BE-A6DD-4644-ACA6-14EE52DBA6AB>.<34>"
);
"_kCFStreamErrorCodeKey" = 61;
"_kCFStreamErrorDomainKey" = 1;
}
[VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'String' in type cast
#0 new LinkedHashMap.from.<anonymous closure> (dart:collection/linked_hash_map.dart:89:26)
#1 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:377:8)
#2 new LinkedHashMap.from (dart:collection/linked_hash_map.dart:88:11)
#3 platformExceptionToFirebaseException (package:firebase_messaging_platform_interface/src/method_channel/utils/exception.dart:26:9)
#4 convertPlatformException (package:firebase_messaging_platform_interface/src/method_channel/utils/exception.dart:15:10)
#5 MethodChannelFirebaseMessaging.getToken (package:firebase_messaging_platform_interface/src/method_channel/method_channel_messaging.dart:227:13)
<asynchronous suspension>
#6 FirebaseMessaging.getToken (package:firebase_messaging/src/messaging.dart:152:22)
#7 UserFirebaseProvider.firestoreCreateUser (package:pmx_flutter/src/re<…>
I guess this is a server-side problem
Anyways you have to return null at least and return this exception through a catch block.
same issue 🚑 🚑 🚑 🚑 🚑 🚑
I still haven't been able to reproduce this but the issue is on the team's radar. Please just thumbs up the original issue comment instead of commenting that you have the same issue unless you have some new information to add.
Just to add more relevant info: I'm facing this issue on Android also.
firebase_core: ^0.7.0
, firebase_messaging: ^8.0.0-dev.10
1.22.6
.
W/FirebaseInstanceId( 7755): Token retrieval failed: SERVICE_NOT_AVAILABLE. Will retry token retrieval
I/flutter ( 7755): type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'String' in type cast
- Downgraded to flutter version `1.22.5` and it starts working again.
I'm having the same issue causing errors in production! 🥺
Same issue when call "subscribeToTopic".
Try to figure out why.
Flutter try to convert details to type Map<String, String>
.
iOS give flutter a type <String, Map>
So every exception will result in"Unhandled Exception: type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'String' in type cast", and the real exception would disappear.
@markusaksli-nc I have same issue in Android Device
@markusaksli-nc , below is the error message coming from native ios side before getting caught in the typecast error (Unhandled Exception: type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype ).
{code: unknown, message: An unknown error has occurred., nativeErrorMessage: The operation couldn’t be completed. Invalid registration response :'Error=INVALID_PARAMETERS'. It is missing 'token' field., nativeErrorCode: 0, additionalData: {}}
Any news on this bug?
Hey @evetechsolutions, are you up to date with the latest firebase_messaging
version? We removed the suspected bug in this commit. I personally haven't been able to reproduce this bug. Therefore, we're reliant on user feedback for this particular issue.
Hey @lvlrSajjad. 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!
Since there haven't been any recent updates here, I am going to close this issue.
@lvlrSajjad if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.
Bug report
Describe the bug When I'm trying to use this code:
Instead of returning the fcmToken I receive this error:
Click To Expand
``` flutter: type '_InternalLinkedHashMapBut it works perfectly in Android. And it used to work on IOS in previous versions.
It seems the getToken() instead of String type returns a Map while the function declared like this:
Steps to reproduce
Steps to reproduce the behavior:
firebase_messaging: 8.0.0-dev.14
Expected behavior
Return a string token.
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
``` [✓] Flutter (Channel stable, 1.22.5, on macOS 11.1 20C69 darwin-x64, locale en-US) • Flutter version 1.22.5 at /Users/lvlrx/development/flutter • Framework revision 7891006299 (6 weeks ago), 2020-12-10 11:54:40 -0800 • Engine revision ae90085a84 • Dart version 2.10.4 [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/lvlrx/Library/Android/sdk • Platform android-30, build-tools 29.0.2 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 12.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.3, Build version 12C33 • CocoaPods version 1.10.1 [✓] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin installed • Dart plugin version 201.9245 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) [✓] Connected device (1 available) • Sajjad Asadi’s iPhone (mobile) • cd1ab62b9ce2e34bb73637391f9e97b36cf2ce2c • ios • iOS 14.3 • No issues found! ```Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
``` Dart SDK 2.10.4 Flutter SDK 1.22.5 dependencies: - agora_rtc_engine 3.2.1 [flutter flutter_web_plugins json_annotation] - animated_text_kit 3.1.0 [flutter characters] - audioplayers 0.17.2 [uuid path_provider flutter flutter_web_plugins] - cached_network_image 2.5.0 [flutter flutter_cache_manager octo_image] - circular_countdown_timer 0.0.8 [flutter] - cloud_firestore 0.16.0 [flutter meta quiver firebase_core firebase_core_platform_interface cloud_firestore_platform_interface cloud_firestore_web] - cloud_functions 0.9.0 [meta flutter firebase_core firebase_core_platform_interface cloud_functions_platform_interface cloud_functions_web] - connectivity 2.0.2 [flutter meta connectivity_platform_interface connectivity_macos connectivity_for_web] - country_pickers 1.3.0 [flutter] - crypto 2.1.5 [collection convert typed_data] - device_id 0.2.0 [flutter] - device_info 1.0.0 [flutter device_info_platform_interface] - file_picker 2.1.5+1 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface] - firebase_analytics 7.0.1 [meta flutter firebase_core firebase_analytics_web firebase_analytics_platform_interface] - firebase_auth 0.20.0+1 [meta firebase_core firebase_core_platform_interface firebase_auth_platform_interface firebase_auth_web flutter] - firebase_core 0.7.0 [firebase_core_platform_interface flutter quiver meta firebase_core_web] - firebase_crashlytics 0.4.0+1 [flutter stack_trace firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface] - firebase_messaging 8.0.0-dev.14 [meta flutter firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web] - firebase_ml_vision 0.10.0 [flutter] - firebase_performance 0.5.0+1 [flutter firebase_core] - firebase_remote_config 0.6.0 [flutter firebase_core] - firebase_storage 7.0.0 [flutter firebase_core firebase_core_platform_interface firebase_storage_web firebase_storage_platform_interface quiver] - flare_flutter 2.0.6 [flutter flare_dart meta] - flash 1.3.1 [flutter] - flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine] - flutter_animated_theme 0.9.0 [flutter rect_getter] - flutter_app_badger 1.1.2 [flutter] - flutter_cache_manager 2.1.1 [flutter path_provider uuid http path sqflite pedantic clock file rxdart image] - flutter_facebook_auth 2.0.0+1 [flutter flutter_facebook_auth_platform_interface flutter_facebook_auth_web] - flutter_secure_storage 3.3.5 [meta flutter] - flutter_slidable 0.5.7 [flutter] - flutter_sound_lite 7.5.2+3 [path_provider logger recase uuid provider flutter_spinkit path synchronized flutter flutter_sound_platform_interface flutter_sound_web] - font_awesome_flutter 8.11.0 [flutter] - geocoder 0.2.1 [meta flutter] - geohash 0.2.1 - geolocator 6.1.14 [flutter geolocator_platform_interface] - google_sign_in 4.5.9 [google_sign_in_platform_interface flutter meta google_sign_in_web] - googleapis 0.56.1 [_discoveryapis_commons http] - http 0.12.2 [http_parser path pedantic] - image_cropper 1.3.1 [flutter] - image_jpeg 1.1.1 [flutter] - image_picker 0.6.7+21 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface] - image_sequence_animator 1.0.10 [flutter cached_network_image] - inject 1.0.0-alpha [meta] - intl 0.16.1 [path] - material_design_icons_flutter 4.0.5855 [flutter] - package_info 0.4.3+2 [flutter] - path 1.8.0-nullsafety.1 - path_provider 1.6.27 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows] - permission_handler 5.0.1+1 [flutter meta permission_handler_platform_interface] - photo_view 0.10.3 [flutter] - progressive_image 1.0.1 [flutter] - purchases_flutter 2.0.0 [flutter] - rate_my_app 0.7.2 [shared_preferences smooth_star_rating pedantic flutter] - reorderables 0.3.2 [flutter] - rxdart 0.25.0 - sembast 2.4.8+1 [meta path synchronized] - share 0.6.5+4 [meta mime flutter] - shared_preferences 0.5.12+4 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_preferences_windows] - sign_in_with_apple 2.5.4 [meta flutter] - smooth_page_indicator 0.2.0 [flutter] - store_redirect 1.0.2 [flutter] - transparent_image 1.0.0 - url_launcher 5.7.10 [flutter url_launcher_platform_interface url_launcher_web url_launcher_linux url_launcher_macos url_launcher_windows] - vibration 1.7.3 [flutter vibration_web] - video_trimmer 0.3.5 [flutter file_picker video_player flutter_ffmpeg video_thumbnail path_provider intl path] dev dependencies: - dependency_validator 2.0.1 [args build_config checked_yaml glob json_annotation logging package_config path pub_semver pubspec_parse yaml] - flutter_driver 0.0.0 [file json_rpc_2 meta path web_socket_channel vm_service_client webdriver flutter flutter_test fuchsia_remote_debug_protocol archive args async boolean_selector characters charcode clock collection convert crypto fake_async matcher platform process pub_semver source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math] - 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] - test 1.16.0-nullsafety.5 [analyzer async boolean_selector coverage http http_multi_server io js node_preamble package_config path pedantic pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core] transitive dependencies: - _discoveryapis_commons 0.2.0 [http] - _fe_analyzer_shared 12.0.0 [meta] - analyzer 0.40.6 [_fe_analyzer_shared args cli_util collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - archive 2.0.13 [crypto args path] - args 1.6.0 - async 2.5.0-nullsafety.1 [collection] - boolean_selector 2.1.0-nullsafety.1 [source_span string_scanner] - build_config 0.4.5 [checked_yaml json_annotation meta path pubspec_parse yaml] - characters 1.1.0-nullsafety.3 - charcode 1.2.0-nullsafety.1 - checked_yaml 1.0.4 [json_annotation source_span yaml] - cli_util 0.2.0 [path] - clock 1.1.0-nullsafety.1 - cloud_firestore_platform_interface 3.0.1 [flutter meta collection firebase_core plugin_platform_interface] - cloud_firestore_web 0.3.0+1 [flutter flutter_web_plugins http_parser meta firebase_core firebase_core_web cloud_firestore_platform_interface js] - cloud_functions_platform_interface 4.0.1 [flutter meta firebase_core plugin_platform_interface] - cloud_functions_web 3.1.3 [firebase_core firebase_core_web cloud_functions_platform_interface flutter flutter_web_plugins http_parser meta js] - collection 1.15.0-nullsafety.3 - connectivity_for_web 0.3.1+4 [connectivity_platform_interface flutter_web_plugins flutter] - connectivity_macos 0.1.0+7 [flutter] - connectivity_platform_interface 1.0.6 [flutter meta plugin_platform_interface] - convert 2.1.1 [charcode typed_data] - coverage 0.14.2 [args logging package_config path source_maps stack_trace vm_service] - device_info_platform_interface 1.0.1 [flutter meta plugin_platform_interface] - fake_async 1.2.0-nullsafety.1 [clock collection] - ffi 0.1.3 - file 6.0.0-nullsafety.2 [meta path] - firebase 7.3.3 [http http_parser js] - firebase_analytics_platform_interface 1.0.3 [flutter meta] - firebase_analytics_web 0.1.1 [flutter flutter_web_plugins firebase firebase_analytics_platform_interface meta] - firebase_auth_platform_interface 3.0.1 [flutter meta firebase_core plugin_platform_interface] - firebase_auth_web 0.3.2+6 [flutter flutter_web_plugins meta http_parser intl firebase_core firebase_core_web firebase_auth_platform_interface js] - firebase_core_platform_interface 3.0.1 [flutter meta plugin_platform_interface quiver] - firebase_core_web 0.2.1+3 [firebase_core_platform_interface flutter flutter_web_plugins meta js] - firebase_crashlytics_platform_interface 1.1.6 [flutter meta collection firebase_core plugin_platform_interface] - firebase_messaging_platform_interface 1.0.0-dev.10 [flutter meta firebase_core plugin_platform_interface] - firebase_messaging_web 0.1.0-dev.5 [flutter flutter_web_plugins meta firebase_core firebase_core_web firebase_messaging_platform_interface js service_worker] - firebase_storage_platform_interface 1.0.4 [flutter meta collection firebase_core plugin_platform_interface] - firebase_storage_web 0.1.1+3 [async crypto firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta] - flare_dart 2.3.4 - flutter_blurhash 0.5.0 [flutter meta] - flutter_facebook_auth_platform_interface 1.0.1 [flutter plugin_platform_interface] - flutter_facebook_auth_web 1.0.6 [flutter flutter_web_plugins js] - flutter_ffmpeg 0.3.0 [flutter] - flutter_plugin_android_lifecycle 1.0.11 [flutter] - flutter_sound_platform_interface 7.5.2+3 [flutter meta plugin_platform_interface] - flutter_sound_web 7.5.2+3 [flutter_sound_platform_interface flutter flutter_web_plugins meta js] - flutter_spinkit 4.1.2+1 [flutter] - flutter_web_plugins 0.0.0 [flutter characters collection meta typed_data vector_math] - fuchsia_remote_debug_protocol 0.0.0 [json_rpc_2 process web_socket_channel flutter_test flutter_driver archive args async boolean_selector charcode clock collection convert crypto fake_async file matcher meta path platform pub_semver source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math vm_service_client webdriver] - geolocator_platform_interface 1.0.8 [flutter meta plugin_platform_interface vector_math] - glob 1.2.0 [async collection node_io path pedantic string_scanner] - google_sign_in_platform_interface 1.1.2 [flutter meta quiver] - google_sign_in_web 0.9.2 [google_sign_in_platform_interface flutter flutter_web_plugins meta js] - http_multi_server 2.2.0 [async] - http_parser 3.1.4 [charcode collection source_span string_scanner typed_data] - image 2.1.19 [archive xml meta] - image_picker_platform_interface 1.1.1 [flutter meta http plugin_platform_interface] - io 0.3.4 [charcode meta path string_scanner] - js 0.6.3-nullsafety.2 - json_annotation 3.1.1 - json_rpc_2 2.2.2 [stack_trace stream_channel] - logger 0.9.4 - logging 0.11.4 - matcher 0.12.10-nullsafety.1 [stack_trace] - meta 1.3.0-nullsafety.3 - mime 0.9.7 - nested 0.0.4 [flutter] - node_interop 1.2.1 [js] - node_io 1.1.1 [node_interop path] - node_preamble 1.4.12 - octo_image 0.3.0 [flutter flutter_blurhash] - package_config 1.9.3 [path charcode] - path_provider_linux 0.0.1+2 [path xdg_directories path_provider_platform_interface flutter] - path_provider_macos 0.0.4+8 [flutter] - path_provider_platform_interface 1.0.4 [flutter meta platform plugin_platform_interface] - path_provider_windows 0.0.4+3 [path_provider_platform_interface meta path flutter ffi win32] - pedantic 1.10.0-nullsafety.2 - permission_handler_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - petitparser 3.1.0 [meta] - platform 3.0.0-nullsafety.2 - plugin_platform_interface 1.0.3 [meta] - pool 1.5.0-nullsafety.2 [async stack_trace] - process 4.0.0-nullsafety.2 [file path platform] - provider 4.3.2+4 [collection flutter nested] - pub_semver 1.4.4 [collection] - pubspec_parse 0.1.7 [checked_yaml json_annotation pub_semver yaml] - quiver 2.1.5 [matcher meta] - recase 3.0.1 - rect_getter 0.1.0 [flutter] - service_worker 0.2.4 [js] - shared_preferences_linux 0.0.2+4 [file flutter meta path path_provider_linux shared_preferences_platform_interface] - shared_preferences_macos 0.0.1+11 [shared_preferences_platform_interface flutter] - shared_preferences_platform_interface 1.0.4 [meta flutter] - shared_preferences_web 0.1.2+7 [shared_preferences_platform_interface flutter flutter_web_plugins meta] - shared_preferences_windows 0.0.1+3 [shared_preferences_platform_interface flutter ffi file meta path path_provider_platform_interface path_provider_windows] - shelf 0.7.9 [async collection http_parser path stack_trace stream_channel] - shelf_packages_handler 2.0.0 [path shelf shelf_static] - shelf_static 0.2.9+1 [convert http_parser mime path shelf] - shelf_web_socket 0.2.3 [shelf web_socket_channel stream_channel] - sky_engine 0.0.99 - smooth_star_rating 1.1.1 [flutter] - source_map_stack_trace 2.1.0-nullsafety.3 [path stack_trace source_maps] - source_maps 0.10.10-nullsafety.2 [source_span] - source_span 1.8.0-nullsafety.2 [charcode collection path term_glyph] - sqflite 1.3.2+2 [flutter sqflite_common path] - sqflite_common 1.0.3 [synchronized path meta] - stack_trace 1.10.0-nullsafety.1 [path] - stream_channel 2.1.0-nullsafety.1 [async] - string_scanner 1.1.0-nullsafety.1 [charcode source_span] - sync_http 0.2.0 - synchronized 2.2.0+2 - term_glyph 1.2.0-nullsafety.1 - test_api 0.2.19-nullsafety.2 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher] - test_core 0.3.12-nullsafety.5 [analyzer async args boolean_selector collection coverage glob io meta package_config path pedantic pool source_map_stack_trace source_maps source_span stack_trace stream_channel vm_service yaml matcher test_api] - typed_data 1.3.0-nullsafety.3 [collection] - url_launcher_linux 0.0.1+4 [flutter] - url_launcher_macos 0.0.1+9 [flutter] - url_launcher_platform_interface 1.0.9 [flutter meta plugin_platform_interface] - url_launcher_web 0.1.5+1 [url_launcher_platform_interface flutter flutter_web_plugins meta] - url_launcher_windows 0.0.1+3 [flutter] - uuid 2.2.2 [crypto convert] - vector_math 2.1.0-nullsafety.3 - vibration_web 1.6.2 [flutter flutter_web_plugins] - video_player 1.0.1 [meta video_player_platform_interface video_player_web flutter] - video_player_platform_interface 2.2.0 [flutter meta] - video_player_web 0.1.4+1 [flutter flutter_web_plugins meta video_player_platform_interface] - video_thumbnail 0.2.5+1 [flutter] - vm_service 5.5.0 [meta] - vm_service_client 0.2.6+2 [async collection json_rpc_2 pub_semver source_span stack_trace stream_channel web_socket_channel] - watcher 0.9.7+15 [async path pedantic] - web_socket_channel 1.1.0 [async crypto stream_channel] - webdriver 2.1.2 [archive matcher path stack_trace sync_http] - webkit_inspection_protocol 0.7.4 [logging] - win32 1.7.4 [ffi] - xdg_directories 0.1.2 [meta path process] - xml 4.5.1 [collection convert meta petitparser] - yaml 2.2.1 [charcode collection string_scanner source_span] ```