flutter - 由于 Flutter 代码混淆,创建失败
问题描述
我正在关注本指南:https ://flutter.dev/docs/deployment/obfuscate
运行 Flutter 1.17.5 • 通道稳定
当我运行时:
flutter build apk --obfuscate --split-debug-info=/sample/debug --target-platform android-arm,android-arm64,android-x64
然后我收到以下错误:
Target android_aot_release_android-arm failed: FileSystemException: Creation failed, path =
'/sample' (OS Error: Read-only file system, errno = 30)
Target android_aot_release_android-x64 failed: FileSystemException: Creation failed, path =
'/sample' (OS Error: Read-only file system, errno = 30)
Target android_aot_release_android-arm64 failed: FileSystemException: Creation failed, path =
'/sample' (OS Error: Read-only file system, errno = 30)
build failed.
FAILURE: Build failed with an exception.
* Where:
Script '/Users/user/Developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 882
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command '/Users/user/Developer/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
解决方案
您应该从根目录提供相对路径:
flutter build apk --obfuscate --split-debug-info=./sample/debug
推荐阅读
- python - 将新的父类动态添加到现有对象
- android - 登录 java 时如何修复或避免“检测到 RSA 引擎错误解密/签名”错误
- c - FFmpeg C 音频视频流(麦克风、网络摄像头)同步到 mp4
- ios - 设置 window.rootViewController 并在顶部显示一个视图控制器显示一个空白屏幕(iOS 12)
- css - 视图文本在 React Native 中没有垂直对齐
- c# - 使用 c# 使用内容类型 application/x-www-form-urlencoded 连接到 API(帖子)
- react-native - 在 react-native 中更新 SectionList/FlatList 数据
- c# - 在 Visual Studio 中运行后端时如何运行 Blazor 客户端?
- flutter - Flutter_bloc 包中的 FutureBuilder 和 Snapshot
- oauth - 如何查明用户是否已从 microsoft it's account 注销?