Run android project from a Flutter project with unsound null safety

1,598

Solution 1

  1. Change your edit configurations.

    enter image description here

  2. Add the flag --no-sound-null-safety

    enter image description here

Solution 2

After searching a little more I found the solution to this problem. You do not need to run the project through Android Studio, you can run it with the Flutter command and then attach the debugger using Android Studio.

Reference: https://stackoverflow.com/a/58760445/8633918

Share:
1,598
Leonardo da Silva
Author by

Leonardo da Silva

Developing an online multiplayer game in Flutter called Fibula Wars.

Updated on December 28, 2022

Comments

  • Leonardo da Silva
    Leonardo da Silva over 1 year

    After sound null safety has arrived, projects that still have dependencies that have not upgraded to null safety yet, can still be run using --no-sound-null-safety flag through the Flutter command.

    But now I am trying to run the app through the android project. The reason why I am trying to do this way is to allow me to debug a native Flutter plugin. I open the folder android on Android Studio and when I try to run the project I receive an error:

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

    If I was running through the Flutter command, the flag I mentioned would work here. But how do I set this flag when running the android project through Android Studio?