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”就可以正常打包了

?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容