Expecting binder but got null

54.6k Views Asked by At

I'm getting this message on my log although everything works fine

W/Parcel: Expecting binder but got null!

Has anyone faced such issue, and how to fix it?

Steps to Reproduce:

  1. Just create a new Flutter project and run it on a simulator/emulator
  2. See logs, you'll get this message: "Expecting binder but got null"

Expected behavior:

  1. There should not be such error message

Runner Log

Launching lib/main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app-debug.apk...
Debug service listening on ws://127.0.0.1:62931/5G0AlEiF5bQ=/ws
Syncing files to device sdk gphone64 x86 64...
I/.flutter_issues(17884): Compiler allocated 4533KB to compile void android.view.ViewRootImpl.performTraversals()
E/SurfaceSyncer(17884): Failed to find sync for id=0
W/Parcel  (17884): Expecting binder but got null!
4

There are 4 best solutions below

7
On BEST ANSWER

Try adding the line below in the main() function

WidgetsFlutterBinding.ensureInitialized();

If this doesn't work, please check that the value you pass to the initialBinding: in the MaterialApp() is not null.

0
On

Literally

File -> Invalidate Caches -> Clear Filesystem Cache

And then rebuilding fixed it for me (React Native 0.68.2)

1
On

I have super.build(); in my widget for no reason. Just forgot to delete the code. So I removed the code and fixed.

class _VehicleAddState extends State<VehicleAdd>
    with AutomaticKeepAliveClientMixin<VehicleAdd> {
  double selectedMenu = 0;
  @override
  Widget build(BuildContext context) {
    super.build(context);
0
On

The message actually doesn't affect the functionality of the app. But still you can add a line in the main(). Add WidgetsFlutterBinding.ensureInitialized(); in the main function

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MyApp());
}