Mac 打包flutter android 版本包,错误记录

1.错误场景:终端运行

flutter build apk --flavor prob -t lib/main.dart --obfuscate --split-debug-info=/.symbols

运行结果

FAILURE: Build failed with an exception.                                
                                                                        
* Where:                                                                
Script '/Users/nvr-dev/Applications/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 991
                                                                        
* What went wrong:                                                      
Execution failed for task ':app:compileFlutterBuildProbRelease'.        
> Process 'command '/Users/nvr-dev/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 18s                                                     
Running Gradle task 'assembleProbRelease'...                            
Running Gradle task 'assembleProbRelease'... Done                  29.3s
Gradle task assembleProbRelease failed with exit code 1

解决:

--obfuscate --split-debug-info=/.symbols

打包命令的这一段指的是混淆打包,这一段去掉,运行“flutter build apk --flavor prob -t lib/main.dart”就可以正常打包了

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容