用户2757534
用户2757534
  • 发布:2025-03-04 22:02
  • 更新:2025-03-04 22:02
  • 阅读:16

【报Bug】hx由4.20升至4.45,鸿蒙app无法真机白屏。GetOHDeviceInfo handle is nullptr; libdeviceinfo_ndk.z.so

分类:鸿蒙Next

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 4.45

手机系统: HarmonyOS NEXT

手机系统版本号: HarmonyOS NEXT Developer Beta1

手机厂商: 华为

手机机型: P70

页面类型: vue

vue版本: vue3

打包方式: 离线

项目创建方式: HBuilderX

操作步骤:
  1. 使用hbuildx4.45(检查更新,已是最新)创建项目,点击运行到鸿蒙真机
  2. 将unpackage\debug\app-harmony-xxxx拷贝出来,进行配置相关,成功在真机上运行初始项目
  3. 将原始uni仓库中的package.json依赖更新为:
    "dependencies": {  
    "@dcloudio/uni-app": "3.0.0-4040520250104002",  
    "@dcloudio/uni-app-harmony": "3.0.0-4040520250104002",  
    "@dcloudio/uni-app-plus": "3.0.0-4040520250104002",  
    "@dcloudio/uni-components": "3.0.0-4040520250104002",  
    "@dcloudio/uni-h5": "3.0.0-4040520250104002",  
    "@dcloudio/uni-mp-alipay": "3.0.0-4040520250104002",  
    "@dcloudio/uni-mp-baidu": "3.0.0-4040520250104002",  
    "@dcloudio/uni-mp-jd": "3.0.0-4040520250104002",  
    "@dcloudio/uni-mp-kuaishou": "3.0.0-4040520250104002",  
    "@dcloudio/uni-mp-lark": "3.0.0-4040520250104002",  
    "@dcloudio/uni-mp-qq": "3.0.0-4040520250104002",  
    "@dcloudio/uni-mp-toutiao": "3.0.0-4040520250104002",  
    "@dcloudio/uni-mp-weixin": "3.0.0-4040520250104002",  
    "@dcloudio/uni-mp-xhs": "3.0.0-4040520250104002",  
    "@dcloudio/uni-quickapp-webview": "3.0.0-4040520250104002",  
    "@dcloudio/uni-ui": "^1.5.3",  
    "@types/fs-extra": "^11.0.4",  
    "@types/lodash-es": "^4.17.12",  
    "@vant/weapp": "^1.11.4",  
    "@vueuse/core": "^10.9.0",  
    "@vueuse/integrations": "^10.9.0",  
    "@vueuse/shared": "^10.9.0",  
    "async-validator": "^4.2.5",  
    "axios": "^1.6.8",  
    "archiver": "^7.0.1",  
    "canvas-to-svg": "^1.0.3",  
    "date-fns": "^3.6.0",  
    "dateformat": "^5.0.3",  
    "dijkstrajs": "^1.0.3",  
    "fs-extra": "^11.2.0",  
    "lodash-es": "^4.17.21",  
    "mitt": "^3.0.1",  
    "moment": "^2.30.1",  
    "pinia": "2.0.36",  
    "postcss-url": "^10.1.3",  
    "svg64": "^2.0.0",  
    "swiper": "^11.1.1",  
    "uqrcodejs": "^4.0.7",  
    "vite-plugin-remote-assets": "^0.4.1",  
    "vue": "^3.5.12",  
    "vue-awesome-swiper": "^5.0.1",  
    "vue-demi": "^0.14.7",  
    "vue-i18n": "^9.10.2",  
    "weapp-polyfill": "^3.2.2",  
    "weapp-qrcode": "^1.0.0",  
    "wechat-utils": "0.0.1"  
    },  
    "devDependencies": {  
    "@dcloudio/types": "^3.4.8",  
    "@dcloudio/uni-automator": "3.0.0-4040520250104002",  
    "@dcloudio/uni-cli-shared": "3.0.0-4040520250104002",  
    "@dcloudio/uni-stacktracey": "3.0.0-4040520250104002",  
    "@dcloudio/uni-uts-v1": "3.0.0-4040520250104002",  
    "@dcloudio/vite-plugin-uni": "3.0.0-4040520250104002",  
    "@douyin-microapp/typings": "^1.2.2",  
    "@typescript-eslint/eslint-plugin": "^7.4.0",  
    "@typescript-eslint/parser": "^7.4.0",  
    "@vue/compiler-sfc": "^3.4.21",  
    "@vue/runtime-core": "^3.4.21",  
    "@vue/tsconfig": "^0.1.3",  
    "eslint": "^8.57.0",  
    "eslint-plugin-vue": "^9.24.0",  
    "http-server": "^14.1.1",  
    "js-base64": "^3.7.7",  
    "minimist": "^1.2.8",  
    "miniprogram-api-typings": "^3.12.2",  
    "miniprogram-ci": "^1.9.15",  
    "prettier": "3.2.5",  
    "qrcode": "^1.5.4",  
    "rollup-plugin-postcss": "^4.0.2",  
    "sass": "^1.72.0",  
    "strip-json-comments": "3.1.1",  
    "tt-ide-cli": "^0.1.25",  
    "typescript": "^4.9.5",  
    "vite": "5.2.8",  
    "vite-copy-plugin": "^0.4.0",  
    "vite-plugin-replace-image-url": "^1.1.1",  
    "vue-tsc": "^1.8.27"  
    },
  4. pnpm run build项目,打包后的文件替换到新的鸿蒙基座中,运行到真机
  • 对hx4.20鸿蒙基座中部分代码有过改动。但未对hx4.45基座进行过类似改造,可以参考试试...

hx4.20项目\entry\src\main\ets\uni-app\components\WebView.ets


import harmonyWebView from '@ohos.web.webview'  
import picker from '@ohos.file.picker';  
import { BusinessError } from '@ohos.base';  
import { abilityAccessCtrl, common } from '@kit.AbilityKit';  
import deviceInfo from '@ohos.deviceInfo';  
import { UTSHarmony as UTSHarmony7, getWindowInfo as internalGetWindowInfo, getDeviceId as getDeviceId1 } from "@dcloudio/uni-app-harmony-framework";  
import { GetWindowInfoResult } from '@dcloudio/uni-app-harmony';  

interface Detail {}

interface Event {
detail: Detail
}

interface TitleUpdateEventDetail {
title?: string
}

