简体   繁体   English

如何在Windows 10上构建Cordova应用程序(通用)

[英]How to build a Cordova app to windows 10 (universal)

I'm currently developing a Cordova application with jQuery Mobile by using sublime text 3 and using Ripple to emulate my devices (I'll reference this project as SublimeProject ). 我目前正在通过使用Sublime文本3并使用Ripple来模拟我的设备来使用jQuery Mobile开发Cordova应用程序(我将这个项目称为SublimeProject )。

I can build apps for IOS, Android and Win8. 我可以为IOS,Android和Win8构建应用程序。 But now I need to build it for Windows 10. Apparently this doesn't work with my setup. 但是现在我需要为Windows 10构建它。显然,这不适用于我的设置。

A colleague of mine told me to import the project in Visual Studio (I'll reference this as VSProject ), add the plugins in the config.xml, copy over the files to the www folder and run it. 我的一个同事告诉我要在Visual Studio中导入项目(我将其称为VSProject ),在config.xml中添加插件,将文件复制到www文件夹并运行它。 Problem here is that it just doesn't work. 这里的问题是它根本不起作用。
When I try to run it on Android with the Ripple - Nexus (Galaxy) emulator, it'll give me a warning like this: 当我尝试使用Ripple - Nexus (Galaxy)模拟器在Android上运行它时,它会给我这样的警告:

I Haz CHeeseburger?!?!
PushPlugin.register

We seem to be missing some stuff :(

What is kinda cool though you can fill in the textarea to pass a json object to the callback you want to execute
Success!    Fail!

But when I press Fail! 但是当我按下Fail! the program will just work, somehow. 该程序将以某种方式工作。 My console shows me the following for ripple.js: 我的控制台向我显示了涟漪.js的以下内容:

ripple.js:37 Ripple :: Environment Warming Up (Tea. Earl Grey. Hot.)
ripple.js:51 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
ripple.js:51 GET http://localhost:4400/config.xml 404 (Not Found)(anonymous function) @ ripple.js:51module.exports.initialize @ ripple.js:51_baton.pass @ ripple.js:13xhr.onreadystatechange @ ripple.js:39
ripple.js:37 cordova :: Initialization Finished (Make it so.)
ripple.js:37 cordova :: Native back button handler was detached.
ripple.js:41 missing exec:PushPlugin.register
ripple.js:48 PushPlugin
ripple.js:48 register

Makes sense that something is wrong with pushplugin , but can't figure out what. 有道理, pushplugin ,但无法弄清楚是什么。

Additional, when I try to run the application on Windows-AnyCPU (which my actual intent is), the application will just show me the default cordova splash screen and hang there: 另外,当我尝试在Windows-AnyCPU上运行该应用程序时(我的实际意图是),该应用程序将仅向我显示默认的cordova启动屏幕并挂在那里:

在此处输入图片说明

So that's where I'm at. 那就是我的位置。 I need to figure out a way to get the app to run on Windows 10. Prefered to use Visual Studio because I know it has an option to build me an .xap file. 我需要找出一种使该应用程序在Windows 10上运行的方法。首选使用Visual Studio,因为我知道它可以选择为我构建.xap文件。

Updates: 更新:

Update 1 更新1

I'm tracing where the PushPlugin error comes from. 我正在跟踪PushPlugin错误的来源。

try {
        pushNotification = window.plugins.pushNotification;
}

pushNotification seems to be undefined, yet in my config.xml I have the following line: pushNotification似乎是未定义的,但是在我的config.xml中,有以下行:
<gap:plugin name="com.phonegap.plugins.pushplugin" version="2.4.0" />

Update 2 更新2

The pushplugin doesn't seem to be relevant, because when debugging in Visual Studio, I'll find the pushNotification to be not undefined. pushplugin似乎无关紧要,因为在Visual Studio中进行调试时,我会发现pushNotification 不是未定义的。 Currently there is nothing pointing to a good reason why I only see the splash screen instead of my application. 当前,没有什么可以说明为什么我只看到启动屏幕而不是我的应用程序的充分理由。

我有同样的问题,原来是由于$ stateProvider中的URL重复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM