Why now? Error about malformed config.xml

  • 1
  • Problem
  • Updated 4 years ago
My last build was 23 days ago. Worked great as it has been for months before.

Now, I go back to PGB, and Update my code, FROM THE SAME FILES and I get an "Unable to create app: mallformed config.xml" error.

Nothing changed. Identical files. XML validator checks.

Has something changed on the server side in 23 days that will now reject the same file that worked before?

It should be noted that the config.xml file is still placed in the root directory, above the www directory. This has always worked.

It appears the requirements for PGB have changed in the last couple weeks.

Here's config.xml that has not changed and working for months until today.
Photo of Jon Farhat

Jon Farhat

  • 38 Posts
  • 1 Reply Like

Posted 4 years ago

  • 1
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Jon,
this would be a good time to go through the blog posts. You might note that some elements have been removed from service.

Otherwise, post your config.xml.

Jesse

When posting code, please use some HTML (like <code></code>). (see attached image)

Photo of Jon Farhat

Jon Farhat

  • 38 Posts
  • 1 Reply Like
Thanks Jesse. Yeah I was having trouble pasting code, unlike Github, or Stack where you could precede with 4 spaces.

Here's my config.xml



<?xml version='1.0' encoding='utf-8'?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" id="com.domain.app" version="1.3.3">
<name>Name of App</name>
<description>This App Does This</description>
<author href="http://domain.com" email="support@domain.com">Development Team</author>
<content src="index.html"/>

<preference name="permissions" value="none"/>
<preference name="orientation" value="default"/>
<preference name="target-device" value="universal"/>
<preference name="fullscreen" value="true"/>
<preference name="webviewbounce" value="true"/>
<preference name="prerendered-icon" value="true"/>
<preference name="stay-in-webview" value="false"/>
<preference name="ios-statusbarstyle" value="black-opaque"/>
<preference name="detect-data-types" value="true"/>
<preference name="exit-on-suspend" value="false"/>
<preference name="disable-cursor" value="false"/>
<preference name="android-minSdkVersion" value="14"/>
<preference name="android-installLocation" value="auto"/>
<preference name="disable-push-notifications" value="1" />

<!-- Specifying CLI version for disabling push notifications -->
<preference name="phonegap-version" value="cli-6.0.0" />

<!-- To avoid the Apple Notifications warning -->
<preference name="disable-push-notifications" value="1" />

<!-- Android -->
<preference name="SplashScreenDelay" value="4000" />
<!-- iOS Splash screen-->

<preference name="show-splash-screen-spinner" value="false" />
<preference name="FadeSplashScreenDuration" value="2000" />
<preference name="FadeSplashScreen" value="true" />

<!-- Splash screen Plugin -->
<plugin name="cordova-plugin-splashscreen" />

<plugin name="org.apache.cordova.battery-status"/>
<plugin name="org.apache.cordova.camera"/>
<plugin name="org.apache.cordova.media-capture"/>
<plugin name="org.apache.cordova.console"/>
<plugin name="org.apache.cordova.contacts"/>
<plugin name="org.apache.cordova.device"/>
<plugin name="org.apache.cordova.device-motion"/>
<plugin name="org.apache.cordova.device-orientation"/>
<plugin name="org.apache.cordova.dialogs"/>
<plugin name="org.apache.cordova.file"/>
<plugin name="org.apache.cordova.file-transfer"/>
<plugin name="org.apache.cordova.geolocation"/>
<plugin name="org.apache.cordova.globalization"/>
<plugin name="org.apache.cordova.inappbrowser"/>
<plugin name="org.apache.cordova.media"/>
<plugin name="org.apache.cordova.network-information"/>
<plugin name="org.apache.cordova.vibration"/>

<icon src="icon.png"/>
<icon src="res/icon/android/icon-36-ldpi.png" platform="android" qualifier="ldpi"/>
<icon src="res/icon/android/icon-48-mdpi.png" platform="android" qualifier="mdpi"/>
<icon src="res/icon/android/icon-72-hdpi.png" platform="android" qualifier="hdpi"/>
<icon src="res/icon/android/icon-96-xhdpi.png" platform="android" qualifier="xhdpi"/>
<icon src="res/icon/blackberry/icon-80.png" platform="blackberry"/>
<icon src="res/icon/blackberry/icon-80.png" platform="blackberry" state="hover"/>

