Skip to content

Dart error when building Flutter #37072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vagrantrobbie opened this issue May 23, 2019 · 6 comments
Closed

Dart error when building Flutter #37072

vagrantrobbie opened this issue May 23, 2019 · 6 comments
Labels
legacy-area-front-end Legacy: Use area-dart-model instead. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@vagrantrobbie
Copy link

Compiler message:
Warning: Tried to initialize from a previous compilation (build/app.dill), but couldn't.
Error message was 'RangeError (index): Index out of range: no indices are valid: 0'.
Stacktrace included '#0      Uint8List.[] (dart:typed_data-patch/typed_data_patch.dart:2188:7)
#1      BinaryBuilder.readByte (package:kernel/binary/ast_from_binary.dart:95:27)
#2      BinaryBuilder.readUint32 (package:kernel/binary/ast_from_binary.dart:115:13)
#3      BinaryBuilder.readComponent (package:kernel/binary/ast_from_binary.dart:435:17)
#4      IncrementalCompiler.initializeFromDill (package:front_end/src/fasta/incremental_compiler.dart:618:14)
<asynchronous suspension>
#5      IncrementalCompiler.computeDelta.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:153:36)
<asynchronous suspension>
#6      CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:122:46)
#7      new Future.sync (dart:async/future.dart:224:31)
#8      CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:122:19)
#9      _rootRun (dart:async/zone.dart:1124:13)
#10     _CustomZone.run (dart:async/zone.dart:1021:19)
#11     _runZoned (dart:async/zone.dart:1516:10)
#12     runZoned (dart:async/zone.dart:1463:12)
#13     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:121:12)
#14     IncrementalCompiler.computeDelta (package:front_end/src/fasta/incremental_compiler.dart:127:20)
<asynchronous suspension>
#15     IncrementalCompiler.compile (package:vm/incremental_compiler.dart:48:44)
<asynchronous suspension>
#16     FrontendCompiler.compile.<anonymous closure> (package:vm/frontend_server.dart:341:67)
#17     new Future.<anonymous closure> (dart:async/future.dart:176:37)
#18     _rootRun (dart:async/zone.dart:1120:38)
#19     _CustomZone.run (dart:async/zone.dart:1021:19)
#20     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#21     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#22     _rootRun (dart:async/zone.dart:1124:13)
#23     _CustomZone.run (dart:async/zone.dart:1021:19)
#24     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#25     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:21:15)
#26     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:382:19)
#27     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:416:5)
#28     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:171:12)
'.
This might be a bug.

initialize_from.dill.gz

Dart VM version: 2.1.1-dev.3.2 (Thu Jan 24 11:50:07 2019 +0100) on "macos_x64"

Building my Flutter app
Flutter (Channel beta, v1.5.4-hotfix.2, on Mac OS X 10.14.4 18E226, locale en-NZ)

@a-siva a-siva added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) legacy-area-front-end Legacy: Use area-dart-model instead. labels May 24, 2019
@a-siva
Copy link
Contributor

a-siva commented May 24, 2019

@vagrantrobbie thanks for filing this issue, can you provide us with some instructions on how to reproduce this situation.

@a-siva a-siva added the P2 A bug or feature request we're likely to work on label May 24, 2019
@a-siva
Copy link
Contributor

a-siva commented May 24, 2019

This appears to be a duplicate of issue #37043

@vagrantrobbie
Copy link
Author

vagrantrobbie commented May 26, 2019

@vagrantrobbie thanks for filing this issue, can you provide us with some instructions on how to reproduce this situation.

I don't think I did anything out of the ordinary. I recently moved from Flutter beta channel back to stable. I just ran a debug build of my Flutter application and then this error was thrown. I compiled successfully after trying again but now my IDE (Intellij IDEA Ultimate) has Dart Analyzer package linker errors even though my application still compiles and runs.

Can I provide any more logs? Like I say, I don't think I have done anything different than any other build.

@a-siva
Copy link
Contributor

a-siva commented May 28, 2019

No more logs are required, we think the problem you ran into is similar to the one documented in issue #37043 .

@jensjoha
Copy link
Contributor

Thank you for reporting this.
This is caused by the file we try to initialize from being empty. This can happen if for instance launching several instances working on the same file (e.g. one instance is overwriting the file while the other is reading it). As long as it doesn't happen all the time it's nothing to worry about.
I recently landed d8739b5 to make sure we don't even try to load when the file is empty, and this warning will thus be avoided.

@vagrantrobbie
Copy link
Author

OK. Maybe I had hit the 'run' button too many times in my IDE.

Thanks for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-front-end Legacy: Use area-dart-model instead. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants