flutter架 构项目基础

This commit is contained in:
崔宝新
2026-09-04 15:22:20 +08:00
parent 70967229d0
commit 0c5aee59c0
265 changed files with 35484 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
[OPEN]
# flutter-compile-crash
## 症状
- `flutter run` 编译阶段崩溃:`Crash when compiling: Null check operator used on a null value`
- 堆栈来自 Flutter kernel transformation:`track_widget_constructor_locations.dart`
- `flutter run --no-track-widget-creation` 也无法启动
## 预期
- App 可正常编译启动
## 假设 (待证伪)
- H1: Flutter SDK/Dart 版本与新增依赖(connectivity_plus / flutter_local_notifications / timezone / flutter_timezone)存在最低版本不兼容,导致前端工具链在 kernel transform 阶段崩溃
- H2: Pub 缓存或依赖解析异常(镜像/缓存损坏/半下载)导致编译输入不完整,从而触发 kernel transform NPE
- H3: 代码中存在导致 kernel transform 崩溃的语法/构造(与 Widget 创建追踪相关),例如工具链在处理某处 AST 时拿不到 source location
- H4: Flutter 工具链 bug(特定版本已知问题),需要通过升级/降级 Flutter 或禁用某些 transform 来规避
## 需要收集的证据
- Flutter/Dart 版本:`flutter --version`
- 工具链信息:`flutter doctor -v`
- 依赖解析:`flutter pub get -v` 的关键错误(如版本约束/缓存/镜像)
- 编译日志:`flutter run -v` 的完整崩溃段落(含“是哪一个文件/库正在编译”)
## 进展记录
- 2026-09-02:创建调试记录,等待用户提供版本与 verbose 日志