0 Replies Latest reply on Feb 10, 2017 5:27 AM by inforl94196165

    There is an error in XML document (20, 2) - again

    inforl94196165

      Hi,

       

      I’ve an issue that looks like something on the PhoneGap Build server. It’s mostly about an error ‘There is an error in XML document (20, 2)’. There are many references to it on the internet and this forum, but no clear solutions, and it looks like I’ve ruled out issues in my own source.

       

      The background: I’ve an app that works fine in the stores for Android, iOS and Windows Phone 8.1. It was built last year with PhoneGap Build cli-5.2.0. It uses about 8 plugins.

       

      But now we need a small enhancement, and as the old pgb repository is no longer available, we have to migrate. Ideally, we want to upgrade to the latest version of the cli and the latest versions of the plugins. That seems to work fine for Android and iOS but not for Windows. I basically tried two things:

       

      1. Upgrade to cli-6.4.0 (also tried other versions in the cli-6*).

       

      Frustratingly, about 60-80 percent of the builds fail with no logs, just: Build Date: 2017-02-10 11:36:52 +0000. This seems to be a server issue not related to my code (tapping rebuild sometimes works).

       

      But sometimes it compiles ok, giving an appx-file which I tried to install on my physical device using Visual Studio 2013 > Tools > Windows Phone 8.1 tools > Application Deployment. A few days ago that worked a few times, but somehow it doesn’t work anymore. I now consistently get that XML-error. It looks like something is wrong with the AppxManifest.xml, as in that file the XML starts at line 20. But the structure of the XML is valid and I cannot find any other errors.

       

      My initial guess was that I did something wrong in the config.xml. As the documentation is a mess (sorry, but true), I cannot get clear what platform codes to use, so started systematically trying various combinations: ‘wp8’, ‘winphone’ and ‘windows’, combined with various values of windows-appx-target, either with or without .pfx file and all kinds of other things. Nothing works.

       

      In order to make sure that it isn’t something in my code, I downloaded the sample in the following url: https://github.com/phonegap/phonegap-template-hello-world.git. I just gave it another name and author, and added two lines in order to build for Windows 8.1 Phone:

      <preference name="windows-appx-target" value="8.1-phone" />

      <preference name="windows-identity-name" value="<MyCompanyName>.<MyName>" />

      I tried with and without key, but all give that same XML error at install.

       

      I more or less tried all this as a Cordova project in Visual Studio 2015 as well and that works fine. However, I've no Mac, and not looking forward to different streams for Windows and the other platforms, I would like to stick to PB.

       

      Anyway, I believe it must be on the server. If it is still something at my side, it would be very nice if somebody could list the various causes of the issue as it seems to be quite common for others as well.

       

      2. As an alternative, just for Windows, I considered going back to cli-5.2.0, just bringing the plugin-references up to date like this:

      <plugin name="cordova-plugin-device" source="npm" />

       

      Again, this works fine for Android and iOS, but not for Windows. It looks like the javascript-files for the plugins aren’t added to the xap-file. In the original version, they were in www/plugins, but this directory is no longer there.

       

      I tried this with the sample project as well, this time leaving out these preferences that seem to be related to cli-6*, windows-appx-target and windows-identity-name

      This fails in the same way, there are no plugins, so it can hardly be an issue at my side. Is this cli-version broken? At least for the device-plugin there is a reference to a build failure for Windows Phone on npm, but I don't know what that means.

       

      Only solution to above problems that I can imagine is that there is some mismatch between the parameters in the .pfx file and the config.xml. But I believe I followed the specs for that, though again, the docs are not very clear.

       

      My app id is 1220378. Device is Nokia Lumia 630, Windows Phone 8.1 Update. It says it’s all up to date.