skip to Main Content

When using flutter run I get this error:

Error: Cannot run with sound null safety, because the following
dependencies

no dependencies are listed
using flutter run -v I get this:

[   +3 ms] Error (Xcode): [+3422 ms] Error: Cannot run with sound null safety, because the following
dependencies
           
[   +6 ms] Could not build the application for the simulator.
[   +1 ms] Error launching application on iPhone 14 Pro Max.
[   +7 ms] "flutter run" took 50 596ms.
[   +6 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:722:9)
           <asynchronous suspension>
           #2      FlutterCommand.run.<anonymous closure>
           (package:flutter_tools/src/runner/flutter_command.dart:1257:27)
           <asynchronous suspension>
           #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #4      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
           <asynchronous suspension>
           #5      FlutterCommandRunner.runCommand.<anonymous closure>
           (package:flutter_tools/src/runner/flutter_command_runner.dart:283:9)
           <asynchronous suspension>
           #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
           <asynchronous suspension>
           #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #10     main (package:flutter_tools/executable.dart:91:3)
           <asynchronous suspension>

2

Answers


  1. Chosen as BEST ANSWER

    I figured out the problem was shared_preferences Had to update it so it doesn't use an outdated version which caused the problem


  2. Remove flutter_tools from your dependencies. It’s too old and it does not support null safety.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search