<icon src="res/icon/ios/icon-57.png" platform="ios" width="57" height="57"/>
<icon src="res/icon/ios/icon-72.png" platform="ios" width="72" height="72"/>
<icon src="res/icon/ios/icon-76.png" platform="ios" width="76" height="76"/>
<icon src="res/icon/ios/icon-57-2x.png" platform="ios" width="114" height="114"/>
<icon src="res/icon/ios/icon-120.png" platform="ios" width="120" height="120"/>
<icon src="res/icon/ios/icon-72-2x.png" platform="ios" width="144" height="144"/>
<icon src="res/icon/ios/icon-152.png" platform="ios" width="152" height="152"/>

<icon src="res/icon/webos/icon-64.png" platform="webos"/>
<icon src="res/icon/windows-phone/icon-48.png" platform="winphone"/>
<icon src="res/icon/windows-phone/icon-173-tile.png" platform="winphone" role="background"/>

<splash src="splash.png" />

<!-- Android -->
<splash src="res/screen/android/ldpi.png" platform="android" qualifier="port-ldpi"/>
<splash src="res/screen/android/mdpi.png" platform="android" qualifier="port-mdpi"/>
<splash src="res/screen/android/hdpi.png" platform="android" qualifier="port-hdpi"/>
<splash src="res/screen/android/xhdpi.png" platform="android" qualifier="port-xhdpi"/>
<splash src="res/screen/android/xxhdpi.png" platform="android" qualifier="port-xxhdpi" />
<!-- iPhone and iPod touch -->
<splash src="res/screen/ios/Default.png" platform="ios" width="320" height="480"/>
<splash src="res/screen/ios/Default@2x.png" platform="ios" width="640" height="960"/>
<!-- iPhone 5 / iPod Touch (5th Generation) -->
<splash src="res/screen/ios/Default-568h.png" platform="ios" width="320" height="568"/>
<splash src="res/screen/ios/Default-568h@2x.png" platform="ios" width="640" height="1136"/>
<!-- iPhone 6 -->
<splash src="res/screen/ios/Default-667h@2x.png" platform="ios" width="750" height="1334" />
<splash src="res/screen/ios/Default-Portrait-736h@3x.png" platform="ios" width="1242" height="2208" />
<splash src="res/screen/ios/Default-Landscape-736h@3x.png" platform="ios" width="2208" height="1242" />
<!-- iPad -->
<splash src="res/screen/ios/Default-Portrait.png" platform="ios" width="768" height="1024"/>
<splash src="res/screen/ios/Default-Landscape.png" platform="ios" width="1024" height="768"/>
<!-- Retina iPad -->
<splash src="res/screen/ios/Default-Portrait@2x.png" platform="ios" width="1536" height="2048"/>
<splash src="res/screen/ios/Default-Landscape@2x.png" platform="ios" width="2048" height="1536"/>
<!-- Windows Phone -->
<splash src="res/screen/windows-phone/screen-portrait.jpg" platform="winphone"/>

<access origin="*"/>
<plugin name="cordova-plugin-whitelist" version="1"/>
<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>
</widget>

Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
A bit of feedback:

1. Your XML as posted validates. However, things like leading whitespace, invalid encoding (etc) can't be detected from a copied XML display. That would require the actual file.
However, on screen in this forum, it appears as if there is some whitespace preceding the XML declaration line.

2. You are specifying the names of the old, deprecated plugins from the pgb repo, like <plugin name="org.apache.cordova.camera"/>
Although PGB will try and translate the names to the correct names at npm, this might sometimes fail in cli-6.0.0
I would strongly recommend to exclusively use the names as published at npm. Example:
<plugin name="cordova-plugin-camera"/>

3. Since you already have the file-transfer plgin, there is no need to specify the file plugin, since that's already integrated in the file-transfer plugin. I suggest to remove the file plugin

4. You have Android icons up to xhdpi. I would suggest to include such icons for xxhdpi and xxxhdpi as well

