Kompilierungsfehler in Flutter: NoSuchMethodError: Der Getter „isEof“ wurde für null aufgerufen

Kompilierungsfehler in Flutter: NoSuchMethodError: Der Getter „isEof“ wurde für null aufgerufen

Beim Versuch, meine Flutter-App auf meinem Emulator zu debuggen, trat zufällig dieser Kompilierungsfehler auf. Ich habe versucht, mein Flutter auf die neueste Version zu aktualisieren. In meinem Code treten keine Formatierungs- oder sonstigen Fehler auf. Das einzige, was meiner Meinung nach das Problem sein könnte, ist, dass ich auf einem anderen Computer die Kodierung der Dart-Datei geändert habe, die die Ursache des Problems mit Notepad ist.

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
U
nhandled exception:
Crash when compiling package:prep_ace/Pages/Engli
sh/en_additional_resource.dart,
at character offset null:
NoSuchMethodError: The getter 'isEof' was called on null.
Receiver: null
Tried calling: isEof
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1      scannerRecovery 
#2      _tokenizeAndRecover (package:front_end/src/fasta/scanner.dart:103:14)
#3      scan (package:front_end/src/fasta/scanner.dart:82:10)
#4      SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:207:28)
<asynchronous suspension>
#5      SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:281:26)
<asynchronous suspension>
#6      Loader.buildOutlines (package:front_end/src/fasta/loader.dart:239:13)
<asynchronous suspension>
#7      KernelTarget.buildOutlines.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:248:20)
<asynchronous suspension>
#8      withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)

<asynchronous suspension>
#9      KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:246:12)

<asynchronous suspension>
#10     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:117:28)
<asynchronous suspension>
#11     withCrashReporting (p
ackage:front_end/src/fasta/crash.dart:122:24)
<asynchronous suspension>
#12     generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:65:10)
<asynchronous
 suspension>
#13     kernelForProgramInternal.<anonymous closure> 
<asynchronous suspension>
#14     CompilerContext.runWithOptions.<anonymous cl
osure> (package:front_end/src/fasta/compiler_context.dart:134:20)
<asynchronous suspension>
#15     CompilerContext.runInC
ontext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:122:46)
#16     new Future.sync (dart
:async/future.dart:224:31)
#17     CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:122:19)
#18     _rootRun (dar
t:async/zone.dart:1124:13)
#20     _runZoned (dart:async/zone.dart:1516:10)
#21     runZoned (dart:async/zone.dart:1463:12)
#22     
CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:121:12)
#23     CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:132:10)
#24     kernelForProgramInternal (package:front_end/src/api_prototype/kern
el_generator.dart:58:32)
<asynchronous suspension>
#25     kernelForProgram (package:front_end/src/api_prototype/
kernel_generator.dart:51:17)
<asynchronous suspension>
#26     compileToKernel (package:vm/kernel_front_end.dart:295:41)
<asynchronous suspension>
#27  
   FrontendCompiler.compile.<anonymous closure> (package:vm/frontend_server.dart:383:56)
#29     _rootRun (dart:async/zone.dart:1120:38)

#30     _CustomZone.run (dart:async/zone.dart:1021:19)
#31     _Cust
omZone.runGuarded (dart:async/zone.dart:923:7)
#33     _rootRun (dart:async/zone.dart:1124:13)

#34     _CustomZone.ru
n (dart:async/zone.dart:1021:19)
#35     _CustomZone.bindCallback.<anonymous c
losure> (dart:async/zone.dart:947:23)
#36     Timer._createTimer.<anonymous clos
ure> (dart:async-patch/timer_patch.dart:21:15)
#37     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:382:19)
#38     _Timer._handle
#39     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)



#0     
 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1      scannerRecovery 
#3      scan 
#4      SourceLoader.token
ize (package:front_end/src/fasta/source/source_loader.dart:207:28)
<asynchronous suspension>
#5      SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:281:26)
<asynchronous suspension>
#6      Loader.buildOu
tlines (package:front_end/src/fasta/loader.dart:239:13)
<asynchronous suspension>
#7      KernelT
#10     generateKernelInternal.<anonymous closure> 
<asynchronous s
uspension>
#11     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
<asynchronou
s suspension>
#12     generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:65:10)
<asynchronous suspension>
#13     kernelForProgramInternal
.<anonymous closure> (package:front_end/src/api_prototype/kernel_generator.dart:59:35)
<asynchronous su
spension>
#14     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compi
ler_context.dart:134:20)
<asynchronous suspension>
#15     CompilerContext.runInContex
t.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_conte
xt.dart:122:46)
#16     new Future.sync (dart:async/future.dart:224:31)
#17     CompilerCo
ntext.runInContext.<anonymous closure> (package:front_end/src/fasta/compile
r_context.dart:122:19)
#18     _rootRun (dart:async/zone.dart:1124:13)
#19     _CustomZone.r
un (dart:async/zone.dart:1021:19)
#20     _runZoned (dart:async/zone.dart:1516:10)
#21     runZone
d (dart:async/zone.dart:1463:12)
#22     CompilerContext.runInContext (package:front_end/src/fas
ta/compiler_context.dart:121:12)
#24     kernelForProgramInternal 
<async
hronous suspension>
#25     kernelForProgram (package:front_end/src/api_prototype/kernel_generator.dart:51:17)
<asynchronous susp
ension>
#26     compileToKernel (package:vm/kernel_front_end.dart:295:41)
<asynchronous suspension>
#27     FrontendCompiler.compile.<an
#28     new Future.<anonymous closure> (dart:async/future.dart:176:37)
#29     _
rootRun (dart:async/zone.dart:1120:38)#30     _CustomZone.run (dart:async/zone.dart:1021:19)
#31     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#
32     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#33     _rootRun (dart:async/zone.dart:1124:13)
#34     _CustomZ
one.run (dart:async/zone.dart:1021:19)
#35     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#36     Timer._createTim
er.<anonymous closure> (dart:async-patch/timer_patch.dart:21:15)
#37     _Timer._runTimers (dart:isolate-patch/timer_impl
.dart:382:19)
#38     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:416:5)
#39     _RawReceivePortImpl._handleMe
ssage (dart:isolate-patch/isolate_patch.dart:172:12)

Compiler failed on D:\OneDrive\Apps in Progress\prep_ace\prep_ace\lib\main.dart

FAILURE: Build failed with an exception.

* Where:
Script 'D:\OneDrive\Apps in Progress\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 765

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebugX86'.
> Process 'command 'D:\OneDrive\Apps in Progress\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

Soweit ich sehen kann, ist im Code kein Fehler. Es ist alles ganz einfacher Basiscode für eine Seite, an der ich noch nicht wirklich gearbeitet habe. Kann so etwas diesen Fehler verursachen?

Antwort1

Habe gerade meinen eigenen Gedanken bestätigt, dass es an der Kodierung des Notizblocks lag. Ich habe es auf UTF-16 geändert, obwohl UTF-8 die Standardeinstellung für Dart-Dateien ist. Ich denke, das ist bei Flutter wichtig.

verwandte Informationen