Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter has exited unexpectedly, Error reading dependency

Recently, my code has unexpectedly stopped compiling when I try to debug. I'm running Flutter v0.5.1

The only reason I can think of to explain this is as this happened after I moved my flutter SDK from my desktop to a seperate folder.

This is the error I receive:

Error reading dependency file C:\Users\Jake\Desktop\Other\Flutter\myproject\build\app\intermediates\flutter\debug\snapshot_blob.bin.d: java.lang.ArrayIndexOutOfBoundsException: 1
Error reading dependency file C:\Users\Jake\Desktop\Other\Flutter\myproject\build\app\intermediates\flutter\debug\snapshot_blob.bin.d: java.lang.ArrayIndexOutOfBoundsException: 1
Error reading dependency file C:\Users\Jake\Desktop\Other\Flutter\myproject\build\app\intermediates\flutter\debug\snapshot_blob.bin.d: java.lang.ArrayIndexOutOfBoundsException: 1
Oops; flutter has exited unexpectedly.
Crash report written to C:\Users\Jake\Desktop\Other\Flutter\myproject\flutter_14.log;
please let us know at https://github.com/flutter/flutter/issues.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\Jake\Desktop\flutter_windows_v0.5.1-beta\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 435
* What went wrong:
Execution failed for task ':app:flutterBuildDebug'.
> Process 'command 'C:\Users\Jake\Desktop\flutter_windows_v0.5.1-beta\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.
* Get more help at https://help.gradle.org
BUILD FAILED in 12s
Gradle build failed: 1
Exited (sigterm)

This is the Flutter Log thats dumped in the myproject folder:

Flutter crash report; please file at https://github.com/flutter/flutter/issues.

## command

flutter build bundle --suppress-analytics --target C:\Users\Jake\Desktop\Other\Flutter\myproject\lib\main.dart --preview-dart-2 --filesystem-scheme org-dartlang-root --depfile C:\Users\Jake\Desktop\Other\Flutter\myproject\build\app\intermediates\flutter\debug/snapshot_blob.bin.d --asset-dir C:\Users\Jake\Desktop\Other\Flutter\myproject\build\app\intermediates\flutter\debug/flutter_assets

## exception

RangeError: RangeError (index): Invalid value: Only valid value is 0: 1

```
#0      List.[] (dart:core-patch/dart:core/growable_array.dart:141)
#1      readDepfile (package:flutter_tools/src/base/fingerprint.dart:174)
<asynchronous suspension>
#2      Fingerprinter._getPaths (package:flutter_tools/src/base/fingerprint.dart:88)
<asynchronous suspension>
#3      Fingerprinter.doesFingerprintMatch (package:flutter_tools/src/base/fingerprint.dart:60)
<asynchronous suspension>
#4      KernelCompiler.compile (package:flutter_tools/src/compile.dart:104)
<asynchronous suspension>
#5      build (package:flutter_tools/src/bundle.dart:79)
<asynchronous suspension>
#6      BuildBundleCommand.runCommand (package:flutter_tools/src/commands/build_bundle.dart:72)
<asynchronous suspension>
#7      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:344)
<asynchronous suspension>
#8      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:279)
<asynchronous suspension>
#9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142)
<asynchronous suspension>
#10     _rootRun (dart:async/zone.dart:1126)
#11     _CustomZone.run (dart:async/zone.dart:1023)
#12     runZoned (dart:async/zone.dart:1501)
#13     AppContext.run (package:flutter_tools/src/base/context.dart:141)
<asynchronous suspension>
#14     FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:270)
#15     CommandRunner.runCommand (package:args/command_runner.dart:194)
<asynchronous suspension>
#16     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:309)
<asynchronous suspension>
#17     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142)
<asynchronous suspension>
#18     _rootRun (dart:async/zone.dart:1126)
#19     _CustomZone.run (dart:async/zone.dart:1023)
#20     runZoned (dart:async/zone.dart:1501)
#21     AppContext.run (package:flutter_tools/src/base/context.dart:141)
<asynchronous suspension>
#22     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:265)
<asynchronous suspension>
#23     CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:109)
#24     new Future.sync (dart:async/future.dart:222)
#25     CommandRunner.run (package:args/command_runner.dart:109)
#26     FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:174)
#27     run.<anonymous closure> (package:flutter_tools/runner.dart:59)
<asynchronous suspension>
#28     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142)
<asynchronous suspension>
#29     _rootRun (dart:async/zone.dart:1126)
#30     _CustomZone.run (dart:async/zone.dart:1023)
#31     runZoned (dart:async/zone.dart:1501)
#32     AppContext.run (package:flutter_tools/src/base/context.dart:141)
<asynchronous suspension>
#33     runInContext (package:flutter_tools/src/context_runner.dart:43)
<asynchronous suspension>
#34     run (package:flutter_tools/runner.dart:50)
#35     main (package:flutter_tools/executable.dart:49)
<asynchronous suspension>
#36     main (file:///E:/b/build/slave/Windows_Flutter_Packaging/build/archive/flutter/packages/flutter_tools/bin/flutter_tools.dart:8)
#37     _startIsolate.<anonymous closure> (dart:isolate-patch/dart:isolate/isolate_patch.dart:277)
#38     _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165)
```

## flutter doctor

```
[✓] Flutter (Channel beta, v0.5.1, on Microsoft Windows [Version 10.0.17134.228], locale en-GB)
    • Flutter version 0.5.1 at C:\Users\Jake\Desktop\flutter_windows_v0.5.1-beta\flutter
    • Framework revision c7ea3ca377 (3 months ago), 2018-05-29 21:07:33 +0200
    • Engine revision 1ed25ca7b7
    • Dart version 2.0.0-dev.58.0.flutter-f981f09760

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at C:\Users\Jake\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
    • All Android licenses accepted.

[✓] Android Studio (version 3.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[!] VS Code, 64-bit edition (version 1.25.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected devices (1 available)
    • HTC Desire 510 • CC58XY408727 • android-arm • Android 4.4.3 (API 19)

! Doctor found issues in 1 category.
```

The errors; ✗ Flutter plugin not installed; ✗ Dart plugin not installed shouldn't be an issue, they are both installed according to VSCode and apparently this issue, due to case sensitive values not being recognised by flutter doctor, affects everyone on VSCode.

like image 584
Jake Avatar asked Dec 05 '22 11:12

Jake


1 Answers

This was fixed after Günter suggested a flutter clean.

like image 176
Jake Avatar answered Jan 29 '23 09:01

Jake