0

当试图在 IntelliJ IDEA 中编译/运行我的 Flutter 项目时,我收到了这个错误(没有提示它与我的代码的哪一部分相关)。请问有什么想法吗?谢谢!!

Unhandled exception:
NoSuchMethodError: The getter 'file' was called on null.
Receiver: null
Tried calling: file
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
#1      ProgramCompiler.visitAssertStatement (package:dev_compiler/src/kernel/compiler.dart:3468:59)
#2      ProgramCompiler._initializeFields (package:dev_compiler/src/kernel/compiler.dart:1521:20)
#3      ProgramCompiler._emitConstructorBody (package:dev_compiler/src/kernel/compiler.dart:1392:14)
#4      ProgramCompiler._emitConstructor.<anonymous closure>.<anonymous closure> (package:dev_compiler/src/kernel/compiler.dart:1355:19)
#5      ProgramCompiler._superDisallowed (package:dev_compiler/src/kernel/compiler.dart:3122:24)
#6      ProgramCompiler._emitConstructor.<anonymous closure> (package:dev_compiler/src/kernel/compiler.dart:1354:15)
#7      ProgramCompiler._withLetScope (package:dev_compiler/src/kernel/compiler.dart:2096:25)
#8      ProgramCompiler._withCurrentFunction (package:dev_compiler/src/kernel/compiler.dart:3112:18)
#9      ProgramCompiler._emitConstructor (package:dev_compiler/src/kernel/compiler.dart:1352:16)
#10     ProgramCompiler._defineConstructors (package:dev_compiler/src/kernel/compiler.dart:972:38)
#11     ProgramCompiler._emitClassDeclaration (package:dev_compiler/src/kernel/compiler.dart:567:19)
#12     ProgramCompiler._emitClass (package:dev_compiler/src/kernel/compiler.dart:510:21)
#13     List.forEach (dart:core-patch/growable_array.dart:282:8)
#14     ProgramCompiler._emitLibrary (package:dev_compiler/src/kernel/compiler.dart:459:23)
#15     List.forEach (dart:core-patch/growable_array.dart:282:8)
#16     ProgramCompiler.emitModule (package:dev_compiler/src/kernel/compiler.dart:345:15)
#17     JavaScriptBundler.compile (package:frontend_server/src/javascript_bundle.dart:133:33)
<asynchronous suspension>
....
Finished with error: the Dart compiler exited unexpectedly.
Failed to compile application.
4

0 回答 0