❯ flutter build apk
💪 Building with sound null safety 💪
../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc: 3186: error: unreachable code
../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc: 3186: error: unreachable code
Dart snapshot generator failed with exit code -6
Dart snapshot generator failed with exit code -6
FAILURE: Build failed with an exception.
* Where:
Script '/Users/friebetill/Applications/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1035
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command '/Users/friebetill/Applications/flutter/bin/flutter'' 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 1m 48s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 109.8s
Gradle task assembleRelease failed with exit code 1
❯ flutter analyze
Analyzing bug...
info • Don't import implementation files from another package • lib/generated_plugin_registrant.dart:7:8 • implementation_imports
1 issue found. (ran in 7.6s)
❯ flutter doctor -v
[✓] Flutter (Channel stable, 2.2.0, on macOS 11.3.1 20E241 darwin-x64, locale en-DE)
• Flutter version 2.2.0 at /Users/friebetill/Applications/flutter
• Framework revision b22742018b (6 days ago), 2021-05-14 19:12:57 -0700
• Engine revision a9d88a4d18
• Dart version 2.13.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/friebetill/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5, Build version 12E262
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.56.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.22.0
[✓] Connected device (3 available)
• Redmi 4X (mobile) • 7c57d3f7d740 • android-arm64 • Android 7.1.2 (API 25)
• macOS (desktop) • macos • darwin-x64 • macOS 11.3.1 20E241 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212
• No issues found!
Steps to Reproduce
flutter create bug.flutter_quill: ^1.3.0as a dependency topubspec.yaml.lib/main.dartcontent to https://gist.github.com/friebetill/3bb5472951cd871c4cdd9d7d346fc6bf.flutter build apk.Expected results:
The APK is built successfully and can be installed.
(The debug version without AOT works without problems. The problem first occurred with Flutter 2.2.0.)
Actual results:
Logs
There are already several similar issues that are already closed: #79441 and #80902. I also found this discussion, but didn't know how to compile the app with
gen_snapshotand--trace-compiler.