Compiling Error in flutter: NoSuchMethodError: The getter 'isEof' was called on null

by David A Havel   Last Updated August 14, 2019 05:01 AM

While trying to debug my flutter app on my emulator I randomly started to get this compiling error. I tried upgrading my flutter to the latest release. Not getting any formatting or otherwise errors in my code. The only thing I can think might be the issue is that I changed the encoding while on a different computer of the dart file that is the root of the cause with notepad.

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)

There isn't any error in the code that I can see. Its all very simple basic code for a page I haven't really started working on. Can Something like this cause this error?



Answers 1


Just confirmed my own Thought that it was the notepad's encoding. I changed it to UTF-16 when UTF-8 is what dart files are default. I guess that matters in flutter.

David A Havel
David A Havel
August 14, 2019 04:57 AM

Related Questions


Updated July 08, 2019 07:01 AM

Updated December 24, 2018 05:01 AM

Updated May 05, 2019 13:01 PM

Updated May 03, 2019 14:01 PM