Software Archive
Read-only legacy content

Confirmed: Windows Phone build server has a bug

Michael_O_2
New Contributor I
460 Views

Hello Intel Engineers!

I can confirm to you that there is a bug in the Cordova build for Windows 8 and WP 8.1

Two of my apps that failed to go beyond the splash screen on a WP8.1 device are now running perfectly when I used another IDE(MoSync)

The IDE generated a .xap file which is compatible with WP7/8/8.1

At this juncture, I think it's better for you to enable the legacy build for Windows 8/Phone 8.1 devices pending the time the bug is fixed. 

0 Kudos
10 Replies
PaulF_IntelCorp
Employee
460 Views

One significant difference may be the IE10 webview versus the IE11 webview. In our legacy build (and I suspect the MoSync build you generated) IE10 is used as the webview. In the new Cordova build systems IE11 is used. This may be the reason for the problems. I would like to confirm.

Can you provide more details about the MoSync build that you did that allowed your Win Phone app to work? This would be very useful information. If you could provide a copy of the project (ZIP of the ENTIRE project directory) and send me a PM with a link to this app, along with info regarding the alternate build process:

  • which version of CLI was used for the alternate build?
  • which version of MoSync was used?
  • did you change the code in any way between alternate build and XDK build for Win Phone?
  • any other info that you believe may be useful
0 Kudos
Michael_O_2
New Contributor I
460 Views

Dear Paul,

I used MoSync version 3.3.1 which was released in 2013. The Cordova version that was being used as at that time was 2.9

As for the code change, I added Wormhole.js(a phonegap library) which is the equivalent of cordova.js that was bundled with the MoSync IDE.

In order to confirm that Cordova library worked, I added an event listener and the accompanying function was called.

I am using Lumia 635 that is running on Windows Phone 8.1

The zip folder has been sent to you in a PM.

I hope this helps.

 

0 Kudos
Francisco_Barbosa_do
460 Views

Dears,

Why Intel XDK does not generate .xap file in apps for Windows Phone only appx??

Thanks

 

0 Kudos
Michael_O_2
New Contributor I
460 Views

Dear Francisco, the xap file was being generated before the build server was modified on December 14th,2015.

appx,aapxupload,appxbundle works with Win8+ and WP8+ but they are not backward compatible.

xap works for WP7+ and the build that was generating this file is no more in use by Intel.

0 Kudos
PaulF_IntelCorp
Employee
460 Views

Francisco, as Michael points out, the XAP files were only made by our "legacy" build option, which was recently retired. Please see this FAQ and the one following it for more details > https://software.intel.com/en-us/xdk/faqs/cordova#legacy-build-retired

0 Kudos
Olushola_O_
Beginner
460 Views

I really don't know anything about this... But thanks for sharing Micheal O. and Thanks sir Paul and the whole intel team for responding.

These MS guys need to settle up their OS.

0 Kudos
Michael_O_2
New Contributor I
460 Views

Dear Olushola,

Please note that the issue has nothing to do with Microsoft.

I have built Windows phone apps with Cordova.

The .xap extension is still being accepted by Microsoft store.

0 Kudos
PaulF_IntelCorp
Employee
460 Views

Hello Michael,

I've found what appears to be a solution for your app, and is likely a solution for others having trouble with Win Phone 8.1 apps that crash, so I'm publishing that solution here so everyone can benefit.

There is a significant change in the Windows Phone 8.1 webview and apps, compared to the "legacy" Windows Phone 8.0 webview and apps that appears to be causing the crash problems.

  • A "legacy" windows phone app is easily recognized as a XAP file.
  • A "universal" or "modern" Windows app for Windows Phone has an APPX extension.
  • At this time, the XDK Windows Phone 8.1 build tile will build an APPX file using the Cordova "windows" target.
  • Legacy XAP apps are built using the Cordova "wp8" target, which is considered obsolete by the Microsoft Cordova project team, and is not currently supported by the XDK build system.