interface TitleUpdateEvent extends Event {
detail: TitleUpdateEventDetail
}

interface ISystemInfoAppVersion {
name: string;
code: string;
}

@Component
export struct WebView {
@Prop @Watch('setSrc') src: string
onMessage?: (event: Event) => void = undefined
onTitleUpdate?: (event: TitleUpdateEvent) => void = undefined
onPostMessageToService?: (event: Event) => void = undefined
exposeWebViewController?: (controller: harmonyWebView.WebviewController) => void = undefined
controller = new harmonyWebView.WebviewController()

aboutToAppear(): void {
this.exposeWebViewController?.(this.controller)
}

customUserAgent() {
const appVersion: ISystemInfoAppVersion = UTSHarmony7.getAppVersion();
const windowInfo = internalGetWindowInfo() as GetWindowInfoResult;
// Mozilla/5.0 (Phone; OpenHarmony 5.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 ArkWeb/4.1.6.1 MobileHUAWEI emulator/(ZYWallet;1.0.0;100;harmonyos OS;0;387x836;3.25)
return ${this.controller.getUserAgent()} ${deviceInfo.brand} ${deviceInfo.productModel}/(ZYWallet;${appVersion.name};${appVersion.code};harmonyos OS;${deviceInfo.buildVersion};${windowInfo.screenWidth}x${windowInfo.screenHeight};${vp2px(1)});
}

build() {
Web({
src: this.src,
controller: this.controller
})
.overScrollMode(OverScrollMode.NEVER)
.geolocationAccess(true)
.domStorageAccess(true)
.imageAccess(true)
.fileAccess(true)
.onTitleReceive(event => {
console.log('onTitleReceive: ' + JSON.stringify(event?.title))
this.onTitleUpdate?.({
detail: {
title: event?.title
}
})
})
.onConsole(event => {
if (event) {
console.log('getMessage: ' + JSON.stringify(event.message.getMessage()))
}
return false
})
.onErrorReceive(event => {
if (event) {
console.error(event.error.getErrorInfo())
}
})
.javaScriptProxy({
object: {
postMessage: (data: string) => {
// console.log('onPostMessage: ' + data)
try {
if (this.onMessage) {
this.onMessage({ detail: JSON.parse(data) })
}
} catch (error) {
console.error(ErrorCode: ${(error as BusinessError).code}, Message: ${(error as BusinessError).message});
}
},
postMessageToService: (data: string) => {
if (this.onPostMessageToService) {
this.onPostMessageToService({ detail: JSON.parse(data) })
}
}
},
name: '__uniappx',
methodList: ['postMessage', 'postMessageToService'],
controller: this.controller
})
.onGeolocationShow((event) => {

    let context = getContext(this) as common.UIAbilityContext;  
    let atManager = abilityAccessCtrl.createAtManager();  
    atManager.requestPermissionsFromUser(context, ["ohos.permission.APPROXIMATELY_LOCATION"]).then((data) => {  
      console.info('data authResults:' + data.authResults);  
    }).catch((error: BusinessError) => {  
      console.error(`Failed to request permissions from user. Code is ${error.code}, message is ${error.message}`);  
    })  

    AlertDialog.show({  
      title: '位置权限请求',  
      message: '是否允许获取位置信息',  
      primaryButton: {  
        value: 'cancel',  
        action: () => {  
          if (event) {  
            event.geolocation.invoke(event.origin, false, false);  
          }  
        }  
      },  
      secondaryButton: {  
        value: 'ok',  
        action: () => {  
          if (event) {  
            event.geolocation.invoke(event.origin, true, true);  
          }  
        }  
      },  
      cancel: () => {  
        if (event) {  
          event.geolocation.invoke(event.origin, false, false);  
        }  
      }  
    })  
  })  
  .onShowFileSelector((event) => {  
    // TODO 真机运行没有问题,模拟器运行后,选择图片后H5端无法获取图片信息  
    const selectOptions = new picker.PhotoSelectOptions();  
    const mode = event?.fileSelector.getMode();  
    const acceptType = event?.fileSelector.getAcceptType();  
    if (mode === 0) {  
      selectOptions.maxSelectNumber = 1;  
    }  
    if (acceptType) {  
      let type = "";  
      const imageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tiff', '.svg', '.webp'];  
      const containsImage = imageExtensions.some((ext: string): boolean => acceptType.includes(ext));  
      const videoExtensions =  
        ['.mp4', '.mov', '.avi', '.mkv', '.flv', '.wmv', '.ogg', '.webm', 'mpg', 'mpeg', '.3gp', 'rm', 'rmvb',  
          'm4v', 'wma', 'mts'];  
      const containsVideo = videoExtensions.some((ext: string): boolean => acceptType.includes(ext));  
      if (containsImage && containsVideo) {  
        type = "IMAGE_VIDEO_TYPE";  
      } else if (containsImage) {  
        type = "IMAGE_TYPE";  
      } else if (containsVideo) {  
        type = "VIDEO_TYPE";  
      }  
      if (type) {  
        selectOptions.MIMEType = picker.PhotoViewMIMETypes[type]  
      }  
    }  
    let filePaths: Array<string> | null = null;  
    const viewPicker = new picker.PhotoViewPicker();  
    viewPicker.select(selectOptions).then((selectResult) => {  
      filePaths = selectResult.photoUris;  
      if (event) {  
        event.result.handleFileList(filePaths);  
      }  
    }).catch((err: BusinessError) => {  
      console.error(`Invoke viewPicker.select failed, code is ${err.code}, message is ${err.message}`);  
    })  
    return true  
  })  
  .onControllerAttached(() => {  
    console.log("onControllerAttached");  
    try {  
      this.controller.setCustomUserAgent(this.customUserAgent());  
      console.log('setCustomUserAgent', this.controller.getCustomUserAgent())  
    } catch (error) {  
      console.error(`ErrorCode: ${(error as BusinessError).code},  Message: ${(error as BusinessError).message}`);  
    }  
  })  
  .onLoadIntercept((event) => {  
    try {  
      let tempUrl = event.data.getRequestUrl();  
      console.info('onLoadIntercept:' + tempUrl)  
      if (tempUrl && tempUrl.startsWith('zywallet://')) {  
        if (this.onMessage) {  
          this.onMessage({ detail: tempUrl });  
          return true;  
        }  
      }  
    } catch (error) {  
      console.error(`ErrorCode: ${(error as BusinessError).code},  Message: ${(error as BusinessError).message}`);  
    }  
    return false;  
  })  

}

setSrc() {
this.controller.loadUrl(this.src)
}
}


