5

I am trying to generate the App Bundle via Android studio (Build -> Generate Signed Bundle / APK), and I am running into an error when building a bundle.

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

Is there a way that I can add the argument --no-sound-null-safety, similar to what you can do in the command line?

mrgnhnt96
  • 3,562
  • 1
  • 17
  • 36

4 Answers4

2

Run

flutter build apk --split-per-abi --no-sound-null-safety

Credit

iDecode
  • 22,623
  • 19
  • 99
  • 186
  • 3
    I know this command, but this isn't what I was asking for. Is there a way to add that argument within android studio? – mrgnhnt96 Mar 29 '21 at 17:02
1
    run:
flutter build appbundle --no-sound-null-safety
1

Disable sound null safety using the --no-sound-null-safety flag to the dart or flutter command:

 dart --no-sound-null-safety run
 flutter build apk --split-per-abi --no-sound-null-safety

Alternatively, set the language version in the entrypoint — the file that contains main() function — to 2.9

// @dart=2.9
import 'src/my_app.dart';

main() {
  //...
}
Codemaker2015
  • 12,190
  • 6
  • 97
  • 81
1

use

flutter build appbundle --release --no-sound-null-safety

to build a app bundle with no sound null safety use this command

tk_tanz
  • 384
  • 2
  • 7