我正在使用Cordova构建一个包含Ext.js Web应用程序的UWP Windows 10应用程序。
我可以使用带有cordova build windows
的Cordova和Sencha的系统sencha app build native
成功构建应用程序。这会在cordova\platforms\windows\AppPackages
中输出一个文件夹,其中包含.appx
文件,我可以在信任生成的密钥后安装该文件。
安装完成后,如果选中“完成后运行”复选框,则会加载应用程序并看到我们的登录屏幕。 如果我通过按右上角的X关闭应用程序,然后从开始菜单重新打开应用程序,我看到的只是黑屏(实际颜色为#1d1f20)。如果我卸载应用程序并重新安装,它将再次工作,但只能执行一次。任何后续关闭和重新打开都会导致黑屏。
如果我取消选中“完成后运行”复选框,然后我手动打开应用程序,我也会看到黑屏。
当显示黑屏时,如果我按F12打开开发者工具,然后按Ctrl和R重新加载,我会看到登录屏幕。没有控制台错误。
如果我在cordova\platforms\windows\www
的网络浏览器中打开index.html文件,那么我会看到登录屏幕。
我尝试将配置添加到与启动画面相关的config.xml中,但这对情况没有帮助。
重申一下,该应用程序可以运行一次(如果立即启动),但随后所有启动只显示黑屏,除非我打开开发人员工具并手动重新加载
如果我在Visual Studio中打开解决方案并在本地计算机上“运行”,它可以工作,我会看到登录屏幕。
如果我去Build>部署解决方案,它将在我的系统上安装应用程序并运行它,它的工作原理。
这实际上会导致应用程序正常运行,即使在后续发布时也是如此!!
如果我去Project>商店>创建应用程序包并创建应用程序包,我得到相同的黑屏问题(旁注,这会创建.appxbundle文件而不是.appx文件)。
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.foo.foomobile" version="1.0.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>FooMobile</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Foo Services
</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<plugin name="cordova-plugin-whitelist" spec="1" />
<preference name="windows-target-version" value="10.0" />
<preference name="KeepRunning" value="true" />
<engine name="android" spec="~6.2.3" />
<engine name="windows" spec="^5.0.0" />
</widget>
任何帮助将不胜感激。
修改
我尝试使用新的空白Ext.js 6.5.3应用程序进行Cordova构建,并且在第一次启动工作和随后启动白屏时也存在同样的问题。
修改2
答案 0 :(得分:1)
我与Daniel Twigg合作解决了这个问题。
问题出在Sencha Ext JS microloader(bootstrap.js)中。出于某种原因,将文件动态加载到microloader完成的页面中有问题在Windows中 - 我有一个'bootstrap.js'文件的修改版本来修复问题 - 如果需要请联系我 - 或者我可以发布它这里
marc.gusmano@sencha.com
答案 1 :(得分:1)