HarmonyOS 鸿蒙Next 测试运行 界面空白 是什么原因啊

发布于 1周前 作者 ionicwang 来自 鸿蒙OS

HarmonyOS 鸿蒙Next 测试运行 界面空白 是什么原因啊 代码参考:鸿蒙BLE蓝牙通信开发总结

布局文件是自己简单写的一个布局:

<?xml version="1.0" encoding="utf-8"?>
<DirectionalLayout
    xmlns:ohos="http://schemas.huawei.com/res/ohos"
    ohos:height="match_parent"
    ohos:width="match_parent"
    ohos:alignment="center"
    ohos:orientation="vertical">

    <Text
        ohos:id="$+id:Id_device_name"
        ohos:height="match_parent"
        ohos:width="match_content"
        ohos:text_color="#faaaa"/>

    <Text
        ohos:id="$+id:Id_device_info"
        ohos:height="match_parent"
        ohos:width="match_content"/>

    <Text
        ohos:id="$+id:Id_status"
        ohos:height="match_parent"
        ohos:width="match_content"/>

    <Button
        ohos:id="$+id:Id_scan"
        ohos:height="match_parent"
        ohos:width="match_content"/>

    <Button
        ohos:id="$+id:Id_connect"
        ohos:height="match_parent"
        ohos:width="match_content"/>

    <Text
        ohos:id="$+id:Id_data"
        ohos:height="match_parent"
        ohos:width="match_content"/>

    <Button
        ohos:id="$+id:Id_send"
        ohos:height="match_parent"
        ohos:width="match_content"/>

    <TextField
        ohos:id="$+id:Id_input"
        ohos:height="match_parent"
        ohos:width="match_content"/>

    <Image
        ohos:id="$+id:Id_ble_image"
        ohos:height="match_parent"
        ohos:width="match_parent"
        ohos:image_src="$media:lanya"/>
</DirectionalLayout>

config文件权限:

image.png

以下是测试日志:

