0
votes

I have imported an existing worklight project, but building it is giving following error. Please advice

Error

cvc-complex-type.2.4.a: Invalid content was found starting with element 'usage'. One of '{"http://www.worklight.com/application-descriptor":shell, "http://www.worklight.com/application-descriptor":mobileDeviceSSO, "http://www.worklight.com/application-descriptor":loginPopupHeight, "http://www.worklight.com/application-descriptor":loginPopupWidth, "http://www.worklight.com/application-descriptor":iphone, "http://www.worklight.com/application-descriptor":android, "http://www.worklight.com/application-descriptor":blackberry, "http://www.worklight.com/application-descriptor":ipad, "http://www.worklight.com/application-descriptor":windowsPhone, "http://www.worklight.com/application-descriptor":mobileWebApp, "http://www.worklight.com/application-descriptor":vista, "http://www.worklight.com/application-descriptor":dashboard, "http://www.worklight.com/application-descriptor":air, "http://www.worklight.com/application-descriptor":igoogle, "http://www.worklight.com/application-descriptor":facebook, "http://www.worklight.com/application-descriptor":embedded, "http://www.worklight.com/application-descriptor":common, "http://www.worklight.com/application-descriptor":worklightServerRootURL, "http://www.worklight.com/application-descriptor":worklightRootURL}' is expected. application-descriptor.xml /TWorklightProj/apps/TApp line 15 XML Problem

XML file

<?xml version="1.0" encoding="UTF-8" standalone="no"?> <application xmlns="http://www.worklight.com/application-descriptor" id="TApp" platformVersion="5.0">
        <displayName>TApp</displayName>
        <description>TApp</description>
        <author>
            <name>application's author</name>
            <email>application author's e-mail</email>
            <homepage>http://mycompany.com</homepage>
            <copyright>Copyright My Company</copyright>
        </author>
        <height>460</height>
        <width>320</width>
        <mainFile>index.html</mainFile>
        <thumbnailImage>common/images/thumbnail.png</thumbnailImage>
        <usage requireAuthentication="never"/>
        <iphone bundleId="com.ATTApp" version="1.0">
            <worklightSettings include="true"/>
            <security>
                <testAppAuthenticity enabled="false"/>
                <encryptWebResources enabled="false"/>
                <testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3"/>
            </security>
        </iphone>
        <android version="1.0">
            <worklightSettings include="true"/>
            <security>
                <testAppAuthenticity  enabled="false"/>
                <encryptWebResources enabled="false"/>
                <testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3"/>
                <publicSigningKey>Replace this text with the public key of the certificate with which you sign the APK. For details see the Worklight Developer's Reference Guide.</publicSigningKey>
            </security>
        </android>
        <mobileWebApp version="1.0"/>
        <worklightServerRootURL>http://${local.IPAddress}:8080</worklightServerRootURL> </application>
1

1 Answers

0
votes

It looks like you've upgraded the Worklight version and still have old application-descriptor.xml file. You need to modify your file to comply with the latest schema. Most basic solution would be to just erase this line. Also you can see samples of applications here - https://www.ibm.com/developerworks/mobile/worklight/getting-started/