5. You can remove everything related to blackberry and webos, since these platforms aren't supported by PGB, anyway.
Also, you can remove everything for winphone, because you exclude that OS by using platform elements for Android and iOS.

6. You have the required icons for iOS, but not all recommended icons. See https://developer.apple.com/library/i...

7. You have specified default orientation, which means both portrait and landscape. However, for Android, you have splashes with qualifier for portrait, only. No landscape splashes.
For iOS, you included several landscape splashes as well, but not for all dimensions.
The splashscreen image collection looks a bit sloppily assembled.

8. You have <plugin name="cordova-plugin-whitelist" version="1"/>
Version-1 of this plugin doesn't exist and it's not a valid wildcard for similar version numbers. Remove the version attribute or pin the plugin to a valid/existing version.

9. You can conveniently replace
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>

by
<allow-intent href="*"/>
Photo of Jon Farhat

Jon Farhat

  • 38 Posts
  • 1 Reply Like
@Petra - thank you for your time to review and your suggestions. I'd love to add you to the App Store external Beta, so you can download and view the app as it's working quite well. Just to get your feedback. Do you have iOS tablet available?
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Glad it's working well, now. Thanks for reporting back and for the invitation...but no, thanks. I'll happily try and assist here, but installing and using developed apps feels like one step too far.
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Jon,
did you read the blog?
Jesse
Photo of Jon Farhat

Jon Farhat

  • 38 Posts
  • 1 Reply Like
Yes, but didn't see any deprecated stuff that relates to this. Unless I missed something. does anything stand out to you.
Photo of Chris Griffith

Chris Griffith, Champion

  • 347 Posts
  • 92 Reply Likes
The only thing I saw was the reference to a generic splash screen. Although there is one for the icon, there is not one for splash screens. I might have missed something esle

<splash src="splash.png" />
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
No Chris. It's in the documentation. It is required.
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Chris
See: Docs -> Configuring -> Icons and Splash Screens -> Splashscreens
See Default
Jesse
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Jon

You appear to be a seasoned developer, but this is one of the many pitfalls of using Phonegap Build. Unless you have a good reason for using cli-6.0.0, I would step back to cli-5.2.0. There are tons of bugs that have been found up until now.

I think the latest pitfall, is you have to follow the blog and make all the changes since Nov of 2015 for cli-6.0.0 to work.
Namely, you need to

  • use the <platform> element to separate your sections.
  • be conservative when adding new elements. Many of the new elements (especially in preference) step on each other.
  • use version with your plugins

However, the most common issue is to have the first character of the file be a space (" "). However, W3C validator usually catches this.

I think you should wait until Petra logs in. Petra knows this subject better than I do. Petra and jcesarmobile will be on after 2am. I think they are both in Europe.

In the meantime, I would suggest you read more of the blog AND make the changes the blog is suggesting. To be clear, many, many changes have been made to config.xml since Nov 2015.

Jesse
Photo of Jon Farhat

Jon Farhat

  • 38 Posts
  • 1 Reply Like
Thank you for the notes. I'll wait for Petra as well. I'll change back to 5.2.0, but for the record, I changed to 6.0.0 only after I got the error. Thinking that might help.

What I've noticed now, is an intermittent issue. Sometimes it works, sometimes it doesn't. Then other errors are thrown out, then disappear. Such as 'Unable to que..." Then a few hours later. No problem.

also for the record, I'm pulling my update from Github, which has been working famously until today. I got a build now, without changing a thing. I suspect I may see it pop up again tomorrow.

This has to be a server thing.
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
This is a canned message on the work-flow and transient errors.

Canned message
Sometimes it is a transient error. First, retry your build after some time, 10-20 minutes is good.

Occasionally, the webbrowser hangs, restart your webbrowser and see if that helps. On very rare occasions, clearing the cache helps; try this last.

You can always check the status of the build servers at: http://status.build.phonegap.com/

If it appears like you can solve the problem, check the documentation under: Failed Builds

You can also check the Error Log (see attached image).
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
For the record, github has been troublesome for the last few days.
We have had trouble pulling pluings for the last 48 hours.

https://status.github.com/