
내 에뮬레이터에서 Flutter 앱을 디버깅하는 동안 무작위로 이 컴파일 오류가 발생하기 시작했습니다. Flutter를 최신 릴리스로 업그레이드해 보았습니다. 내 코드에 서식이나 기타 오류가 발생하지 않습니다. 제가 생각하는 유일한 문제는 원인의 근본인 dart 파일을 다른 컴퓨터에서 메모장으로 인코딩을 변경한 것입니다.
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)
내가 볼 수 있는 코드에는 오류가 없습니다. 실제로 작업을 시작하지 않은 페이지에 대한 매우 간단한 기본 코드입니다. 이와 같은 오류가 발생할 수 있습니까?
답변1
메모장의 인코딩이라는 내 생각을 방금 확인했습니다. UTF-8이 다트 파일의 기본값인 경우 UTF-16으로 변경했습니다. 플러터에서는 그게 중요한 것 같아요.