Microsoft has provided a JavaScript library to help with this issue, although I am not able to fix ALL problems, I have found that it does help with some apps. In addition, many apps include a call to alert(), which is not supported in these Windows webviews (which, it turns out, is not a lack of compliance with standard HTML5, because alert() is an optional feature). To address these two issues I have combined the Microsoft code with a replacement for alert() into a single library that you should include as the first or one of the first libraries in your index.html file. There is no harm including this JS lib when building for other platforms, the code in it will only execute on a Windows platform.

Michael, in your case, I made the following changes to your index.html, which you should recognize and be able to try. As far as I can tell, your app appears to work with these changes. However, not know precisely what it should do, I can only guess at proper functionality. You'll have to be the one to test and confirm:

<!-- ;paf; -->
<!--    <meta http-equiv="X-Content-Security-Policy" content="default-src 'self' 'unsafe-inline' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">-->
<!--    <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">-->
<!-- ;paf; -->
<!-- ;paf; -->
<!--    <script src="assets/jquery.mobile-1.4.5.min.js" type="text/javascript"></script>-->
<!-- ;paf; -->
        <link rel="stylesheet" href="assets/jquery.min.css" type="text/css" />
        <link rel="stylesheet" href="assets/dash.css" type="text/css" />
        <link rel="stylesheet" href="wealth_assets/css/wealth.css" type="text/css" />


    <!-- <script src="js/init-dev.js" type="text/javascript"></script>-->
<!-- ;paf; -->
    <script src="js/xdk-win8x-compat.js"></script>
    <script src="js/jquery-1.9.1.js"></script>
<!--    <script src="js/jquery-1.12.0.js"></script>-->
<!--    <script src="js/jquery-2.2.0.js"></script>-->
<!--     <script src="assets/jquery.mobile-1.4.3.min.js" type="text/javascript"></script>-->
     <script src="assets/jquery.mobile-1.4.5.min.js" type="text/javascript"></script>
<!-- ;paf; -->
   <script src="js/phonejs.js" type="text/javascript"></script>
   <!-- <script src="assets/contacts.js" type="text/javascript"></script>-->
        <script src="assets/dash.js" type="text/javascript"></script>

<!-- ;paf; relocated -->
    <script src="cordova.js"></script>
    <!--<link rel="stylesheet" href="components/loader.css">
    <link rel="stylesheet" href="css/style.css">-->
    <script>
        // PhoneGap event handler
        document.addEventListener("deviceready", onDeviceReady, false);
        function onDeviceReady() {
//          alert("PhoneGap is ready");
          console.log("PhoneGap is ready");
        }
    </script>
<!-- ;paf; -->

        <script src="js/main.js" type="text/javascript"></script>
        <script src="assets/menu.js" type="text/javascript"></script>
        <script src="assets/validate.js" type="text/javascript"></script>
        <script src="assets/push.js" type="text/javascript"></script>

Note that this is an excerpt from your index.html, enough so that you should be able to recognize the changes I made. In particular:

  • adding the xdk-win8x-compat.js script to the project
  • relocating the jquery and jquery-mobile libs (I was experimenting with different versions)
  • relocating the cordova.js script
  • some experimenting with CSP, those experiments are inconclusive...

Note also that the alert I changed to console.log messages can be converted back to an alert, since the alert polyfill in that file will make those work. Without that polyfill, any call to alert hangs the app.

0 Kudos
Michael_O_2
New Contributor I
460 Views

Dear Paul,

I appreciate your effort on resolving this issue. I will try and recompile and see what happens.

As for the xap file generation, I had the same assumption before, but I have discovered that xap files are also generated by Cordova version 5.4.0 which is even higher than 5.1.1 

Thanks for your assistance.

I will try and build other apps without using the alert() function.

0 Kudos
Bhavya_A_
Beginner
460 Views

Dear Paul,

The app is still crashing after applying the solution you have provided  .

I am using cordova cli 5.1.1 and i am not using alert() method and included the js file you have mentioned in your solution . I am sending you the dummy project in PM please do help me finding the issue in my application .

Thanks 

Bhavya

 

0 Kudos
Reply