03/27 19:57:19: Launching com.xiaowu.bluetooth.demoo
$hdc shell am force-stop com.xiaowu.bluetooth.demoo
$hdc shell bm uninstall com.xiaowu.bluetooth.demoo
$hdc file send D:\BlueTooth2\entry\build\outputs\hap\debug\entry-debug-rich-signed.hap /sdcard/06c59e43db8f43259be9ed069127bdc6/entry-debug-rich-signed.hap
$hdc shell bm install -p /sdcard/06c59e43db8f43259be9ed069127bdc6/
$hdc shell rm -rf /sdcard/06c59e43db8f43259be9ed069127bdc6
$hdc shell am start -n "com.xiaowu.bluetooth.demoo/com.xiaowu.bluetooth.MainAbilityShellActivity"
Connected to process 2462 on device 'huawei-noh_an00-PQY0220B19029916'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/ActivityThread: Init compatible state: true
D/HwFrameworkSecurityPartsFactory: HwFrameworkSecurityPartsFactory in.
I/HwFrameworkSecurityPartsFactory: add HwFrameworkSecurityPartsFactory to memory.
D/BehaviorCollectManager: hook process for AI virus second
I/BehaviorCollectManager: bindAnalyzerService: huawei.android.security.IAppBehaviorDataAnalyzer$Stub$Proxy@c8de8f1 pid:2462
D/ApplicationLoaders: createClassLoader zip: /data/app/com.xiaowu.bluetooth.demoo-AEpBECBdPItd4Eg33ASRaA==/base.apk librarySearchPath: /data/app/com.xiaowu.bluetooth.demoo-AEpBECBdPItd4Eg33ASRaA==/lib/arm64 libraryPermittedPath: /data/user/0/com.xiaowu.bluetooth.demoo parent: java.lang.BootClassLoader@d3a547b targetSdkVersion: 29 isBundled: false classLoaderName: null sharedLibraries: null
W/bluetooth.demo: Can't mmap dex file /data/app/com.xiaowu.bluetooth.demoo-AEpBECBdPItd4Eg33ASRaA==/base.apk!classes.dex directly; please zipalign to 4 bytes. Falling back to extracting file.
W/bluetooth.demo: JIT profile information will not be recorded: profile file does not exits.
I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.xiaowu.bluetooth.demoo#10391#256
need clear apicache,because volumes changed,oldCnt=0 newCnt=1
I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.xiaowu.bluetooth.demoo#10391#0
need clear apicache,because volumes changed,oldCnt=1 newCnt=1
E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@2b39b57
I/HwTypeface: updateFont: scale=1.0
D/SystemFonts: areFontsVariable: script=Hans
I/ActivityThread: finishPreloaded preloadStatus 0
I/HwPartIawareFactory: add android.common.HwPartIawareFactoryImpl to memory.
I/AwareBitmapCacher: init processName:com.xiaowu.bluetooth.demoo pid=2462 uid=10391
D/OpenGLRenderer: disableOutlineDraw is true
I/OpenGLRenderer: RenderThread: progress name = [com.xiaowu.bluetooth.demoo], viewCornerType = 0
I/iGraphics: [0020080c] pn: com.xiaowu.bluetooth.demoo, p: 2462
[0030080c] no spt app: com.xiaowu.bluetooth.demoo
E/libdnetwork: GetLocalBasicInfo: get local node basic info binder invoke failed
V/ActivityThread: callActivityOnCreate
I/AGP: Start to register native methods for AGP
I/AGP: Finish to register native methods for AGP
D/AGP: VsyncSchedulerAndroid:jni is registered.
Typeface:native typeface ptr 0x70ad467b20
D/AGP: Typeface:native typeface ptr 0x70ad467b20
Typeface:native typeface ptr 0x70ad4e61a0
Typeface:native typeface ptr 0x70ad467b20
Typeface:native typeface ptr 0x70ad467dc0
Typeface:native typeface ptr 0x70ad467c40
Initialize system fonts.
I/DecorView[]: pkgName:com.xiaowu.bluetooth.demoo old windowMode:0 new windoMode:1, isFixedSize:false
I/OverScrollerOptimization: start init SmartSlideOverScroller and get the overscroller config
get the overscroller config
I/AwareAppScheduleManager: post cache drawable res id to aware, resId = 17302091, packagename = com.xiaowu.bluetooth.demoo, cost time = 6814062
I/AwareAppScheduleManager: post cache drawable res id to aware, resId = 17301651, packagename = com.xiaowu.bluetooth.demoo, cost time = 6664062
W/WindowDecorActionBar: should not do the transition or the transition anim is null or it is running or the mContainer view is null or mContainer view hasn't been drawn to screen
I/Icon_Cache: add:2130771968#com.xiaowu.bluetooth.demoo
D/HwGalleryCacheManagerImpl: mIsEffect:false
D/ActivityThread: add activity client record, r= ActivityRecord{faaba46 token=android.os.BinderProxy@c17d644 {com.xiaowu.bluetooth.demoo/com.xiaowu.bluetooth.MainAbilityShellActivity}} token= android.os.BinderProxy@c17d644
D/AGP: Initialize system language.
D/AGP: BF:Client
D/AGP: GetCursorCoordsByPosition textLayout_ is not ready.
D/AGP: GetCursorCoordsByPosition textLayout_ is not ready.
Error UpdatePivot not in scene
D/AGP: BF:AGPWindow back to top(flag=1)
E/AGP: BF:AGPWindow OnTop fail
I/HwPartMagicWindowFactory: add android.common.HwPartMagicWindowFactoryImpl to memory.
D/MouseWheelSynthesizer: mMoveStepInDp: 64, mMoveStepInPixel: 192, mUpTimeDelayed: 100
D/ViewRootImpl: ViewRootImpl mIsInProductivePCDisplay: false
I/HwPartPowerOfficeFactory: add HwPartPowerOfficeFactoryImpl to memory.
I/DecorView[]: pkgName:com.xiaowu.bluetooth.demoo old windowMode:1 new windoMode:1, isFixedSize:false
D/InputEventReceiver: dispatchInputInterval 0
I/HiTouch_HiTouchSensor: HiTouch restricted: Keyguard locked restricted.
D/HiTouch_PressGestureDetector: onAttached, package=com.xiaowu.bluetooth.demoo, windowType=1, mIsHiTouchRestricted=true
D/OpenGLRenderer: disableOutlineDraw is true
D/AGP: UIView dtor [UIView ID(267) Id(-1)] 0x70a6ffb000
Resolve(Reject) GestureType::TAP in [UIView ID(267) Id(-1)]
Resolve(Reject) GestureType::HORZ_VERT_DRAG in [UIView ID(267) Id(-1)]
UIView dtor [UIView ID(279) Id(-1)] 0x70a6f2d000
Resolve(Reject) GestureType::TAP in [UIView ID(279) Id(-1)]
Resolve(Reject) GestureType::HORZ_VERT_DRAG in [UIView ID(279) Id(-1)]
UIView dtor [UIView ID(273) Id(-1)] 0x70a6ffc000
Resolve(Reject) GestureType::TAP in [UIView ID(273) Id(-1)]
Resolve(Reject) GestureType::HORZ_VERT_DRAG in [UIView ID(273) Id(-1)]
UIView dtor [UITextView ID(262) Id(-1)] 0x7045582000
D/ZrHung.AppEyeUiProbe: not watching, wait.
I/bluetooth.demo: Waiting for a blocking GC ProfileSaver
I/AwareBitmapCacher: init lrucache size: 4194304 pid=2462
D/RenderService: RCS is disable
E/AGP: VsyncSchedulerAndroid:can not find method postRenderThreadInfo.
D/AGP: BF:Client register new ability
BF:Client register new contentView
BF:Client Register
D/AGP: Error UpdatePivot not in scene
W/AGP: No text or a null string was set
I/chatty: uid=10391(com.xiaowu.bluetooth.demoo) Thread-3 identical 5 lines
W/AGP: No text or a null string was set
W/Gralloc3: mapper 3.x is not supported
I/HwViewRootImpl: removeInvalidNode jank list is null
D/ActivityThread: Won't deliver top position change in state=2
D/ZrHung.AppEyeUiProbe: restart watching
I/RmeSchedManager: init Rme, version is: v1.0
I/RmeSchedManager: init Rme, version is: v1.0
I/RtgSchedEvent: current pid:2462 AppType:-1
D/DecorView: showOrHideHighlightView: hasFocus=true; winMode=1; isMrgNull=true
W/InputMethodManager: startInputReason = 1
D/AGP: can not find focus in [UILinearLayout ID(259) Id(-1)]
W/InputMethodManager: startInputReason = 5
D/AGP: can not find focus in [UILinearLayout ID(259) Id(-1)]

