Dan*_*igg 10 extjs visual-studio cordova visual-studio-cordova uwp
我正在使用Cordova构建一个包含Ext.js Web应用程序的UWP Windows 10应用程序.
我可以使用Cordova cordova build windows
和Sencha的系统成功构建应用程序sencha app build native
.这会输出一个文件夹,cordova\platforms\windows\AppPackages
其中包含一个.appx
文件,我可以在信任生成的密钥后安装该文件.
安装完成后,如果选中"完成后运行"复选框,则会加载应用程序并显示我们的登录屏幕.如果我通过按右上角的X关闭应用程序,然后从开始菜单重新打开应用程序,我看到的只是一个黑屏(实际颜色是#1d1f20).如果我卸载应用程序并重新安装,它将再次工作,但只能执行一次.任何后续关闭和重新打开都会导致黑屏.
如果我取消选中"完成后运行"复选框,然后我手动打开应用程序,我也会看到黑屏.
当显示黑屏时,如果按F12打开开发人员工具,然后按Ctrl和R重新加载,我会看到登录屏幕.没有控制台错误.
如果我cordova\platforms\windows\www
从那时打开web浏览器中的index.html文件,我会看到登录屏幕.
我尝试将配置添加到与启动屏幕相关的config.xml,但这对情况没有帮助.
重申一下,该应用程序可以运行一次(如果立即启动),但随后所有启动只显示黑屏,除非我打开开发人员工具并手动重新加载
如果我在Visual Studio中打开解决方案并在本地计算机上"运行",它可以工作,我会看到登录屏幕.
如果我去Build> Deploy Solution,它将在我的系统上安装应用程序并运行它并且它可以工作.
这实际上导致应用程序工作,即使在后续发布!
如果我转到Project> Store> Create App Packages并创建一个应用程序包,我会遇到相同的黑屏问题(旁注,这会创建.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>
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激.
编辑
我尝试使用新的空白Ext.js 6.5.3应用程序构建Cordova,并且在首次启动工作和随后启动白屏时也存在同样的问题.
编辑2
Sencha 的 Marc 通过提供更新的微加载器帮助我解决了这个问题。代码如下所示。
它使用不同的方式加载文件。
https://gist.github.com/djam90/79389bb82696b082b83da701e12373ef
另一种解决方案是通过修改 app.json 来完全禁用微加载器:
"production": {
"output": {
"microloader": {
"enable": false
}
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
663 次 |
最近记录: |