更新phonegap中的代码时出现格式错误的config.xml错误

时间:2016-07-19 07:39:20

标签: xml cordova phonegap-plugins phonegap-build

我是phonegap的新手。我正在使用phonegap构建。我根据格式创建了所有文件并上传了文件.i成功创建了apk。然后我在文件中进行更改,但是当我尝试更新代码时,它会显示错误的malformed config.xml。所以下面我展示了config.xml文件的代码我认为错误在该文件中。所以请帮我找出错误是什么? enter code here

<?xml version='1.0' encoding='utf-8'?>

<widget id="com.phonegap.hybridapp" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">

    <name>Hybrid App</name>

    <description>
        Hello World sample application that responds to the deviceready event.
    </description>

    <author  email="nidhinjohny777@gmail.com">
        Nidhin johny
    </author>

    <!-- Define the main entry-point to the application -->
    <content src="index.html" />

    <!-- Customize your app and platform with the preference element. -->

    <!-- android: MIN SDK version supported on the target device. MAX version is blank by default. -->
    <preference name="android-minSdkVersion"      value="14" />
<!-- Core/Common Preferences -->


<preference name="Fullscreen" value="true"/> 

<preference name="DisallowOverscroll" value="true"/> 

<preference name="Orientation" value="landscape"/>

<preference name="HideKeyboardFormAccessoryBar" value="false"/>

<preference name="BackgroundColor" value="0xff0000ff"/>


<!--iOS Preferences-->

<preference name="EnableViewportScale" value="true"/> 

<preference name="KeyboardDisplayRequiresUserAction" value="false"/>

<preference name="MediaPlaybackRequiresUserAction" value="true"/>

<preference name="AllowInlineMediaPlayback" value="true"/>

<preference name="BackupWebStorage" value="false"/>

<preference name="SuppressesIncrementalRendering" value="true"/>

<preference name="GapBetweenPages" value="0"/>

<preference name="PageLength" value="0"/>

<preference name="PaginationBreakingMode" value="page"/>

<preference name="PaginationMode" value="unpaginated"/>

<preference name="UIWebViewDecelerationSpeed" value="fast"/>


<!--Android Preferences-->

<preference name="KeepRunning" value="false"/> 

<preference name="LoadUrlTimeoutValue" value="10000"/>

<preference name="SplashScreen" value="mySplash"/>

<preference name="SplashScreenDelay" value="10000"/>

<preference name="InAppBrowserStorageEnabled" value="true"/>

<preference name="LoadingDialog" value="My Title,My Message"/>

<preference name="LoadingPageDialog" value="My Title,My Message"/>

<preference name="ErrorUrl" value="myErrorPage.html"/>

<preference name="ShowTitle" value="true"/>

<preference name="LogLevel" value="VERBOSE"/>

<preference name="SetFullscreen" value="false"/>

<preference name="AndroidLaunchMode" value="singleTop"/>
    <!-- Define a specific version of PhoneGap to build into your app. -->
    <!-- <preference name="phonegap-version"       value="cli-6.0.0" /> -->

    <!-- Plugins -->

    <!-- Define app icon and splashscreen for each platform. -->
    <icon src="logo.png" />
    <platform name="android">
     <icon src = "www/res/icon/android/icon-36-ldpi.png" 
      gap:platform = "android" gap:qualifier = "ldpi" />

   <icon src = "www/res/icon/android/icon-48-mdpi.png" 
      gap:platform = "android" gap:qualifier = "mdpi" />

   <icon src = "www/res/icon/android/icon-72-hdpi.png" 
      gap:platform = "android" gap:qualifier = "hdpi" />

   <icon src = "www/res/icon/android/icon-96-xhdpi.png" 
      gap:platform = "android" gap:qualifier = "xhdpi" />

   <icon src = "www/res/icon/android/icon-144-xxhdpi.png" 
      gap:platform = "android" gap:qualifier = "xxhdpi" />

  <icon src = "www/res/icon/android/icon-192-xxxhdpi.png" 
      gap:platform = "android" gap:qualifier = "xxxhdpi" />

      <splash src="www/res/screens/android/screen-hdpi-portrait.png"    density="hdpi" />
        <splash src="www/res/screens/android/screen-ldpi-portrait.png"     density="ldpi"/>
        <splash src="www/res/screens/android/screen-mdpi-portrait.png"    density="mdpi" />
        <splash src="www/res/screens/android/screen-xhdpi-portrait.png"    density="xhdpi" />

   </platform>
    <platform name="ios">

   <icon src = "www/res/icon/ios/icon.png" gap:platform = "ios" width = "57" height = "57" />
   <icon src = "www/res/icon/ios/icon-72.png" gap:platform = "ios" width = "72" height = "72" />
   <icon src = "www/res/icon/ios/icon-2x.png" gap:platform = "ios" width = "114" height = "114" />
   <icon src = "www/res/icon/ios/icon-72-2x.png" gap:platform = "ios" width = "144" height = "144" />
        <splash src="www/res/screen/ios/screen-ipad-portrait.png"     platform="ios" width="768"  height="1024" />
        <splash src="www/res/screen/ios/screen-ipad-portrait-2x.png"  platform="ios" width="1536"  height="2048" />
        <splash src="www/res/screen/ios/screen-iphone-portrait.png"               platform="ios" width="320" height="480" />
        <splash src="www/res/screen/ios/screen-iphone-portrait-2x.png"     platform="ios" width="640" height="960" />
        <splash src="www/res/screen/ios/screen-iphone-portrait-568h-2x.png"  platform="ios" width="640" height="1136" />
         <splash src="www/res/screen/ios/screen-iphone-portrait-667h.png"  platform="ios" width="750" height="1334" />
          <splash src="www/res/screen/ios/screen-iphone-portrait-736h.png"  platform="ios" width="1242" height="2208" />
   </platform>
     <platform name="windows">
<icon src = "www/res/icon/ios/icon.png" gap:platform = "windows" gap:qualifier = ""/>
   <icon src = "www/res/icon/ios/icon.png" gap:platform = "ios" width = "57" height = "57" />
   <icon src = "www/res/icon/ios/icon-72.png" gap:platform = "ios" width = "72" height = "72" />

    <access origin="*" />


    <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>  

1 个答案:

答案 0 :(得分:0)

config.xml中似乎存在语法错误。

在您的config.xml中,您已使用<platform name="windows">为Windows平台打开了标记,但在打开Android的其他平台标记之前,您尚未关闭Windows的平台标记。

Windows平台的图标源应在config.xml,

中按如下方式更正
<platform name="windows">
    <icon src = "www/res/icon/ios/icon.png" gap:platform = "windows" gap:qualifier = ""/>
    <icon src = "www/res/icon/ios/icon.png" gap:platform = "ios" width = "57" height = "57" />
    <icon src = "www/res/icon/ios/icon-72.png" gap:platform = "ios" width = "72" height = "72" />
</platform>