> hx4.20项目\entry\src\main\ets\uni-app\components
``` javascript  
import harmonyWebView from '@ohos.web.webview'  
import picker from '@ohos.file.picker';  
import { BusinessError } from '@ohos.base';  
import { abilityAccessCtrl, common } from '@kit.AbilityKit';  
import deviceInfo from '@ohos.deviceInfo';  
import { UTSHarmony as UTSHarmony7, getWindowInfo as internalGetWindowInfo, getDeviceId as getDeviceId1 } from "@dcloudio/uni-app-harmony-framework";  
import { GetWindowInfoResult } from '@dcloudio/uni-app-harmony';  

interface Detail {}  

interface Event {  
  detail: Detail  
}  

interface TitleUpdateEventDetail {  
  title?: string  
}  

interface TitleUpdateEvent extends Event {  
  detail: TitleUpdateEventDetail  
}  

interface ISystemInfoAppVersion {  
  name: string;  
  code: string;  
}  

@Component  
export struct WebView {  
  @Prop @Watch('setSrc') src: string  
  onMessage?: (event: Event) => void = undefined  
  onTitleUpdate?: (event: TitleUpdateEvent) => void = undefined  
  onPostMessageToService?: (event: Event) => void = undefined  
  exposeWebViewController?: (controller: harmonyWebView.WebviewController) => void = undefined  
  controller = new harmonyWebView.WebviewController()  

  aboutToAppear(): void {  
    this.exposeWebViewController?.(this.controller)  
  }  

  customUserAgent() {  
    const appVersion: ISystemInfoAppVersion = UTSHarmony7.getAppVersion();  
    const windowInfo = internalGetWindowInfo() as GetWindowInfoResult;  
    // Mozilla/5.0 (Phone; OpenHarmony 5.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36  ArkWeb/4.1.6.1 MobileHUAWEI emulator/(ZYWallet;1.0.0;100;harmonyos OS;0;387x836;3.25)  
    return `${this.controller.getUserAgent()} ${deviceInfo.brand} ${deviceInfo.productModel}/(ZYWallet;${appVersion.name};${appVersion.code};harmonyos OS;${deviceInfo.buildVersion};${windowInfo.screenWidth}x${windowInfo.screenHeight};${vp2px(1)})`;  
  }  

  build() {  
    Web({  
      src: this.src,  
      controller: this.controller  
    })  
      .overScrollMode(OverScrollMode.NEVER)  
      .geolocationAccess(true)  
      .domStorageAccess(true)  
      .imageAccess(true)  
      .fileAccess(true)  
      .onTitleReceive(event => {  
        console.log('onTitleReceive: ' + JSON.stringify(event?.title))  
        this.onTitleUpdate?.({  
          detail: {  
            title: event?.title  
          }  
        })  
      })  
      .onConsole(event => {  
        if (event) {  
          console.log('getMessage: ' + JSON.stringify(event.message.getMessage()))  
        }  
        return false  
      })  
      .onErrorReceive(event => {  
        if (event) {  
          console.error(event.error.getErrorInfo())  
        }  
      })  
      .javaScriptProxy({  
        object: {  
          postMessage: (data: string) => {  
            // console.log('onPostMessage: ' + data)  
            try {  
              if (this.onMessage) {  
                this.onMessage({ detail: JSON.parse(data) })  
              }  
            } catch (error) {  
              console.error(`ErrorCode: ${(error as BusinessError).code},  Message: ${(error as BusinessError).message}`);  
            }  
          },  
          postMessageToService: (data: string) => {  
             if (this.onPostMessageToService) {  
              this.onPostMessageToService({ detail: JSON.parse(data) })  
            }  
          }  
        },  
        name: '__uniapp_x_',  
        methodList: ['postMessage', 'postMessageToService'],  
        controller: this.controller  
      })  
      .onGeolocationShow((event) => {  

        let context = getContext(this) as common.UIAbilityContext;  
        let atManager = abilityAccessCtrl.createAtManager();  
        atManager.requestPermissionsFromUser(context, ["ohos.permission.APPROXIMATELY_LOCATION"]).then((data) => {  
          console.info('data authResults:' + data.authResults);  
        }).catch((error: BusinessError) => {  
          console.error(`Failed to request permissions from user. Code is ${error.code}, message is ${error.message}`);  
        })  

        AlertDialog.show({  
          title: '位置权限请求',  
          message: '是否允许获取位置信息',  
          primaryButton: {  
            value: 'cancel',  
            action: () => {  
              if (event) {  
                event.geolocation.invoke(event.origin, false, false);  
              }  
            }  
          },  
          secondaryButton: {  
            value: 'ok',  
            action: () => {  
              if (event) {  
                event.geolocation.invoke(event.origin, true, true);  
              }  
            }  
          },  
          cancel: () => {  
            if (event) {  
              event.geolocation.invoke(event.origin, false, false);  
            }  
          }  
        })  
      })  
      .onShowFileSelector((event) => {  
        // TODO 真机运行没有问题,模拟器运行后,选择图片后H5端无法获取图片信息  
        const selectOptions = new picker.PhotoSelectOptions();  
        const mode = event?.fileSelector.getMode();  
        const acceptType = event?.fileSelector.getAcceptType();  
        if (mode === 0) {  
          selectOptions.maxSelectNumber = 1;  
        }  
        if (acceptType) {  
          let type = "";  
          const imageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tiff', '.svg', '.webp'];  
          const containsImage = imageExtensions.some((ext: string): boolean => acceptType.includes(ext));  
          const videoExtensions =  
            ['.mp4', '.mov', '.avi', '.mkv', '.flv', '.wmv', '.ogg', '.webm', 'mpg', 'mpeg', '.3gp', 'rm', 'rmvb',  
              'm4v', 'wma', 'mts'];  
          const containsVideo = videoExtensions.some((ext: string): boolean => acceptType.includes(ext));  
          if (containsImage && containsVideo) {  
            type = "IMAGE_VIDEO_TYPE";  
          } else if (containsImage) {  
            type = "IMAGE_TYPE";  
          } else if (containsVideo) {  
            type = "VIDEO_TYPE";  
          }  
          if (type) {  
            selectOptions.MIMEType = picker.PhotoViewMIMETypes[type]  
          }  
        }  
        let filePaths: Array<string> | null = null;  
        const viewPicker = new picker.PhotoViewPicker();  
        viewPicker.select(selectOptions).then((selectResult) => {  
          filePaths = selectResult.photoUris;  
          if (event) {  
            event.result.handleFileList(filePaths);  
          }  
        }).catch((err: BusinessError) => {  
          console.error(`Invoke viewPicker.select failed, code is ${err.code}, message is ${err.message}`);  
        })  
        return true  
      })  
      .onControllerAttached(() => {  
        console.log("onControllerAttached");  
        try {  
          this.controller.setCustomUserAgent(this.customUserAgent());  
          console.log('setCustomUserAgent', this.controller.getCustomUserAgent())  
        } catch (error) {  
          console.error(`ErrorCode: ${(error as BusinessError).code},  Message: ${(error as BusinessError).message}`);  
        }  
      })  
      .onLoadIntercept((event) => {  
        try {  
          let tempUrl = event.data.getRequestUrl();  
          console.info('onLoadIntercept:' + tempUrl)  
          if (tempUrl && tempUrl.startsWith('zywallet://')) {  
            if (this.onMessage) {  
              this.onMessage({ detail: tempUrl });  
              return true;  
            }  
          }  
        } catch (error) {  
          console.error(`ErrorCode: ${(error as BusinessError).code},  Message: ${(error as BusinessError).message}`);  
        }  
        return false;  
      })  
  }  

  setSrc() {  
    this.controller.loadUrl(this.src)  
  }  
}  

> hx4.20项目\entry\src\main\ets\pages\Page.ets  

``` javascript  
import {  
  WebNodeController,  
  callPageLifeCycle,  
} from '../../resources/rawfile/uni-app/uni-app-harmony-framework-dev';  
import {  
  TabBar,  
  TabBarState,  
  OnTabItemClickOptions,  
  createTabBarState,  
  createTabBarItem  
} from '../uni-app/components/TabBar';  
import { NavBar, ITitleNView } from '../uni-app/components/NavBar';  
import { NodeController, window } from '@kit.ArkUI';  
import { SafeAreaOffset } from '../uni-app/components/SafeAreaOffset';  
import harmonyWebView from '@ohos.web.webview'  
import bundleManager from '@ohos.bundle.bundleManager';  
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';  

