HarmonyOS鸿蒙Next中现有Flutter项目运行模拟器Install Failed: error: failed to install bundle. code:9568347 error: install parse native so failed.

HarmonyOS鸿蒙Next中现有Flutter项目运行模拟器Install Failed: error: failed to install bundle. code:9568347 error: install parse native so failed. 可以

  1. 构建信息

cke_181.png

  1. 运行信息

cke_434.png

  1. 开发工具信息

cke_1926.png

  1. 模拟器信息

cke_2335.png

$ fvm flutter doctor
<span class="hljs-title class_">Flutter</span> assets will be downloaded <span class="hljs-keyword">from</span> <span class="hljs-attr">https</span>:<span class="hljs-comment">//flutter-ohos.obs.cn-south-1.myhuaweicloud.com. Make sure you trust this source!</span>
<span class="hljs-title class_">Doctor</span> summary (to see all details, run flutter doctor -v):
[!] <span class="hljs-title class_">Flutter</span> (<span class="hljs-title class_">Channel</span> [user-branch], <span class="hljs-number">3.22</span><span class="hljs-number">.1</span>-ohos-<span class="hljs-number">0.1</span><span class="hljs-number">.0</span>, on <span class="hljs-title class_">Microsoft</span> <span class="hljs-title class_">Windows</span> [版本 <span class="hljs-number">10.0</span><span class="hljs-number">.26100</span><span class="hljs-number">.3476</span>], locale zh-<span class="hljs-variable constant_">CN</span>)
    ! <span class="hljs-title class_">Flutter</span> version <span class="hljs-number">3.22</span><span class="hljs-number">.1</span>-ohos-<span class="hljs-number">0.1</span><span class="hljs-number">.0</span> on channel [user-branch] at <span class="hljs-attr">D</span>:\fvm\versions\ohos_3<span class="hljs-number">.22</span><span class="hljs-number">.0</span>
      <span class="hljs-title class_">Currently</span> on an <span class="hljs-built_in">unknown</span> channel. <span class="hljs-title class_">Run</span> <span class="hljs-string">`flutter channel`</span> to <span class="hljs-keyword">switch</span> to an official channel.
      <span class="hljs-title class_">If</span> that doesn<span class="hljs-string">'t fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    ! Upstream repository https://gitcode.com/openharmony-sig/flutter_flutter.git is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to https://gitcode.com/openharmony-sig/flutter_flutter.git to dismiss this error.
[√] HarmonyOS toolchain - develop for HarmonyOS devices
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Enterprise 2022 17.4.1)
[√] Android Studio (version 2024.1)
[√] Connected device (4 available)
[√] Network resources

! Doctor found issues in 1 category.

求助:我现有Flutter项目鸿蒙化,关键信息如上,运行模拟器报错:9568347 参考社区多个解决方案(bm工具-调试命令-调测调优-系统 - 华为HarmonyOS开发者)无法解决

问题:

  1. 运行到模拟器报错

  2. 无法在真机上运行,vscode可以识别手机,DevEco Studio无法识别真机,我的设备是华为P40 Pro HarmonyOS版本 4.2.0

6 回复

您好,请问需要降级到哪个版本,相关说明文档链接是否可以提供一下

更多关于HarmonyOS鸿蒙Next中现有Flutter项目运行模拟器Install Failed: error: failed to install bundle. code:9568347 error: install parse native so failed.的实战系列教程也可以访问 https://www.itying.com/category-92-b0.html


你这DevEco Studio 是高版本,不支持纯血鸿蒙5.0以下真机设备安装和调试。

另外Flutter 官方团队并没有对纯血鸿蒙进行适配,请知悉!!

降级到HarmonyOS 5.0.2 Release版本,compatibleSdk 最低兼容版本:4.0.0(10),依然无法识别真机。

你需要用4.几的版本啊!

在HarmonyOS鸿蒙Next中运行现有Flutter项目时,出现“Install Failed: error: failed to install bundle. code:9568347 error: install parse native so failed”错误,通常是由于Flutter项目中的原生库(.so文件)与鸿蒙系统的ABI(应用二进制接口)不兼容导致的。鸿蒙系统使用了自己的ABI,可能与Flutter默认生成的ABI不匹配。

要解决此问题,可以尝试以下步骤:

  1. 检查ABI兼容性:确保Flutter项目中的原生库(.so文件)与鸿蒙系统的ABI兼容。鸿蒙系统支持的ABI包括arm64-v8aarmeabi-v7a等。

  2. 重新编译原生库:如果原生库不兼容,需要重新编译这些库,确保它们与鸿蒙系统的ABI匹配。

  3. 修改Flutter构建配置:在build.gradle文件中,指定与鸿蒙系统兼容的ABI。例如:

    android {
        ...
        defaultConfig {
            ...
            ndk {
                abiFilters "arm64-v8a", "armeabi-v7a"
            }
        }
    }
  4. 清理和重建项目:执行flutter clean命令清理项目,然后重新构建项目。

  5. 检查鸿蒙SDK版本:确保使用的鸿蒙SDK版本与Flutter项目兼容。

通过以上步骤,可以解决“Install Failed: error: failed to install bundle. code:9568347 error: install parse native so failed”错误。

在HarmonyOS鸿蒙Next中运行Flutter项目时,出现“Install Failed: error: failed to install bundle. code:9568347 error: install parse native so failed.”错误,通常是由于Flutter项目中的原生库(.so文件)与鸿蒙系统的兼容性问题导致的。建议检查以下步骤:

  1. 更新Flutter和依赖:确保Flutter SDK和项目依赖库是最新版本。
  2. 检查NDK配置:确认NDK版本与鸿蒙系统兼容,并正确配置。
  3. 重新编译原生库:尝试重新编译项目中的原生库,确保其与鸿蒙系统兼容。
  4. 模拟器兼容性:确认使用的模拟器支持Flutter项目中的原生库。

如果问题仍未解决,建议查阅鸿蒙官方文档或社区寻求进一步帮助。

回到顶部
AI 助手
你好,我是IT营的 AI 助手
您可以尝试点击下方的快捷入口开启体验!