1

When I launch my application I get an exception Error loading AssetManifest.json, e: Null check operator used on a null value and I have no clue where it is coming from. Contrary to the question Null check operator used on a null value I am not using a bang operator anywhere except for this short code piece:

return Text(
      widget.text,
      style: Theme.of(context).textTheme.bodyText1!.copyWith(
        fontWeight: FontWeight.bold
      ),
    );

The exception is thrown after all calls to this code here so this cannot be the source.

I have no clue what Error loading AssetManifest.json means either and could only find solutions for similar sounding issues but none resolved my problem.

I also opened a GitHub issue with results of flutter run --verbose, flutter analyze and flutter doctor -v: https://github.com/flutter/flutter/issues/85457

It would be great if someone could aid me with this.

cstmth
  • 83
  • 11

1 Answers1

4

Following a reply to https://github.com/material-foundation/google-fonts-flutter/issues/172, I fixed it by adding this line in main() before calling runApp:

WidgetsFlutterBinding.ensureInitialized();
Mauro Vanetti
  • 424
  • 1
  • 5
  • 18