简体   繁体   English

Flutter 无法混淆和剥离符号

[英]Flutter unable to obfuscate and strip symbols

I'm unable to obfuscate or remove debug symbols as per this documentation https://flutter.dev/docs/deployment/obfuscate我无法按照本文档https://flutter.dev/docs/deployment/obfuscate混淆或删除调试符号

my command:我的命令:

flutter build apk --target-platform android-arm,android-arm64 --obfuscate --split-debug-info=/symbols

output: output:

Could not find an option named "obfuscate".


Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.

You have to check that your are at least on the on 1.16.2 version of Flutter as explained there Supported as of Flutter 1.16.2您必须检查您是否至少在 Flutter 的 1.16.2 版本上, Supported as of Flutter 1.16.2所述受支持

I'm currently on the 1.17.0 version and this command is working well: flutter build apk --obfuscate --split-debug-info=<app_name>/symbols我目前使用的是 1.17.0 版本,并且此命令运行良好: flutter build apk --obfuscate --split-debug-info=<app_name>/symbols

upgrade your flutter using使用升级您的 flutter

flutter upgrade 

command and then use命令,然后使用

flutter clean 

command to clean any previous build cache then try again.命令清除任何以前的构建缓存,然后重试。

One of the options which works is --[no-]shrink有效的选项之一是--[no-]shrink

flutter build apk --release --target-platform=android-arm64 --shrink

Whether to enable code shrinking on release mode.是否在发布模式下启用代码收缩。 When enabling shrinking, you also benefit from obfuscation, which shortens the names of your app's classes and members, and optimization, which applies more aggressive strategies to further reduce the size of your app.启用缩小时,您还可以从混淆(缩短应用程序的类和成员的名称)和优化(应用更积极的策略以进一步减小应用程序的大小)中受益。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM