Compose Multiplatform Web应用运行时触发ClassCastException导致空白屏问题求助
Compose Multiplatform Web应用运行时触发ClassCastException导致空白屏问题求助
我目前正在用Kotlin和Compose Multiplatform开发一款跨端应用,Android和iOS版本都能正常运行,但Web端打开后一直显示空白屏。
以下是jsMain源码集中Main.kt的内容:
@OptIn(ExperimentalComposeUiApi::class) fun main() { CanvasBasedWindow("Test") { Surface(modifier = Modifier.fillMaxSize()) { App(koin) } } }
在浏览器中运行应用时,屏幕是空白的,并且控制台抛出了ClassCastException,错误出现在Test.js的throw e行。控制台相关代码片段如下:
/******/ var __webpack_module_cache__ = {}; /******/ function __webpack_require__(moduleId) { var cachedModule = __webpack_module_cache__[moduleId]; if (cachedModule !== undefined) { if (cachedModule.error !== undefined) throw cachedModule.error; return cachedModule.exports; } var module = __webpack_module_cache__[moduleId] = { exports: {} }; try { var execOptions = { id: moduleId, module: module, factory: __webpack_modules__[moduleId], require: __webpack_require__ }; __webpack_require__.i.forEach(function(handler) { handler(execOptions); }); module = execOptions.module; execOptions.factory.call(module.exports, module, module.exports, execOptions.require); } catch(e) { module.error = e; throw e; } }
有没有大佬能帮忙分析下这个问题怎么解决?任何建议或指导我都非常感激!
内容来源于stack exchange
相关产品推荐
相关产品推荐