@Observed  
class PullToRefresh {  
  support?: boolean  

  constructor(pullToRefresh?: PullToRefresh) {  
    this.support = pullToRefresh?.support  
  }  
}  

@Observed  
class ObservedPageStyle {  
  titleNView?: ITitleNView  
  pullToRefresh?: PullToRefresh  
  background?: string  
  backgroundTextStyle?: 'light' | 'dark'  
  marginTop?: number  
  paddingBottom?: number  

  constructor(style: ObservedPageStyle) {  
    this.titleNView = style.titleNView  
    this.pullToRefresh = new PullToRefresh(style.pullToRefresh)  
    this.background = style.background  
    this.backgroundTextStyle = style.backgroundTextStyle  
    this.marginTop = style.marginTop  
    this.paddingBottom = style.paddingBottom  
    let flag = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO;  
    let bundleInfo = bundleManager.getBundleInfoForSelfSync(flag)  
    let appId = bundleInfo.signatureInfo.appId;  
    console.log('get Appid:', appId);  
  }  
}  

@Observed  
class ObservedChildren extends Array<NodeController> {  
}  

@Observed  
class RefreshState {  
  refreshing?: boolean  
  onRefreshing?: () => void  
  onRefreshStateChange?: (state?: RefreshStatus) => void  

  constructor(state?: RefreshState) {  
    this.refreshing = state?.refreshing  
    this.onRefreshing = state?.onRefreshing  
    this.onRefreshStateChange = state?.onRefreshStateChange  
  }  
}  

@Observed  
class SubPageState {  
  id: string  
  style: ObservedPageStyle  
  embedChildren: ObservedChildren  
  stackChildren: ObservedChildren  
  refreshState: RefreshState  

  constructor(id: string, style: ObservedPageStyle, embedChildren: NodeController[], stackChildren: NodeController[],  
    refreshState?: RefreshState) {  
    this.id = id  
    this.style = new ObservedPageStyle(style)  
    this.embedChildren = new ObservedChildren(...embedChildren)  
    this.stackChildren = new ObservedChildren(...stackChildren)  
    this.refreshState = new RefreshState(refreshState)  
  }  
}  

export function createSubPageState(options: SubPageState) {  
  return new SubPageState(options.id, options.style, options.embedChildren, options.stackChildren, options.refreshState)  
}  

export {  
  createTabBarState, createTabBarItem  
}  

interface NavBarState extends ITitleNView {  
  onBackClick?: (options: OnTabItemClickOptions) => void  
}  

@Component  
struct PageChildren {  
  @ObjectLink children: ObservedChildren  

  build() {  
    Stack({ alignContent: Alignment.TopStart }) {  
      ForEach(this.children, (child: NodeController) => {  
        NodeContainer(child)  
      }, (_: object, index: number) => {  
        return '' + index  
      })  
    }  
  }  
}  

abstract class IWebNodeController extends NodeController {  
  abstract update: (options: Object) => void  
}  

interface IWebNodeStyle {  
  backgroundColor: string  
}  

@Component  
struct PageContainer {  
  @ObjectLink subPage: SubPageState  
  @Require @Prop @Watch('pageStyleChange') style: ObservedPageStyle  
  webNode: IWebNodeController | null = null  

  pageStyleChange(style: ObservedPageStyle) {  
    this.updateWebNodeBackground({  
      backgroundColor: style.background  
    } as IWebNodeStyle)  
  }  

  updateWebNodeBackground(style: IWebNodeStyle) {  
    if (this.webNode) {  
      this.webNode.update({  
        backgroundColor: style.backgroundColor || Color.Transparent  
      } as IWebNodeStyle)  
    }  
  }  

  aboutToAppear(): void {  
    this.webNode = new WebNodeController(this.subPage.id) as IWebNodeController  
    this.updateWebNodeBackground({  
      backgroundColor: this.style.background  
    } as IWebNodeStyle)  
  }  

