Phonegap 构建错误:哦,天哪。您的构建失败

Posted

技术标签:

【中文标题】Phonegap 构建错误:哦,天哪。您的构建失败【英文标题】:Phonegap Build Error : Oh geez. Your build failed 【发布时间】:2014-06-25 16:58:17 【问题描述】:

问题:我正在为我的 ios 应用程序开发人员使用 Phonegap Build 框架。而building 我将.p12 和.mobile 配置证书添加到应用程序并解锁。重建时,我遇到了奇怪的错误“哦,天哪。你的构建失败了。抱歉,构建服务器出现问题”。 所以,像往常一样,当我做谷歌时,我 found here 说我们需要在放置 phonegap/cardova 插件后放置第三方插件。但是,仍然没有运气! 我正在使用 8 个 phonegap 插件和 1 个第三方插件。请参考下面的 comfig xml 文件。

我的 config.xml:

<?xml version="1.0" encoding="UTF-8"?>

 <!-- config.xml reference: https://build.phonegap.com/docs/config-xml -->
 <widget xmlns     = "http://www.w3.org/ns/widgets"
    xmlns:gap = "http://phonegap.com/ns/1.0"
    id        = "com.my.app"
    version   = "1.0">

<name>My app name</name>

<description>
  my first app in phonegap
</description>

<author href="http://myself.com" email="support@myself.com">
    myself
</author>

<preference name="permissions"                value="none"/>
<!-- Customize your app and platform with the preference element. -->
<preference name="phonegap-version"           value="3.3.0" />    <!-- all: current version of PhoneGap -->
<preference name="orientation"                value="default" />        <!-- all: default means both landscape and portrait are enabled -->
<preference name="target-device"              value="universal" />      <!-- all: possible values handset, tablet, or universal -->
<preference name="fullscreen"                 value="true" />           <!-- all: hides the status bar at the top of the screen -->
<preference name="webviewbounce"              value="false" />           <!-- ios: control whether the screen 'bounces' when scrolled beyond the top -->
<preference name="prerendered-icon"           value="true" />           <!-- ios: if icon is prerendered, iOS will not apply it's gloss to the app's icon on the user's home screen -->
<preference name="stay-in-webview"            value="false" />          <!-- ios: external links should open in the default browser, 'true' would use the webview the app lives in -->
<preference name="ios-statusbarstyle"         value="black-opaque" />   <!-- ios: black-translucent will appear black because the PhoneGap webview doesn't go beneath the status bar -->
<preference name="detect-data-types"          value="true" />           <!-- ios: controls whether data types (such as phone no. and dates) are automatically turned into links by the system -->
<preference name="exit-on-suspend"            value="false" />          <!-- ios: if set to true, app will terminate when home button is pressed -->
<preference name="show-splash-screen-spinner" value="true" />           <!-- ios: if set to false, the spinner won't appear on the splash screen during app loading -->
<preference name="auto-hide-splash-screen"    value="true" />           <!-- ios: if set to false, the splash screen must be hidden using a javascript API -->
<preference name="disable-cursor"             value="false" />          <!-- blackberry: prevents a mouse-icon/cursor from being displayed on the app -->
<preference name="android-minSdkVersion"      value="10" />              <!-- android: MIN SDK version supported on the target device. MAX version is blank by default. -->
<preference name="android-installLocation"    value="auto" />           <!-- android: app install location. 'auto' will choose. 'internalOnly' is device memory. 'preferExternal' is SDCard. -->
<preference name="SplashScreenDelay" value="1000" />


 <!-- make the statusbar hiden from webview -->
 <gap:plugin name="com.phonegap.plugin.statusbar" /> 
 <preference name="StatusBarOverlaysWebView" value="false" />

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

 <access origin="*" />   

  <!-- Defined splash screen  and icons here and works fine ... -->

问题:这个错误的真正原因是什么?有什么明确而快速的解决方案吗?

/* ** 更新 ** */

我能够克服这个错误!!但前提是我添加了那些不必要的插件[未注释 config.xml 文件中剩余的 11 个插件]。 有没有办法避免这些插件并解决这个错误?任何帮助都非常感谢并提前感谢。

【问题讨论】:

你试过删除注释行吗? @DawsonLoudon:是的!如果我在没有注释插件的情况下构建,它将起作用。但我不想包含这些插件,因为我没有使用它们。 对,我建议不要将它们注释掉,而是删除那些不需要的行。我想知道注释行是否导致构建错误?因此,也许可以尝试将它们全部删除,它可能会解决问题。 【参考方案1】:
<feature name="http://api.phonegap.com/1.0/device" />
<feature name="http://api.phonegap.com/1.0/network" />
<feature name="http://api.phonegap.com/1.0/camera" />

<plugin name="Camera" value="org.apache.cordova.CameraLauncher" />
<plugin name="Geolocation" value="org.apache.cordova.Geolocation" />

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

<gap:config-file platform="ios" parent="UIStatusBarHidden">
    <true/>
</gap:config-file>
<gap:config-file platform="ios" parent="UIViewControllerBasedStatusBarAppearance">
    <false/>
</gap:config-file>    

<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="permissions" value="none" />
<preference name="orientation" value="default" />
<preference name="phonegap-version" value="3.6.3" />  
<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="show-splash-screen-spinner" value="true" />
<preference name="auto-hide-splash-screen" value="true" />
<preference name="disable-cursor" value="false" />
<preference name="android-minSdkVersion" value="7" />
<preference name="android-installLocation" value="auto" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-windowSoftInputMode" value="adjustResize" />

像上面的代码一样更新你的 config.xml。我认为这是工作。和你一样是我的错;

天哪。您的构建失败。抱歉,构建时出现问题 服务器通知我们

第二个解决方案。如果您的 config.xml 地理位置版本是 0.3.10 替换为 0.3.7

<gap:plugin name="org.apache.cordova.geolocation" version="0.3.10" />

用这个替换

<gap:plugin name="org.apache.cordova.geolocation" version="0.3.7" />

【讨论】:

以上是关于Phonegap 构建错误:哦,天哪。您的构建失败的主要内容,如果未能解决你的问题,请参考以下文章

Phonegap 3.3 构建安卓失败

Phonegap 文件传输插件导致 Android 构建失败

Cordrova 后台地理位置 phonegap 构建失败

Ionic ios 构建因 phonegap-plugin-barcodescanner 失败

无法使用 phonegap 构建 iOS 应用程序

phonegap 中格式错误的 config.xml 错误