运用flutter|运用flutter 构建一个发布版(release)APK
问题描述:
当我在配置好app签名、开启代码混淆后,直接build项目一切正常,然而当我执行以下命令时
errors如下:cd( 为您的工程目录).
运行flutter build apk (flutter build 默认会包含 --release选项).
Compiler message:解决办法如下:
Error: SDK root directory not found: file:///Users/macuser/Programs/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk_product/.
Error: Error when reading 'file:///Users/macuser/Programs/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk_product/platform_strong.dill': No such file or directory
Error: Error when reading 'file:///Users/macuser/Programs/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk_product/platform_strong.dill': No such file or directory
Unhandled exception:
Crash when compiling package:flutter_app/main.dart,
at character offset null:
RangeError (index): Index out of range: no indices are valid: 0
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)
1、找到该文件 ../flutter/bin/cache 并执行 rm -rf 删除操作【运用flutter|运用flutter 构建一个发布版(release)APK】即可解决问题:
2、 重新执行 fluttor doctor -v 命令
文章图片
image.png
推荐阅读
- 排序(归并排序)
- Flutter的ListView
- 构建App(一)(框架与结构)
- 如何在手机上查看测试vue-cli构建的项目
- 用Go构建区块链——3.持久化和命令行
- 日常工作总结之UML图的运用
- Flutter自定义view|Flutter自定义view —— 闯关进度条
- 8、Flask构建弹幕微电影网站-搭建后台页面-密码修改、主页控制面板
- 倾诉
- 构建你的知识体系,让你学习效能倍增!