  build() {  
    Stack({ alignContent: Alignment.TopStart }) {  
      Stack({ alignContent: Alignment.TopStart }) {  
        PageChildren({ children: this.subPage.embedChildren })  
        NodeContainer(this.webNode)  
          .width('100%')  
          .height('100%')  
          .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
        PageChildren({ children: this.subPage.stackChildren })  
      }  
      .width('100%')  
      .height('100%')  
      .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
      .margin({  
        top: this.style.marginTop  
      })  
    }  
    .clip(true)  
    .width('100%')  
    .height('100%')  
    .padding({  
      bottom: this.style.paddingBottom  
    })  
    .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
  }  
}  

@Component  
struct SubPage {  
  @ObjectLink subPage: SubPageState  
  @Require @Prop style: ObservedPageStyle  
  @ObjectLink refreshState: RefreshState  
  @Prop safeArea: SafeArea | undefined  

  @Builder  
  customRefreshComponent() {  
    Stack() {  
      Row() {  
        LoadingProgress().height(32)  
          .color(this.style.backgroundTextStyle === 'light' ? Color.White : '#5f5f5f')  
      }  
      .alignItems(VerticalAlign.Center)  
    }.width("100%").align(Alignment.Center)  
  }  

  build() {  
    Flex({  
      direction: FlexDirection.Column,  
    }) {  
      if (this.style.titleNView) {  
        NavBar({  
          titleNView: this.style.titleNView,  
          onBackClick: () => {  
            callPageLifeCycle('onBackPress', this)  
          }  
        })  
      }  

      Stack() {  
        if (this.style.pullToRefresh?.support) {  
          Refresh({  
            refreshing: $$this.refreshState.refreshing,  
            builder: this.customRefreshComponent()  
          }) {  
            PageContainer({ subPage: this.subPage, style: this.style })  
          }  
          .backgroundColor(this.style.background)  
          .onStateChange(status => {  
            this.refreshState.onRefreshStateChange?.(status)  
          })  
          .onRefreshing(() => {  
            this.refreshState.refreshing = true  
            this.refreshState.onRefreshing?.()  
          })  
        } else {  
          PageContainer({ subPage: this.subPage, style: this.style })  
        }  
      }  
      .clip(true)  
      .width('100%')  
      .flexGrow(1)  
      .flexBasis(1)  
      .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  

    }.width('100%')  
    .height('100%')  
    .backgroundColor(this.style.background)  
    .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
  }  
}  

@Observed  
class ObservedPages extends Array<SubPageState> {  
}  

interface SafeAreaBottom {  
  offset?: string  
}  

interface SafeArea {  
  background?: string  
  bottom?: SafeAreaBottom  
}  

@Entry  
@Component  
struct Page {  
  mainWindow: window.Window = globalThis.mainWindow  
  @State pages: SubPageState[] = new ObservedPages()  
  @State safeArea: SafeArea | undefined = undefined  
  @State tabBar: TabBarState | undefined = undefined  
  @State navBar: NavBarState | undefined = undefined  

  build() {  
    Flex({  
      direction: FlexDirection.Column,  
    }) {  
      Stack() {  
        ForEach(this.pages, (subPage: SubPageState, index: number) => {  
          SubPage({  
            subPage: subPage,  
            style: subPage.style,  
            refreshState: subPage.refreshState,  
            safeArea: this.safeArea  
          })  
        }, (subPage: SubPageState, index: number) => {  
          return index + '-' + subPage.id  
        })  
      }  
      .width('100%')  
      .flexGrow(1)  
      .flexBasis(1)  
      .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  

      if (this.tabBar && this.tabBar.list && this.tabBar.list.length > 0) {  
        TabBar({  
          style: this.tabBar,  
          selectedIndex: this.tabBar.selectedIndex,  
          items: this.tabBar.list,  
          onTabItemClick: (options: OnTabItemClickOptions) => {  
            this.tabBar?.onClick?.(options)  
          }  
        })  
          .visibility(this.tabBar.visible === false ? Visibility.None : Visibility.Visible)  
      } else if (this.safeArea && this.safeArea?.bottom?.offset === 'auto') {  
        SafeAreaOffset({ type: 'bottom' })  
      }  
    }  
    .width('100%')  
    .height('100%')  
    .backgroundColor(this.safeArea?.background)  
    .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
  }  

  aboutToAppear() {  
    // 配置Web开启调试模式  
    harmonyWebView.WebviewController.setWebDebuggingAccess(true);  
    callPageLifeCycle('aboutToAppear', this)  
  }  

  aboutToDisappear() {  
    callPageLifeCycle('aboutToDisappear', this)  
  }  

  onPageShow(): void {  
    callPageLifeCycle('onPageShow', this)  
    const style = this.pages[0]?.style;  
    console.log('onPageShow', 'style:' + style);  
    if (style) {  
      const styleString = JSON.stringify(style);  
      if (styleString && styleString.includes('"privacyMode":true')) {  
        //敏感信息页面禁止截屏、录屏  
        this.mainWindow.setWindowPrivacyMode(true)  
        console.log('onPageShow', 'setWindowPrivacyMode')  
      }  
    }  
  }  

  onPageHide(): void {  
    callPageLifeCycle('onPageHide', this)  
    this.mainWindow.setWindowPrivacyMode(false)  
  }  

  onBackPress(): boolean | void {  
    return callPageLifeCycle('onBackPress', this)  
  }  

  pageTransition() {  
    if (callPageLifeCycle('pageTransition', this).enter.push === 'none') {  
      PageTransitionEnter({ type: RouteType.Push, duration: 0 })  
    }  
    if (callPageLifeCycle('pageTransition', this).enter.pop === 'none') {  
      PageTransitionEnter({ type: RouteType.Pop, duration: 0 })  
    }  
    if (callPageLifeCycle('pageTransition', this).exit.push === 'none') {  
      PageTransitionExit({ type: RouteType.Push, duration: 0 })  
    }  
    if (callPageLifeCycle('pageTransition', this).exit.pop === 'none') {  
      PageTransitionExit({ type: RouteType.Pop, duration: 0 })  
    }  
  }  
}

预期结果:

展示页面

实际结果:

错误日志如下:

