Skip to content

hard to parse error if flutter.yaml points to a file that doesn't exist. #296

@sethladd

Description

@sethladd

Here's the flutter.yaml:

assets:
  - assets/sprites.json
  - assets/sprites.png
  - assets/test.json

Here's the error:

[/Users/sethladd/Downloads/px_template 2] flutter start
The null object does not have a getter 'compress'.

NoSuchMethodError: method not found: 'compress'
Receiver: null
Arguments: []
severe: 
Exception:
dart:core                                                       Object.noSuchMethod
package:archive/src/zip_encoder.dart 36                         ZipEncoder.encode
package:sky_tools/src/commands/build.dart 210                   BuildCommand.build.<async>
dart:async                                                      _Completer.completeError
package:sky_tools/src/commands/build.dart 220                   BuildCommand.build.<async>
dart:async                                                      _asyncThenWrapperHelper
package:sky_tools/src/commands/build.dart                       BuildCommand.build
package:sky_tools/src/commands/build.dart 160                   BuildCommand.buildInTempDir.<async>
dart:async                                                      _asyncThenWrapperHelper
package:sky_tools/src/commands/build.dart                       BuildCommand.buildInTempDir
package:sky_tools/src/commands/start.dart 80                    StartCommand.runInProject.<async>
dart:async                                                      _asyncThenWrapperHelper
package:sky_tools/src/commands/start.dart                       StartCommand.runInProject

The error is: I don't have a assets/test.json in my project.

Maybe we can update the error message to indicate which file didn't exist?

Thanks for taking a look!

Metadata

Metadata

Assignees

Labels

toolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions