重大BUG现在打包安装到荣耀手机后一直卡在uni-app启动页面

重大BUG现在打包安装到荣耀手机后一直卡在uni-app启动页面

测试过的手机

鸿蒙 3.0系统的手机都打不开

操作步骤

  • 使用荣耀鸿蒙3.0的手机,随便打包一个项目都不行

预期结果

  • 能够正常启动app

实际结果

  • 一直卡在app启动页面

bug描述

3月17号发布更新app后,18号早上发现大量用户反馈无法打开app,卡在app启动页面。反馈的手机都是鸿蒙 3.0系统。安排手机报出的日志应该是官方底座有bug,抛出异常如下:

2025-03-18 15:26:36.743 27384-27384 System.err     W  java.lang.UnsupportedOperationException: This method is not supported by the current version of the framework and the current WebView APK  
2025-03-18 15:26:36.743 27384-27384 System.err     W    at androidx.webkit.internal.WebViewFeatureInternal.getUnsupportedOperationException(WebViewFeatureInternal.java:531)  
2025-03-18 15:26:36.743 27384-27384 System.err     W    at androidx.webkit.WebSettingsCompat.setForceDarkStrategy(WebSettingsCompat.java:600)  
2025-03-18 15:26:36.743 27384-27384 System.err     W    at io.dcloud.common.util.AppRuntime$1.run(SourceFile:18)  
2025-03-18 15:26:36.743 27384-27384 System.err     W    at io.dcloud.common.util.AppRuntime.applyWebViewDarkMode(SourceFile:29)  
2025-03-18 15:26:36.743 27384-27384 System.err     W    at io.dcloud.common.adapter.ui.webview.SysWebView.applyWebViewDarkMode(SourceFile:1)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at io.dcloud.common.adapter.ui.webview.SysWebView.init(SourceFile:151)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at io.dcloud.common.core.ui.l.a(SourceFile:652)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at io.dcloud.common.core.ui.l.processEvent(SourceFile:5718)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at io.dcloud.common.core.ui.l.a(SourceFile:159)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at io.dcloud.common.core.ui.l.processEvent(SourceFile:5643)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at io.dcloud.p.k0.dispatchEvent(SourceFile:20)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at io.dcloud.p.r.processEvent(SourceFile:2)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at io.dcloud.p.a5.a(SourceFile:801)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at io.dcloud.p.a5.f(SourceFile:31)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at io.dcloud.p.r.a(SourceFile:174)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at io.dcloud.p.r.a(SourceFile:3)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at io.dcloud.p.r$h.onCallBack(SourceFile:11)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at io.dcloud.p.a5$c$a.execute(SourceFile:1)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at io.dcloud.common.adapter.util.MessageHandler$1.handleMessage(SourceFile:3)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at android.os.Handler.dispatchMessage(Handler.java:110)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at android.os.Looper.loop(Looper.java:219)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at android.app.ActivityThread.main(ActivityThread.java:8673)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at java.lang.reflect.Method.invoke(Native Method)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)  
2025-03-18 15:26:36.744 27384-27384 System.err     W    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)

更多关于重大BUG现在打包安装到荣耀手机后一直卡在uni-app启动页面的实战教程也可以访问 https://www.itying.com/category-93-b0.html

2 回复

问题已确认,与此贴 https://ask.dcloud.net.cn/question/206890 问题一致,后续修复请关注该贴回复

更多关于重大BUG现在打包安装到荣耀手机后一直卡在uni-app启动页面的实战教程也可以访问 https://www.itying.com/category-93-b0.html


从错误日志来看,这是鸿蒙3.0系统与uni-app底层WebView兼容性问题导致的。具体原因是系统WebView不支持setForceDarkStrategy方法调用。

建议尝试以下解决方案:

  1. 升级HBuilderX到最新版本(目前最新是3.8.12),新版已修复部分鸿蒙兼容性问题

  2. 在manifest.json中配置:

"app-plus": {
    "webView": {
        "darkmode": false
    }
}
回到顶部