Error compiling a Flutter application with API connection

Tiempo de lectura: < 1 minuto

html
Copy code
Reading time: < 1 minute

When trying to run an application that makes an API call from Flutter, the following error occurs:

Error: Cannot run with sound null safety, because the following dependencies
don’t support null safety:

  • package:http
  • package:http_parser

To fix this error, I followed these steps:

First, in the Android Studio menu bar, click on the following option:

Then add the following line of code in this section:
--no-sound-null-safety

Finally, we can test that the Flutter application compiles correctly on both web and mobile.

I hope this helps! Have a great day.

Leave a Comment