更多关于HarmonyOS 鸿蒙Next 测试运行 界面空白 是什么原因啊的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html

11 回复

楼主你好,给子组件的宽高赋值就可以显示了

更多关于HarmonyOS 鸿蒙Next 测试运行 界面空白 是什么原因啊的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


好的,谢谢!我试一下,


基本信息

这是我的代码主题:

<div>
    <p>这是一段普通的文本。</p>
    <p>这是另一段文本。</p>
    <img src="" alt="这是一个空链接的图片">
</div>

布局有问题,所有的控件高度由match_parent改成match_content,使用Text,Button类组件时开发时先添加占位字符看看效果

姓名:张三 职位:软件工程师 简介:拥有超过10年的IT行业经验,擅长Java和Python开发。

![image.png](https://alliance-communityfile-drcn.dbankcdn.com/FileServer/getFile/cmtybbs/446/829/981/2850086000446829981.20220328134005.98662617557904168533179512956698:50001231000000:2800:009F7B49F84C5FAADF4A797D02743A5E17935D2E2D13FB1E58572EC3643774E6.png)

![image.png](https://alliance-communityfile-drcn.dbankcdn.com/FileServer/getFile/cmtybbs/446/829/981/2850086000446829981.20220328134031.52799024378849327660114042817286:50001231000000:2800:7C15B4FC828F7B26025D105D3AAFDE1FF11716CFA752479CBFAF77661C92063A.png)

![image.png](https://alliance-communityfile-drcn.dbankcdn.com/FileServer/getFile/cmtybbs/446/829/981/2850086000446829981.20220328134038.31372535380090833903944625442557:50001231000000:2800:F1342DC7F27CFDF05DFBCB9E45EF39A82B039F15BF52C3B9FB8BB10DFB9B13A2.png)

![image.png](https://alliance-communityfile-drcn.dbankcdn.com/FileServer/getFile/cmtybbs/446/829/981/2850086000446829981.20220328134046.17218581987676535650663251271852:50001231000000:2800:CD4F93BD018F6540A0D500BBA730D800D6AD58A52EA41D66FF595C0E1BD2ED6A.png)

![image.png](https://alliance-communityfile-drcn.dbankcdn.com/FileServer/getFile/cmtybbs/446/829/981/2850086000446829981.20220328134052.61567550964017205054131369220860:50001231000000:2800:B8B6D79B6F4CD09621D0E123D94C883C57147C6961F2F4D7F3D07DBD9CF75290.png)

这个日志可以发个带颜色那种的吗?一般红色的是问题所在

好的!麻烦大神帮忙看一下。。。。,

我没看明白,靠别的大神了,

好吧!辛苦了,

欢迎开发小伙伴们进来帮帮楼主

HarmonyOS 鸿蒙Next测试运行时出现界面空白的情况,可能由以下几种原因引起:

  1. 系统资源加载异常:在测试过程中,系统可能因为资源文件加载失败或损坏,导致界面无法正常显示。这可能是由于测试环境的配置问题,或者是系统文件在更新过程中被破坏。

  2. UI框架初始化失败:鸿蒙系统的UI框架负责界面的渲染和显示。如果框架在初始化过程中遇到问题,如内存不足、依赖服务未启动等,都可能导致界面空白。

  3. 权限或安全策略限制:在测试环境中,可能由于权限设置不当或安全策略过于严格,导致系统无法访问必要的资源或执行必要的操作,从而影响界面的正常显示。

  4. 软件兼容性问题:如果测试的应用或服务与鸿蒙系统的当前版本不兼容,也可能导致界面显示异常。

  5. 硬件或驱动问题:在某些情况下,硬件故障或驱动程序问题也可能影响系统的正常显示功能。

针对这些问题,可以尝试重新配置测试环境、检查系统日志以定位问题根源,并确保所有组件和服务的版本兼容性。如果问题依旧没法解决请联系官网客服,官网地址是 https://www.itying.com/category-93-b0.html

回到顶部