Phonegap 2.9.0, Windows Phone 8, Durandal 2.0, XAP runtime issue

We are trying to get the application PhoneGap 2.9, Durandal 2.0, running on Windows Phone 8. We were able to follow the steps to deploy the application in the emulator and on the device through a visual studio. However, we have a problem with the application when it is built in VS, and then the finished .xap is deployed to the device using the application deployment tool. The splash screen loads, but then a black screen appears.

We adjusted the path to www, as suggested in this blog post http://mikaelkoskinen.net/durandal-phonegap-windows-phone-8-tutorial/ , which received the application working on the emulator, but not on the device.

We also tried to create xap using the phonegap assembly, as it now supports Windows 8 in beta - http://phonegap.com/blog/2013/10/18/2013-10-18-phonegap-build-support- for-windows-phone-8 / . This led to a similar result.

We believe that the main.js and index.html files load fine, but the problem is somehow related to requirejs and durandal 2.

Does anyone else use this combination of tools (or later), and if they know where we are going wrong.

+8
cordova windows-phone-8 durandal
source share
1 answer

We managed to solve the problem, so for anyone who might run into the problem, the following information may be useful.

1) Modify the File.cs files as described in the blog post: http://mikaelkoskinen.net/durandal-phonegap-windows-phone-8-tutorial/

2) In addition to the above change, we found that it is also necessary to change the parameters read from the parameter into the readResourceAsText method in File.cs, as follows from the fact that PhoneGap does not require other parameters and it seems that it doesn’t pass them:

string[] optStrings = getOptionStrings(options); string pathToResource = optStrings[0]; //string encStr = optStrings[1]; //int start = int.Parse(optStrings[2]); //int endMarker = int.Parse(optStrings[3]); string callbackId = optStrings[1]; 

3) For some reason, the combination of Windows Phone, PhoneGap and Durandal is also very fussy about the folder structure of the application. Initially, we tried to use our own folder structure, which made sense to us. (That is, do not use the "app" subfolder, which is used in the example with the Durandal bullet set, and also have the main.js, viewmodels and views folders in the www root directory.) As stated in this question, this was not a problem for any to another platform or in debug mode, so we’re not sure what the main problem is, but the folder structure must exactly match what Durandal for Windows Phone comes with in release mode.

For more information, we also got this job in PhoneGap 3.1. (The same modifications may apply as above, including a modification to the File.cs plugin.)

We also tried the PhoneGap assembly, which now supports PhoneGap 3.0, but the application crashes. This is due to changes that are required for File.cs that are not used in the assembly. Until this is fixed, it is not possible to use the PhoneGap assembly using the Durandal application for Windows Phone 8.

+7
source share

All Articles