Flutter开发HarmonyOS鸿蒙Next应用的时候模拟机安装启动白屏真机报错
Flutter开发HarmonyOS鸿蒙Next应用的时候模拟机安装启动白屏真机报错
【任务描述】
控制台日志:
(base) hufeifan@hufeifandeair explore % flutter doctor -v
[!] Flutter (Channel 3.7.12-ohos-1.0.3, 3.7.12-ohos-1.0.3, on macOS 14.6.1 23G93 darwin-arm64, locale zh-Hans-CN)
• Flutter version 3.7.12-ohos-1.0.3 on channel 3.7.12-ohos-1.0.3 at
/Users/hufeifan/Downloads/flutter-harmony/flutter_flutter
! Upstream repository https://gitee.com/openharmony-sig/flutter_flutter.git is not a standard remote.
Set environment variable "FLUTTER_GIT_URL" to https://gitee.com/openharmony-sig/flutter_flutter.git to dismiss
this error.
• Framework revision c30116276c (4 weeks ago), 2024-12-10 09:12:53 +0000
• Engine revision 1a65d409c7
• Dart version 2.19.6
• DevTools version 2.20.1
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git"
directly to perform update checks and upgrades.
[✓] HarmonyOS toolchain - develop for HarmonyOS devices
• OpenHarmony Sdk at /Applications/DevEco-Studio.app/Contents/sdk, available api versions has [13:default]
• Ohpm version 5.0.10
• Node version v18.20.1
• Hvigorw binary at /Applications/DevEco-Studio.app/Contents/tools/hvigor/bin/hvigorw
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/hufeifan/Library/Android/sdk
• Platform android-34, build-tools 30.0.3
• ANDROID_HOME = /Users/hufeifan/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16C5032a
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] VS Code (version 1.96.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.102.0
[✓] Connected device (3 available)
• 127.0.0.1:5555 (mobile) • 127.0.0.1:5555 • ohos-arm64 • Ohos OpenHarmony-5.0.1.110 (API 13)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.6.1 23G93 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 131.0.6778.206
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 2 categories.
(base) hufeifan@hufeifandeair explore % flutter build hap --target-platform ohos-arm64 --release
start hap build...
Running Hvigor task assembleHap... 30.8s
✓ Built ohos/entry/build/default/outputs/default/entry-default-signed.hap (69.2MB).
测试平台:https://www.testin.cn/ 华为 Pura 70 Pro HarmonyOS NEXT.5.0.0.123
真机报错信息: uid:6c5650b2-b52c-4d09-bce4-5fa98589c163 [Info]App install path:/Users/testin/testin_swj_data/download/20250109/D022201E1E28823C73DC65D020AFB9F0_144008946199875.hap, queuesize:0, msg:error: failed to install bundle. code:9568322 error: signature verification failed due to not trusted app source. AppMod finish
安装entry-default-unsigned.hap包是上述同样的报错。 或使用 flutter build hap --release 也不行
使用DevEco-Studio启动模拟器也是白屏,运行日志: 11:13:13.003: build task in 10 s 207 ms 11:13:13.008: Launching com.example.explore 11:13:13.028: $ hdc shell aa force-stop com.example.explore 11:13:13.166: $ hdc shell mkdir data/local/tmp/83fc241926724ed89171fc980f2d0868 11:13:13.386: $ hdc file send /Users/hufeifan/Desktop/explore/ohos/entry/build/default/outputs/default/entry-default-signed.hap “data/local/tmp/83fc241926724ed89171fc980f2d0868” in 220 ms 11:13:13.965: $ hdc shell bm install -p data/local/tmp/83fc241926724ed89171fc980f2d0868 in 580 ms 11:13:14.169: $ hdc shell rm -rf data/local/tmp/83fc241926724ed89171fc980f2d0868 11:13:14.346: $ hdc shell aa start -a EntryAbility -b com.example.explore in 108 ms 11:13:14.352: Launch com.example.explore success in 1 s 344 ms
模拟器是HarmonyOS 5.0.0
【解决方案】
【任务来源】
更多关于Flutter开发HarmonyOS鸿蒙Next应用的时候模拟机安装启动白屏真机报错的实战系列教程也可以访问 https://www.itying.com/category-92-b0.html
更多关于Flutter开发HarmonyOS鸿蒙Next应用的时候模拟机安装启动白屏真机报错的实战系列教程也可以访问 https://www.itying.com/category-92-b0.html
作为IT专家,对于Flutter开发HarmonyOS鸿蒙Next应用时模拟机安装启动白屏、真机报错的问题,以下是一些可能的原因及解决方案:
- 应用启动流程:检查并优化应用启动流程,确保没有执行耗时操作,如复杂计算、大量网络请求或资源加载。
- 应用日志:查看应用日志,特别是启动时的日志,查找错误或警告信息。
- 版本问题:确保鸿蒙系统及应用都已更新到最新版本。同时,确认Flutter SDK和鸿蒙开发环境(如DevEco Studio和相关插件)已正确安装并配置。
- 资源文件:确认应用所需的资源文件是否正确加载。
- 模拟器差异:模拟器与真机环境存在差异,某些应用可能无法正常运行。此外,模拟器运行内存不足也可能导致应用运行不稳定。
如果问题依旧没法解决请联系官网客服,官网地址是:https://www.itying.com/category-93-b0.html 。他们将能够提供更具体的帮助和指导。