03-04 21:37:11.944   32598-32598   C0391B/com.you...letHap/AceWeb  com.youca...alletHap  I     [(100000:100000:scope)] OnRootLayerChanged width : 1256, height : 2667  
03-04 21:37:11.944   32598-32598   C04500/com.you...WalletHap/cef  com.youca...alletHap  I     [nodict][browser_contents_delegate.cc:926] invokeVisualStateCallback success: 1  
03-04 21:37:11.944   32598-32598   C04500/com.you...WalletHap/cef  com.youca...alletHap  I     [nodict][browser_contents_delegate.cc:1235] CefBrowserContentsDelegate::OldPageNoLongerRendered  
03-04 21:37:11.944   32598-32598   C04500/com.you...tHap/chromium  com.youca...alletHap  I     [nodict][nweb_handler_delegate.cc:1264] NWebHandlerDelegate::OnPageVisible  
03-04 21:37:11.944   32598-32598   C0391B/com.you...letHap/AceWeb  com.youca...alletHap  I     [(-2:100000:singleton)] WebClientImpl::OnPageVisible override enter  
03-04 21:37:11.944   32598-32598   C0391B/com.you...letHap/AceWeb  com.youca...alletHap  I     [(100000:100000:scope)] WebDelegate::OnPageVisible, web id = 1  
03-04 21:37:11.944   32598-32598   C0391B/com.you...letHap/AceWeb  com.youca...alletHap  I     [(100000:100000:scope)] JSWeb::OnPageVisible uiCallback enter  
03-04 21:37:11.945   32598-32598   C0391B/com.you...letHap/AceWeb  com.youca...alletHap  I     [(100000:100000:scope)] JSWeb::OnPageVisible async event execute  
03-04 21:37:11.947   32598-32598   C04500/com.you...tHap/chromium  com.youca...alletHap  I     [nodict][nweb_handler_delegate.cc:1218] NWebHandlerDelegate::OnLoadEnd  
03-04 21:37:11.947   32598-32598   C04500/com.you...tHap/chromium  com.youca...alletHap  I     [nodict][nweb_handler_delegate.cc:1222] NWebHandlerDelegate:: Mainframe OnLoadEnd  
03-04 21:37:11.947   32598-32598   C04500/com.you...tHap/chromium  com.youca...alletHap  W     [nodict][arkweb_native_object.cc:78] NativeArkWeb load end callback is nullptr  
03-04 21:37:11.947   32598-32598   C04500/com.you...tHap/chromium  com.youca...alletHap  I     [nodict][content_subresource_filter_throttle_manager.cc:595] [AdBlock] subresource map.size():0  
03-04 21:37:11.947   32598-32598   C04500/com.you...WalletHap/cef  com.youca...alletHap  W     [nodict][icon_helper.cc:97] No icon sizes available for URL: data:,  
03-04 21:37:11.948   32598-32598   C0391B/com.you...letHap/AceWeb  com.youca...alletHap  I     [(100000:100000:scope)] WebPattern::OnScrollEndRecursive  
03-04 21:37:12.945   32598-32598   C0391B/com.you...letHap/AceWeb  com.youca...alletHap  I     [(100000:100000:scope)] WebDelegate::EnableHardware, web id = 1  
03-04 21:37:13.077   32598-34910   C0470A/com.you...meServicePerf  com.youca...alletHap  E     [(HandleBufferData:62)]GameService-graphics: game opt disable  
03-04 21:37:16.655   32598-34872   C01719/com.you...alletHap/ffrt  com.youca...alletHap  W     16:~WorkerThread:72 to exit, qos[3]  
03-04 21:37:16.864   32598-34933   C01719/com.you...alletHap/ffrt  com.youca...alletHap  W     17:~WorkerThread:72 to exit, qos[2]  
03-04 21:37:16.864   32598-34979   C015B0/com.you...tHap/NETSTACK  com.youca...alletHap  E     [epoll_multi_driver.cpp:75] epoll wait event 0 err: 11  
03-04 21:37:16.864   32598-34928   C01719/com.you...alletHap/ffrt  com.youca...alletHap  W     18:~WorkerThread:72 to exit, qos[2]  
03-04 21:37:16.864   32598-34932   C01719/com.you...alletHap/ffrt  com.youca...alletHap  W     19:~WorkerThread:72 to exit, qos[2]  
03-04 21:37:16.865   32598-34876   C01719/com.you...alletHap/ffrt  com.youca...alletHap  W     20:~WorkerThread:72 to exit, qos[2]  
03-04 21:37:16.865   32598-34931   C01719/com.you...alletHap/ffrt  com.youca...alletHap  W     21:~WorkerThread:72 to exit, qos[2]  
03-04 21:37:21.071   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     Error loading header libdeviceinfo_ndk.z.so, namespace default has no inherits, errno=2  
03-04 21:37:21.071   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     Error loading header: can't find library libdeviceinfo_ndk.z.so in namespace: nweb_ns  
03-04 21:37:21.071   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     dlopen_impl load library header failed for libdeviceinfo_ndk.z.so  
03-04 21:37:21.071   32598-32598   C04500/com.you...tHap/chromium  com.youca...alletHap  E     [nodict][sys_info.cc:212] GetOHDeviceInfo handle is nullptr:  
03-04 21:37:21.072   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     Error loading header libdeviceinfo_ndk.z.so, namespace default has no inherits, errno=2  
03-04 21:37:21.072   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     Error loading header: can't find library libdeviceinfo_ndk.z.so in namespace: nweb_ns  
03-04 21:37:21.072   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     dlopen_impl load library header failed for libdeviceinfo_ndk.z.so  
03-04 21:37:21.072   32598-32598   C04500/com.you...tHap/chromium  com.youca...alletHap  E     [nodict][sys_info.cc:212] GetOHDeviceInfo handle is nullptr:  
03-04 21:37:21.072   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     Error loading header libdeviceinfo_ndk.z.so, namespace default has no inherits, errno=2  
03-04 21:37:21.072   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     Error loading header: can't find library libdeviceinfo_ndk.z.so in namespace: nweb_ns  
03-04 21:37:21.072   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     dlopen_impl load library header failed for libdeviceinfo_ndk.z.so  
03-04 21:37:21.072   32598-32598   C04500/com.you...tHap/chromium  com.youca...alletHap  E     [nodict][sys_info.cc:212] GetOHDeviceInfo handle is nullptr:  
03-04 21:37:21.074   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     Error loading header libdeviceinfo_ndk.z.so, namespace default has no inherits, errno=2  
03-04 21:37:21.074   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     Error loading header: can't find library libdeviceinfo_ndk.z.so in namespace: nweb_ns  
03-04 21:37:21.074   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     dlopen_impl load library header failed for libdeviceinfo_ndk.z.so  
03-04 21:37:21.074   32598-32598   C04500/com.you...tHap/chromium  com.youca...alletHap  E     [nodict][sys_info.cc:212] GetOHDeviceInfo handle is nullptr:  
03-04 21:37:21.075   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     Error loading header libdeviceinfo_ndk.z.so, namespace default has no inherits, errno=2  
03-04 21:37:21.075   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     Error loading header: can't find library libdeviceinfo_ndk.z.so in namespace: nweb_ns  
03-04 21:37:21.075   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     dlopen_impl load library header failed for libdeviceinfo_ndk.z.so  
03-04 21:37:21.076   32598-32598   C04500/com.you...tHap/chromium  com.youca...alletHap  E     [nodict][sys_info.cc:212] GetOHDeviceInfo handle is nullptr:  
03-04 21:37:21.076   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     Error loading header libdeviceinfo_ndk.z.so, namespace default has no inherits, errno=2  
03-04 21:37:21.076   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     Error loading header: can't find library libdeviceinfo_ndk.z.so in namespace: nweb_ns  
03-04 21:37:21.076   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     dlopen_impl load library header failed for libdeviceinfo_ndk.z.so  
03-04 21:37:21.076   32598-32598   C04500/com.you...tHap/chromium  com.youca...alletHap  E     [nodict][sys_info.cc:230] GetOHDeviceInfoVersion handle is nullptr:  
03-04 21:37:21.079   32598-32598   C04500/com.you...tHap/chromium  com.youca...alletHap  I     [nodict][track_behavior_website_fetcher.cc:114] detect local tbw file not exist, will force download.  
03-04 21:37:21.079   32598-32598   C04500/com.you...tHap/chromium  com.youca...alletHap  I     [nodict][adblock_config_fetcher.cc:118] detect local easylist file not exist, will force download.  
03-04 21:37:21.659   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     Error loading header libdeviceinfo_ndk.z.so, namespace default has no inherits, errno=2  
03-04 21:37:21.659   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     Error loading header: can't find library libdeviceinfo_ndk.z.so in namespace: nweb_ns  
03-04 21:37:21.659   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     dlopen_impl load library header failed for libdeviceinfo_ndk.z.so  
03-04 21:37:21.659   32598-32598   C04500/com.you...tHap/chromium  com.youca...alletHap  E     [nodict][sys_info.cc:212] GetOHDeviceInfo handle is nullptr:  
03-04 21:37:21.660   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     Error loading header libdeviceinfo_ndk.z.so, namespace default has no inherits, errno=2  
03-04 21:37:21.660   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     Error loading header: can't find library libdeviceinfo_ndk.z.so in namespace: nweb_ns  
03-04 21:37:21.660   32598-32598   C03F00/MUSL-LDSO                com.youca...alletHap  E     dlopen_impl load library header failed for libdeviceinfo_ndk.z.so  
03-04 21:37:21.660   32598-32598   C04500/com.you...tHap/chromium  com.youca...alletHap  E     [nodict][sys_info.cc:230] GetOHDeviceInfoVersion handle is nullptr:

补充一些其他错误日志:

03-04 22:01:01.315   40647-40647   C02C11/com.you...tHap/APPSPAWN  apppool               E     [sandbox_utils.cpp:296]errno is: 13, private mount to /mnt/sandbox/100/com.youcash.ZYWalletHap/vendor/etc/vulkan failed  
03-04 22:01:01.318   40647-40647   C02C11/com.you...tHap/APPSPAWN  apppool               E     [sandbox_utils.cpp:296]errno is: 13, private mount to /mnt/sandbox/100/com.youcash.ZYWalletHap/data/service/el0/public/for-all-app failed  
03-04 22:01:01.320   40647-40647   C02C11/com.you...tHap/APPSPAWN  apppool               E     [sandbox_utils.cpp:296]errno is: 13, private mount to /mnt/sandbox/100/com.youcash.ZYWalletHap/chip_prod/lib64/passthrough failed  
03-04 22:01:01.327   40647-40647   C02C11/com.you...tHap/APPSPAWN  apppool               E     [appspawn_silk.c:118]Load silk library failed for configItems is NULL  
03-04 22:01:01.364   40647-40647   C01336/com.you...WalletHap/AMS  apppool               E     [main_thread.cpp:3494]emptye config  
03-04 22:01:01.369   40647-40647   C01317/com.you...letHap/AppKit  apppool               E     [js_ability_stage.cpp:175]stage is nullptr  
03-04 22:01:01.371   40647-40978   C01317/com.you...letHap/AppKit  apppool               E     [application_cleaner.cpp:229]Failed to obtain file properties  
03-04 22:01:01.371   40647-40978   C01317/com.you...letHap/AppKit  apppool               E     [application_cleaner.cpp:99]Clean bundle data dir failed, path: <private>  
03-04 22:01:01.442   40647-40647   C01F10/com.you...allManagerApi  apppool               E     [RegisterCallBack-(call_manager_proxy.cpp:161)] register callback to call manager service failed,result: 83886109  
03-04 22:01:01.460   40647-40647   C03F01/com.you...alletHap/NAPI  apppool               E     [(native_engine.cpp:712)(AddCleanupHook)] AddCleanupHook Failed.  
03-04 22:01:01.461   40647-40991   C03F00/com.you...p/ArkCompiler  apppool               E     ReferenceError: NativeCustomSpan is not defined  
at func_main_0 (/usr1/hmos_for_system/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/jsEnumStyle.js:3320:1)  
03-04 22:01:01.461   40647-40991   C03F00/com.you...p/ArkCompiler  apppool               E     [ecmascript] invalid size of the string cache table or the table has been registered.  
03-04 22:01:01.461   40647-40991   C03F00/com.you...p/ArkCompiler  apppool               E     [ecmascript] Currently, maximum size of the table is 150  
03-04 22:01:01.492   40647-40647   C02C02/PARAM                    apppool               E     [param_message.c:39]Failed to connect server /dev/unix/socket/paramservice 13  
03-04 22:01:01.492   40647-40647   C02C02/PARAM                    apppool               E     [param_request.c:196]connect param server failed!  
03-04 22:01:01.492   40647-40647   C02C0B/BEGET                    apppool               E     [param_request.c:217]SystemSetParameter failed! name is :web.flowbuffer.maxfd, the errNum is:114  
03-04 22:01:01.498   40647-40647   C03F00/MUSL-LDSO                apppool               E     dlns_create2 ns is exist.  
03-04 22:01:01.501   40647-40647   C04500/com.you...tHap/chromium  apppool               E     [nodict][icu_util.cc:194] /data/storage/el1/bundle/nweb/entry/resources/rawfile/icudtl.dat not exists.  
03-04 22:01:01.504   40647-40647   C04500/com.you...tHap/chromium  apppool               E     [nodict][filesystem_posix.cc:63] mkdir : No such file or directory (2)  
03-04 22:01:01.509   40647-40647   C02800/com.you...Hap/MMIClient  apppool               E     [][SetEventHandler:52] CHKPV(eventHandler) is null  
03-04 22:01:01.511   40647-40647   C02800/com.you...utManagerImpl  apppool               E     [][PackEnhanceConfig:579] CHKPR(enhanceCfg_) is null, return value is -1  
03-04 22:01:01.511   40647-40647   C02800/com.you...utManagerImpl  apppool               E     [][PrintEnhanceConfig:768] CHKPV(enhanceCfg_) is null  
03-04 22:01:01.527   40647-41003   C01400/com.you...OpenGLWrapper  apppool               E     Failed to find <private> section in system json config file  
03-04 22:01:01.527   40647-41003   C01400/com.you...OpenGLWrapper  apppool               E     LoadLayers failed.  
03-04 22:01:01.527   40647-41003   C01400/com.you...OpenGLWrapper  apppool               E     EglWrapperLayer Init Failed.  
03-04 22:01:01.532   40647-41003   C05810/com.you...WalletHap/abr  apppool               E     module.metadata.empty  
03-04 22:01:01.533   40647-41003   C05810/com.you...WalletHap/abr  apppool               E     module.metadata.empty  
03-04 22:01:01.534   40647-41003   C05810/com.you...WalletHap/abr  apppool               E     module.metadata.empty  
03-04 22:01:01.542   40647-41003   C01400/com.you...OpenGLWrapper  apppool               E     EglWrapperHookLayer init Failed!  
03-04 22:01:01.543   40647-41003   C01400/com.you...OpenGLWrapper  apppool               E     invalid display pointer.  
03-04 22:01:01.543   40647-41003   C01400/com.you...OpenGLWrapper  apppool               E     EGLDislay is invalid.  
03-04 22:01:01.543   40647-41003   C0470A/com.you...meServicePerf  apppool               E     [(CreateReportThread:100)]GameService-graphics: begin create thread  
03-04 22:01:01.552   40647-40647   C03F01/com.you...alletHap/NAPI  apppool               E     [(native_engine.cpp:712)(AddCleanupHook)] AddCleanupHook Failed.  
03-04 22:01:01.577   40647-40647   C03F01/com.you...alletHap/NAPI  apppool               E     [(native_engine.cpp:712)(AddCleanupHook)] AddCleanupHook Failed.  
03-04 22:01:01.601   40647-40647   C01650/com.you...WalletHap/Rdb  apppool               E     RdbStoreImpl[AfterOpen]: GetRdbService failed, err: 27394049, storeName: appevent.db.  
03-04 22:01:01.628   40647-40647   C04500/com.you...tHap/chromium  apppool               E     [nodict][nweb_application.cc:198] There is no web inited callback to run.  
03-04 22:01:01.632   40647-40647   C01332/com.you...Hap/UIAbility  apppool               E     [ui_ability.cpp:512]appRecovery not recovery restart  
03-04 22:01:01.633   40647-40647   C01332/com.you...Hap/UIAbility  apppool               E     [ui_ability_impl.cpp:296]hasSaveData_: false  
03-04 22:01:01.636   40647-40647   C04200/com.you...WalletHap/WMS  apppool               E     [] SetWindowType(1735): set window type permission denied!  
03-04 22:01:01.640   40647-40647   C04200/com.you...etonContainer  apppool               E     (82)GetSingleton: can not get OHOS::Rosen::WindowInfoReporter  
03-04 22:01:01.640   40647-40647   C01332/com.you...Hap/UIAbility  apppool               E     [ui_ability.cpp:266]appRecovery not recovery restart  
03-04 22:01:01.641   40647-40978   C015B0/com.you...etConnManager  apppool               E     [network_security_config.cpp:322]Get json failed.  
03-04 22:01:01.641   40647-40978   C015B0/com.you...etConnManager  apppool               E     [network_security_config.cpp:68]GetConfig failed  
03-04 22:01:01.651   40647-40647   C04200/com.you...owSessionImpl  apppool               E     (2364)RegisterSubWindowCloseListeners: window type is not supported  
03-04 22:01:01.651   40647-40647   C04200/com.you...gisterManager  apppool               E     (401)RegisterListener: [NAPI]Register type subWindowClose failed  
03-04 22:01:01.652   40647-40647   C04203/com.you...letHap/WMSSub  apppool               E     []: OnSetSubWindowModal invalid call, type:1  
03-04 22:01:01.675   40647-40647   C01D02/com.you...ility_asacfwk  apppool               E     [(AccessibilitySystemAbilityClientImpl:55)]accessibility service is ready.  
03-04 22:01:01.681   40647-40647   C01406/com.you...tHap/OHOS::RS  apppool               E     FlushImplicitTransaction return, [renderServiceClient_:1, transactionData empty:1]  
03-04 22:01:01.718   40647-41037   C04500/com.you...tHap/chromium  apppool               E     [nodict][devtools_http_handler.cc:318] Cannot start http server for devtools.  
03-04 22:01:01.719   40647-40647   C04500/com.you...tHap/chromium  apppool               E     [nodict][nweb_scheme_handler_factory.cc:176] scheme_handler SetSchemeHandler for arkweb:0  
03-04 22:01:01.719   40647-40647   C04500/com.you...tHap/chromium  apppool               E     [nodict][nweb_scheme_handler_factory.cc:176] scheme_handler SetSchemeHandler for arkweb:0  
03-04 22:01:01.728   40647-40647   C04500/com.you...etHap/webview  apppool               E     [napi_parse_utils.cpp:249] Not a valid napi string

bug描述:

代码在hx4.20的鸿蒙基座上是可以运行的,替换hx4.45的基座后可以顺利执行完app.vue中的方法后就G了,APP启动后白屏

2025-03-04 22:02 负责人:无 分享
已邀请:

要回复问题请先登录注册