shorebirdtech / shorebird

Code Push for Flutter and other tools for Flutter businesses.
https://shorebird.dev
Other
2.29k stars 136 forks source link

fix: : [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: UnimplementedError #781

Closed theappideasankit closed 1 year ago

theappideasankit commented 1 year ago
: [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: UnimplementedError
E/flutter (25139): #0      _DeferringMouseCursor.createSession (package:flutter/src/services/mouse_cursor.dart:254)
E/flutter (25139): #1      _DateFormatPatternField.formatField (package:intl/src/intl/date_format_field.dart:396)

E/flutter (25139): #2      _DateFormatPatternField.format (package:intl/src/intl/date_format_field.dart:254)
E/flutter (25139): #3      DateFormat.format (package:intl/src/intl/date_format.dart:302)
E/flutter (25139): #4      SearchTabController.mergeDateTime (package:dynasty_user_side/screens/car_rental/search_tab/controller/search_tab_controller.dart:215)

package

intl : intl: ^0.18.0

discription:-

when i build using this command (flutter build apk --release) is perfrect working but when i build and run using this command (shorebird run -- -d 192.168.29.121:5555) i found this issue

SpajicM commented 1 year ago

I think you're using the wrong flutter version. To use Shorebird, you need to use latest stable Flutter.

eseidel commented 1 year ago

Could you share the output of shorebird doctor? Thanks!

theappideasankit commented 1 year ago
image
theappideasankit commented 1 year ago

I think you're using the wrong flutter version. To use Shorebird, you need to use latest stable Flutter.

Flutter 3.10.0 • channel stable • https://github.com/flutter/flutter.git Framework • revision 84a1e904f4 (8 weeks ago) • 2023-05-09 07:41:44 -0700 Engine • revision d44b5a94c9 Tools • Dart 3.0.0 • DevTools 2.23.1

eseidel commented 1 year ago

Is this running on desktop or Android? I'm new to this mouse cursor code.

https://github.com/flutter/flutter/blob/796c8ef792/packages/flutter/lib/src/services/mouse_cursor.dart#L252

eseidel commented 1 year ago

Actually, nevermind, that last stack frame makes no sense.

eseidel commented 1 year ago

I'm not sure exactly what version of package:intl this is (your pubspec.lock would tell you), but: https://github.com/dart-lang/i18n/blob/main/pkgs/intl/lib/src/intl/date_format_field.dart#L355 hasn't changed in 8 years, and does not call UnimplementedError (unless one of the methods it calls does).

I'm still confused why the stack looks like that (I guess it's a release build and we only are seeing some of the stack symbols)?

I'm still not sure how Shorebird could be causing issues here.

You're saying that: flutter run --release works, but shorebird run does not, correct?

theappideasankit commented 1 year ago

Is this running on desktop or Android? I'm new to this mouse cursor code.

https://github.com/flutter/flutter/blob/796c8ef792/packages/flutter/lib/src/services/mouse_cursor.dart#L252

android

E/flutter (14934): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: UnimplementedError E/flutter (14934): #0 _DeferringMouseCursor.createSession (package:flutter/src/services/mouse_cursor.dart:254)

E/flutter (14934): #1 _DateFormatPatternField.formatField (package:intl/src/intl/date_format_field.dart:396) E/flutter (14934): #2 _DateFormatPatternField.format (package:intl/src/intl/date_format_field.dart:254)

E/flutter (14934): #3 DateFormat.format (package:intl/src/intl/date_format.dart:302)

E/flutter (14934): #4 SearchTabController.mergeDateTime (package:dynasty_user_side/screens/car_rental/search_tab/controller/search_tab_controller.dart:215)

E/flutter (14934): #5 SearchTabController.searchRentalAPICon (package:dynasty_user_side/screens/car_rental/search_tab/controller/search_tab_controller.dart:264)

E/flutter (14934): #6 SearchTabScreen.buildSearchButton. (package:dynasty_user_side/screens/car_rental/search_tab/view/search_tab_screen.dart:382)

E/flutter (14934): #7 _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1154)

E/flutter (14934): #8 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:275)

E/flutter (14934): #9 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:654) E/flutter (14934): #10 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:311) E/flutter (14934): #11 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:244) E/flutter (14934): #12 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:630) E/flutter (14934): #13 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:98) E/flutter (14934): #14 PointerRouter._dispatchEventToRoutes. (package:flutter/src/gestures/pointer_router.dart:143) E/flutter (14934): #15 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:625) E/flutter (14934): #16 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:141) E/flutter (14934): #17 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:127) E/flutter (14934): #18 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:465) E/flutter (14934): #19 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:445) E/flutter (14934): #20 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:331) E/flutter (14934): #21 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:400) E/flutter (14934): #22 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:363) E/flutter (14934): #23 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:320) E/flutter (14934): #24 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:293) E/flutter (14934): #25 _invoke1 (dart:ui/hooks.dart:158) E/flutter (14934): #26 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:382) E/flutter (14934): #27 _dispatchPointerDataPacket (dart:ui/hooks.dart:91) E/flutter (14934):

theappideasankit commented 1 year ago

I'm not sure exactly what version of package:intl this is (your pubspec.lock would tell you), but: https://github.com/dart-lang/i18n/blob/main/pkgs/intl/lib/src/intl/date_format_field.dart#L355 hasn't changed in 8 years, and does not call UnimplementedError (unless one of the methods it calls does).

I'm still confused why the stack looks like that (I guess it's a release build and we only are seeing some of the stack symbols)?

I'm still not sure how Shorebird could be causing issues here.

You're saying that: flutter run --release works, but shorebird run does not, correct? ==========>>>>yes right

yes right and shorebird run, shorebird release android, shorebird build apk not work

eseidel commented 1 year ago

OK, yes, I think @SpajicM is right, I suspect this is that shorebird is building your app with Flutter 3.10.5 and flutter is building the app with Flutter 3.10.0 and that's causing the issue.

My guess is if you run flutter upgrade you'll find things fixed? But that's still a guess on my part.

theappideasankit commented 1 year ago

same issue after flutter update 3.10.5

eseidel commented 1 year ago

Thanks for the report. I'm still very confused how the behavior could differ between flutter at 3.10.5 and shorebird (which uses Flutter 3.10.5).

Can you confirm what version of package:intl your pubspec.lock reports?

Line 396 in date_format_field.dart (from package intl 0.18.1) does not actually point to a line: https://github.com/dart-lang/i18n/blob/intl-v0.18.1/pkgs/intl/lib/src/intl/date_format_field.dart#L396

eseidel commented 1 year ago

In 0.18.0 it is: return formatTimeZoneRFC(date);

eseidel commented 1 year ago

Which does in fact throw:

  String formatTimeZoneRFC(DateTime date) {
    throw UnimplementedError();
  }

I believe that's the error you're actually hitting.

eseidel commented 1 year ago

Yeah, looks like that's just a bug in 0.18.0, which was fixed in 0.18.1. I would recommend upgrading to package:intl 0.18.1. I'm still not sure why this is occurring for you in Shorebird but no in Flutter?

eseidel commented 1 year ago

I believe this was a package:intl bug (see above), speculatively closing. Let me know if you're still having issues!