赞
踩
flutter run --release
命令来构建release版本,就不会出现黑屏问题。打包Android版本的APP,使用以下命令:
flutter build apk //默认包含--release选项
打包好的APK位于:<app dir>/build/app/outputs/apk/app-release.apk
FlutterGithub调试debug都正常,但在打包时出现的错误:
FAILURE: Build failed with an exception.* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not resolve io.flutter:flutter_embedding_debug:1.0.0-540786dd51f112885a89792d678296b95e6622e5.
Required by:
project :app
> Skipped due to earlier error
> Skipped due to earlier error
> Skipped due to earlier error
.................
解决方法:更改sdk的版本。具体是在pubspec.yaml配置文件中:
environment:
sdk: ">=2.2.2 <3.0.0" //此处更改为 sdk: ">=2.1.0 <3.0.0"
重新打包即可。
参考:https://github.com/flutter/flutter/issues/56861
项目地址:用flutter实现的一款界面精美的Github App
介绍:用Flutter实现的一款界面精美、功能较全、体验良好的Github客户端。支持多语言、换肤等功能。代码简单易懂且有充分的注释,很适用于学习Flutter。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。