ethanblake4 / flutter_eval

Code push for Flutter, powered by dart_eval

Home Page:https://pub.dev/packages/flutter_eval

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flutter 3.13.6 | `Unhandled Exception: Null check operator used on a null value` in runtime of example app

wrbl606 opened this issue · comments

When launching an example app from examples/code_push_app I see:

Logcat
I/flutter (15879): Loading hot update from asset:packages/update.evc
I/flutter (15879): Applying hot update...
W/Parcel  (15879): Expecting binder but got null!
E/flutter (15879): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
E/flutter (15879): #0      Runtime._setupBridging (package:dart_eval/src/eval/runtime/runtime.dart:207:35)
E/flutter (15879): #1      Runtime._load (package:dart_eval/src/eval/runtime/runtime.dart:187:5)
E/flutter (15879): #2      Runtime.setup (package:dart_eval/src/eval/runtime/runtime.dart:234:7)
E/flutter (15879): #3      _HotSwapLoaderState._setup.<anonymous closure> (package:flutter_eval/src/flutter_eval.dart:776:18)
E/flutter (15879): #4      State.setState (package:flutter/src/widgets/framework.dart:1138:30)
E/flutter (15879): #5      _HotSwapLoaderState._setup (package:flutter_eval/src/flutter_eval.dart:769:5)
E/flutter (15879): #6      _HotSwapLoaderState._loadFromAsset (package:flutter_eval/src/flutter_eval.dart:731:7)
E/flutter (15879): <asynchronous suspension>
E/flutter (15879): 

I've got flutter_eval.json from here.

flutter doctor:

Flutter details
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.6, on macOS 14.0 23A344 darwin-arm64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] IntelliJ IDEA Community Edition (version 2022.3.2)
[✓] VS Code (version 1.82.2)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!

Here's a fork of this repo, including reproduction of the issue.

Do we miss new release of flutter_eval.json for 0.6.1+1 version? Latest available is 0.6.0.

Hi! I've released the v0.6.1+1 version of flutter_eval.json, but I'm not sure if it will fix your issue.
It's also very important to check that you're using the same version of the dart_eval compiler as the version of dart_eval that's in your app. You can check the version of the dart_eval compiler with dart pub global list and the version in the app with flutter pub deps.
Let me know if this helps!

It worked flawlessly after applying the new flutter_eval.json 🎉

What do you mean by "but I'm not sure if it will fix your issue"? 0.6.0 and 0.6.1+1 bindings do have differences. Is the new release not expected to be necessary? Or new Flutter version broke the bindings?

Is there a way to generate those bindings on demand, as a part of the usual hot-swappable package setup?

Great to hear! I wasn't sure if there were any differences in the bindings for v0.6.1, but I'm glad it's working for you.

The bindings are generated by the code in this test. I took a quick look at your repo and it seems you've got a custom Makefile build setup so I'd imagine it'd be possible to run that test as part of it.

Closing this as the issue appears to be fixed.