HarmonyOS鸿蒙Next中仓颉容器节点下包含多于1个容器节点时,启动闪退
HarmonyOS鸿蒙Next中仓颉容器节点下包含多于1个容器节点时,启动闪退
系统环境
DevEoc Studio 5.0.3 Release
Build Version: 5.0.9.300, built on March 13, 2025
Mate 70 5.0.0.135 SP6
问题描述
仓颉鸿蒙容器节点下包含多于1个容器节点时,启动闪退
```vbnet
03-24 09:12:34.489 48474-48474 C01719/cjappspawn/ffrt pid-48474 W 1:ChildHandle:147 ffts shared library handle is null
03-24 09:12:34.492 48474-48474 C02C02/PARAM pid-48474 I [param_request.c:326]ResetParamSecurityLabel g_clientFd: -1
03-24 09:12:34.492 48474-48474 C02C11/com.exa...mony/APPSPAWN pid-48474 E [appspawn_common.c:518]no need set fd info 1, 0
03-24 09:12:34.500 48474-48474 C02C11/com.exa...mony/APPSPAWN pid-48474 E [sandbox_utils.cpp:344]errno is: 13, private mount to /mnt/sandbox/100/com.example.imagetestharmony/vendor/etc/vulkan '524288' failed
03-24 09:12:34.500 48474-48474 C02C11/com.exa...mony/APPSPAWN pid-48474 E [sandbox_utils.cpp:344]errno is: 13, private mount to /mnt/sandbox/100/com.example.imagetestharmony/vendor/etc/hiai '524288' failed
03-24 09:12:34.502 48474-48474 C02C11/com.exa...mony/APPSPAWN pid-48474 E [sandbox_utils.cpp:344]errno is: 13, private mount to /mnt/sandbox/100/com.example.imagetestharmony/data/service/el0/public/for-all-app '524288' failed
03-24 09:12:34.503 48474-48474 C02C11/com.exa...mony/APPSPAWN pid-48474 E [sandbox_utils.cpp:344]errno is: 13, private mount to /mnt/sandbox/100/com.example.imagetestharmony/chip_prod/lib64/passthrough '524288' failed
03-24 09:12:34.507 48474-48474 C02C11/com.exa...mony/APPSPAWN pid-48474 E [sandbox_dec.c:190]open dec file fail.
03-24 09:12:34.507 48474-48474 C02C11/com.exa...mony/APPSPAWN pid-48474 E [appspawn_silk.c:118]Load silk library failed for configItems is NULL
03-24 09:12:34.507 48474-48474 C05A06/com.exa...ony/CODE_SIGN pid-48474 E [XpmIoctl]:Ioctl cmd 40087803 failed: Permission denied (ignore)
03-24 09:12:34.521 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libhilog_ndk.z.so, namespace default has no inherits, errno=2
03-24 09:12:34.521 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libhitrace_ndk.z.so, namespace default has no inherits, errno=2
03-24 09:12:34.524 48474-48485 A00008/com.exa...NGJIE-RUNTIME pid-48474 I 2025-03-24 09:12:34.524127 48485 total gc thread count 2, helper thread count 1
03-24 09:12:34.524 48474-48488 A00008/com.exa...NGJIE-RUNTIME pid-48474 I 2025-03-24 09:12:34.524693 48488 I FinalizerProcessor thread started
03-24 09:12:34.524 48474-48487 A00008/com.exa...NGJIE-RUNTIME pid-48474 I 2025-03-24 09:12:34.524713 48487 I [GC] CollectorResources Thread begin.
03-24 09:12:34.528 48474-48485 A00008/com.exa...NGJIE-RUNTIME pid-48474 I 2025-03-24 09:12:34.528181 48485 I Cangjie runtime started.
03-24 09:12:34.528 48474-48485 A00008/com.exa...NGJIE-RUNTIME pid-48474 I 2025-03-24 09:12:34.528195 48485 Runtime parameter:
Heap size: 262144(KB)
Region size: 64(KB)
Exemption threshold: 0.80
Heap utilization: 0.80
Heap growth: 1.15
Allocation rate: 10240.00(MB/s)
Alloction wait time: 1000ns
GC Threshold: 262144(KB)
Garbage threshold: 0.50
GC interval: 150ms
Backup GC interval: 240s
GC threads factor: 8
Log level: 4
Thread stack size: 2048(KB)
Cangjie stack size: 2048(KB)
Processor number: 8
03-24 09:12:34.528 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libohos.ability.so, namespace ndk has no inherits, errno=2
03-24 09:12:34.528 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libohos.window.so, namespace ndk has no inherits, errno=2
03-24 09:12:34.529 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libohos.component.so, namespace ndk has no inherits, errno=2
03-24 09:12:34.529 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libohos.webview.so, namespace ndk has no inherits, errno=2
03-24 09:12:34.529 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libohos.state_manage.so, namespace ndk has no inherits, errno=2
03-24 09:12:34.529 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libohos.image.so, namespace ndk has no inherits, errno=2
03-24 09:12:34.529 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libohos.resource_manager.so, namespace ndk has no inherits, errno=2
03-24 09:12:34.529 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libohos.hi_tracemeter.so, namespace ndk has no inherits, errno=2
03-24 09:12:34.529 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libohos.color_manager.so, namespace ndk has no inherits, errno=2
03-24 09:12:34.529 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libohos.ffi.so, namespace ndk has no inherits, errno=2
03-24 09:12:34.529 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libohos.eventhub.so, namespace ndk has no inherits, errno=2
03-24 09:12:34.529 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libohos.base.so, namespace ndk has no inherits, errno=2
03-24 09:12:34.529 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libohos.hilog.so, namespace ndk has no inherits, errno=2
03-24 09:12:34.530 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libohos.ark_interop.so, namespace ndk has no inherits, errno=2
03-24 09:12:34.581 48474-48474 A00000/com.exa...ny/CJ-FFIBind pid-48474 I injectFrameworkCJFuncs success
03-24 09:12:34.582 48474-48474 C01321/com.exa...ony/JsRuntime pid-48474 W [connect_server_manager.cpp:284]not Connected
03-24 09:12:34.583 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header libcj_debugger.z.so, namespace ndk has no inherits, errno=2
03-24 09:12:34.583 48474-48474 C03F00/MUSL-LDSO pid-48474 E Error loading header: can't find library libcj_debugger.z.so in namespace: default
更多关于HarmonyOS鸿蒙Next中仓颉容器节点下包含多于1个容器节点时,启动闪退的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
代码中有几处错误:
-
width('100%')
,height('70%')
这类属性的入参不支持String类型,需要修改成100.percent
的形式。 -
String类型建议使用双引号包括,而非单引号。
更多关于HarmonyOS鸿蒙Next中仓颉容器节点下包含多于1个容器节点时,启动闪退的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
在HarmonyOS鸿蒙Next中,仓颉容器节点下包含多于1个容器节点时,启动闪退的问题可能与容器节点的层级结构或资源管理机制有关。鸿蒙系统的UI框架采用声明式UI设计,容器节点的嵌套和布局需要遵循特定的规则。当多个容器节点在同一层级下时,可能会导致资源分配冲突或布局计算异常,从而引发应用闪退。
具体原因可能包括:
- 容器节点层级冲突:多个容器节点在同一层级下,可能导致布局计算时出现冲突,系统无法正确处理嵌套关系。
- 资源管理异常:多个容器节点可能竞争同一资源(如内存或渲染资源),导致系统无法正常分配或释放资源。
- 布局规则限制:鸿蒙系统对容器节点的嵌套和布局有严格的规则,违反这些规则可能导致应用崩溃。
解决此类问题,需检查容器节点的层级结构和布局规则,确保符合鸿蒙系统的设计规范。同时,避免在同一层级下放置过多容器节点,合理分配资源。
在HarmonyOS鸿蒙Next中,如果仓颉容器节点下包含多于1个容器节点,可能会导致启动闪退。这通常是由于容器节点的配置或资源冲突引起的。建议检查以下几点:
- 确保每个容器节点的配置正确且不冲突;
- 检查资源分配是否合理,避免资源争用;
- 更新到最新版本的HarmonyOS,以获取最新的修复和优化。
如果问题依旧,建议联系华为技术支持获取进一步帮助。