Fixing “Install Failed: code:9568347 – install parse native so failed” for a HarmonyOS Native (C++) Project
Problem Description
When deploying a freshly created Native (C++) project from DevEco Studio to a HarmonyOS target, the IDE fails with:
Install Failed: error: failed to install bundle.
code:9568347
error: install parse native so failed.
The Run window also shows:
$ hdc shell rm -rf data/local/tmp/83bffd003aee46389320d1b6f0ac9002
Launch com.huawei.myapplication failed, starting handle failure progress
Error while Deploy Hap
Background Knowledge
Error 9568347 indicates the local .so cannot be parsed during HAP installation—most commonly because the ABI of the native library inside the HAP does not match the device’s supported ABI(s) or the HAP doesn’t contain any matching ABI at all. On HarmonyOS, physical devices are typically arm64-v8a, while emulators are usually x86_64. If you build only for x86_64 and deploy to an ARM64 phone (or vice-versa), installation fails with 9568347. (Gitee)
DevEco Studio controls native compilation through the module’s build-profile.json5 → buildOption.externalNativeOptions (CMake path, arguments, cppFlags, and abiFilters to choose which ABIs to compile). (developer.huawei.com)
Troubleshooting Process
1.Identify the target ABI
-
Physical device (over USB):
hdc shell uname -m # aarch64 -> ARM64 device, x86_64 -> emulatoror
hdc shell param get const.product.cpu.abilistCompare with your project’s configured ABIs. (CSDN)
2.Check the HAP actually contains the right .so
- If you’re deploying to a device (ARM64) but only built x86_64, the installer will fail to parse native libs (9568347). The reverse is also true for the emulator. This mismatch is a frequently reported cause. (developer.huawei.com)
3.Confirm your module is the one building the native code
- The
build-profile.json5change must be applied at the module level (e.g.,entry/), not only in a separate library module. (device.harmonyos.com)
Analysis Conclusion
The default native template can compile for an ABI that doesn’t match your current runtime target. When no matching ABI is found inside the HAP, Bundle Manager reports 9568347 and aborts installation. Ensuring your build includes the ABI(s) for your target (device and/or emulator) resolves the failure. (Gitee)
Solution
Add abiFilters under your module’s build-profile.json5 → buildOption.externalNativeOptions so the NDK build produces .so files for the ABI(s) you actually deploy to.
Solution-1 — Single target (physical device only, ARM64)
{
"apiType": "stageMode",
"buildOption": {
"externalNativeOptions": {
"path": "./src/main/cpp/CMakeLists.txt",
"arguments": "",
"cppFlags": "",
"abiFilters": ["arm64-v8a"]
}
},
"buildOptionSet": [
{
"name": "release",
"arkOptions": {
"obfuscation": {
"ruleOptions": {
"enable": false,
"files": ["./obfuscation-rules.txt"]
}
}
},
"nativeLib": {
"debugSymbol": {
"strip": true,
"exclude": []
}
}
}
],
"targets": [
{ "name": "default" },
{ "name": "ohosTest" }
]
}
This builds only arm64-v8a, ideal when you deploy to real ARM64 hardware. (device.harmonyos.com)
Solution-2 — Dual targets (device + emulator)
If you switch between a physical device (ARM64) and the x86_64 emulator, include both:
"externalNativeOptions": {
"path": "./src/main/cpp/CMakeLists.txt",
"arguments": "",
"cppFlags": "",
"abiFilters": ["arm64-v8a", "x86_64"]
}
This produces two native libs and prevents 9568347 when toggling targets. (Ensure any third-party native libs you bundle also provide both ABIs.) (device.harmonyos.com)
Notes
• Keep your CMake path/flags as-is;
abiFiltersonly controls which architectures are compiled/packaged. (developer.huawei.com)• If you still see 9568347, double-check that every native dependency (including prebuilt
.sos) provides the same ABI set you declared. Missing x86 for emulator is a common pitfall. (developer.huawei.com)
Verification Result
-
Device (ARM64): with
abiFilters: ["arm64-v8a"], the app installs and launches successfully on a HarmonyOS phone. -
Emulator (x86_64): with
abiFilters: ["x86_64"](or both ABIs), the HAP installs and runs in the emulator without the 9568347 error.
(These "Welcome" text is coming from CPP layer)
Related Documents or Links
- HarmonyOS/OpenHarmony FAQ: 9568347 – The local .so file fails to be parsed (root cause and guidance). (Gitee)
-
Build configuration:
build-profile.json5&externalNativeOptions(path,arguments,cppFlags,abiFilters). (device.harmonyos.com) - Debug/Run FAQs mentioning modifying
abiFilterswhen ABIs don’t match. (device.harmonyos.com)





Top comments (0)