Phonegap显示错误-“哦,天哪。您的构建失败。”

时间:2018-08-13 16:08:10

标签: phonegap-plugins phonegap-build phonegap

我正在为我的Android应用程序使用Phonegap Build,并且在编译时遇到以下错误:

  

哦,天哪。您的构建失败。单击上方的“日志”按钮以查看编译日志。如果您需要诊断问题的帮助,可以使用您的应用ID将其发布到支持论坛。

XML

 <?xml version="1.0" encoding="utf-8" ?>
    <widget xmlns = "http://www.w3.org/ns/widgets"
        xmlns:gap = "http://phonegap.com/ns/1.0"
        xmlns:android = "http://schemas.android.com/apk/res/android"
        id        = "kmcrs.mobibbhvle.app"
        versionCode = "22"
        version   = "2.2">
        <name>bobile App</name>
        <description>
            bobile mobile app version
        </description>
        <author email="mmakhan669@gmail.com" href="ujairo.com">
            Ujairo.com
        </author>

        <content src="index.html" />

        <preference name="orientation" value="portrait" />
        <preference name="android-build-tool" value="gradle" />     
        <preference name="phonegap-version" value="cli-7.1.0" />

        <gap:plugin name="cordova-plugin-whitelist" source="npm" />

        <gap:plugin name="phonegap-plugin-push" source="npm" spec="1.11.1"  /> 


        <gap:plugin name="cordova-plugin-device" source="npm" />        
        <gap:plugin name="cordova-plugin-inappbrowser" source="npm" />      
        <gap:plugin name="cordova-plugin-splashscreen" source="npm" />  
        <gap:plugin name="cordova-plugin-geolocation" source="npm" spec="1.0.1" />
        <gap:plugin name="cordova-plugin-network-information" source="npm" />

        <gap:plugin name="cordova-plugin-request-location-accuracy" source="npm"  spec="2.2.3" />   
        <gap:plugin name="cordova-plugin-x-toast" source="npm" spec="2.6.2" />  


        <gap:plugin name="cordova-plugin-media" source="npm" spec="5.0.0" />    
        <gap:plugin name="cordova.plugins.diagnostic" source="npm" spec="4.0.8" />  

        <gap:plugin name="cordova-plugin-googlemaps"  source="npm" spec="2.3.10" >
           <param name="API_KEY_FOR_ANDROID" value="AIzaSyBSkBzEjEwIC-0uuJmNVvBgC4Lomn1qX2k" />
           <param name="API_KEY_FOR_IOS" value="your key" />
           <param name="LOCATION_WHEN_IN_USE_DESCRIPTION" value="Karenderia wants to use your location" />
           <param name="LOCATION_ALWAYS_USAGE_DESCRIPTION" value="Karenderia want to always use your location" />
        </gap:plugin>

        <gap:plugin name="cordova-plugin-buildinfo" source="npm" spec="2.0.2"  />

        <gap:plugin name="cordova-plugin-googleplus" source="npm">
         <variable name="REVERSED_CLIENT_ID" value="" />
        </gap:plugin>

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

        <preference name="AutoHideSplashScreen" value="false" />    
        <preference name="SplashScreenDelay" value="10000" />    
        <preference name="fullscreen" value="false" />
        <preference name="android-minSdkVersion" value="16" />     
        <preference name="ShowSplashScreenSpinner" value="false" />    

        <access origin="*" />
        <access origin="tel:*" launch-external="yes" />

        <gap:config-file platform="android" parent="/manifest">
            <supports-screens android:xlargeScreens="true" android:largeScreens="true" android:smallScreens="true" />
            <application android:theme="@android:style/Theme.NoTitleBar" >            
            </application>        
        </gap:config-file> 

        <preference name="phonegap-version" value="cli-7.1.0" />     
        <gap:plugin name="cordova-plugin-camera" source="npm" spec="2.4.1" />

        <platform name="ios">    
            <config-file platform="ios" target="*-Info.plist" parent="NSLocationAlwaysUsageDescription">
                <string>Karenderia want to always use your location</string>
            </config-file>
            <config-file platform="ios" target="*-Info.plist" parent="NSLocationWhenInUseUsageDescription">
                <string>Karenderia wants to use your location</string>
            </config-file>
        </platform>   

        <edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
        <string>need camera access to take pictures</string>
        </edit-config>

        <edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
            <string>need to photo library access to get pictures from there</string>
        </edit-config>

        <edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
            <string>need location access to find things nearby</string>
        </edit-config>

        <edit-config target="NSPhotoLibraryAddUsageDescription" file="*-Info.plist" mode="merge">
            <string>need to photo library access to save pictures there</string>
        </edit-config>

        <platform name="android">

            <resource-file src="www/beep.wav" target="res/raw/beep.wav" /> 

            <icon density="ldpi" src="res/icons/android/drawable-ldpi-icon.png" />
            <icon density="mdpi" src="res/icons/android/drawable-mdpi-icon.png" />
            <icon density="hdpi" src="res/icons/android/drawable-hdpi-icon.png" />
            <icon density="xhdpi" src="res/icons/android/drawable-xhdpi-icon.png" />
            <icon density="xxhdpi" src="res/icons/android/drawable-xxhdpi-icon.png" />
            <icon density="xxxhdpi" src="res/icons/android/drawable-xxxhdpi-icon.png" />

            <splash density="land-ldpi" src="res/screens/android/drawable-land-ldpi-screen.png" />
            <splash density="land-mdpi" src="res/screens/android/drawable-land-mdpi-screen.png" />
            <splash density="land-hdpi" src="res/screens/android/drawable-land-hdpi-screen.png" />
            <splash density="land-xhdpi" src="res/screens/android/drawable-land-xhdpi-screen.png" />
            <splash density="land-xxhdpi" src="res/screens/android/drawable-land-xxhdpi-screen.png" />
            <splash density="land-xxxhdpi" src="res/screens/android/drawable-land-xxxhdpi-screen.png" />
            <splash density="port-ldpi" src="res/screens/android/drawable-port-ldpi-screen.png" />
            <splash density="port-mdpi" src="res/screens/android/drawable-port-mdpi-screen.png" />
            <splash density="port-hdpi" src="res/screens/android/drawable-port-hdpi-screen.png" />
            <splash density="port-xhdpi" src="res/screens/android/drawable-port-xhdpi-screen.png" />
            <splash density="port-xxhdpi" src="res/screens/android/drawable-port-xxhdpi-screen.png" />
            <splash density="port-xxxhdpi" src="res/screens/android/drawable-port-xxxhdpi-screen.png" />
        </platform>

        <platform name="ios">

            <icon height="57" platform="ios" src="res/icons/ios/icon.png" width="57" />
            <icon height="114" platform="ios" src="res/icons/ios/icon@2x.png" width="114" />
            <icon height="40" platform="ios" src="res/icons/ios/icon-40.png" width="40" />
            <icon height="80" platform="ios" src="res/icons/ios/icon-40@2x.png" width="80" />
            <icon height="50" platform="ios" src="res/icons/ios/icon-50.png" width="50" />
            <icon height="100" platform="ios" src="res/icons/ios/icon-50@2x.png" width="100" />
            <icon height="60" platform="ios" src="res/icons/ios/icon-60.png" width="60" />
            <icon height="120" platform="ios" src="res/icons/ios/icon-60@2x.png" width="120" />
            <icon height="180" platform="ios" src="res/icons/ios/icon-60@3x.png" width="180" />
            <icon height="72" platform="ios" src="res/icons/ios/icon-72.png" width="72" />
            <icon height="144" platform="ios" src="res/icons/ios/icon-72@2x.png" width="144" />
            <icon height="76" platform="ios" src="res/icons/ios/icon-76.png" width="76" />
            <icon height="152" platform="ios" src="res/icons/ios/icon-76@2x.png" width="152" />
            <icon height="29" platform="ios" src="res/icons/ios/icon-small.png" width="29" />
            <icon height="58" platform="ios" src="res/icons/ios/icon-small@2x.png" width="58" />
            <icon height="87" platform="ios" src="res/icons/ios/icon-small@3x.png" width="87" />

            <splash height="1136" platform="ios" src="res/screens/ios/Default-568h@2x~iphone.png" width="640" />
            <splash height="1334" platform="ios" src="res/screens/ios/Default-667h.png" width="750" />
            <splash height="2208" platform="ios" src="res/screens/ios/Default-736h.png" width="1242" />
            <splash height="1242" platform="ios" src="res/screens/ios/Default-Landscape-736h.png" width="2208" />
            <splash height="1536" platform="ios" src="res/screens/ios/Default-Landscape@2x~ipad.png" width="2048" />
            <splash height="768" platform="ios" src="res/screens/ios/Default-Landscape~ipad.png" width="1024" />
            <splash height="2048" platform="ios" src="res/screens/ios/Default-Portrait@2x~ipad.png" width="1536" />
            <splash height="1024" platform="ios" src="res/screens/ios/Default-Portrait~ipad.png" width="768" />
            <splash height="960" platform="ios" src="res/screens/ios/Default@2x~iphone.png" width="640" />
            <splash height="480" platform="ios" src="res/screens/ios/Default~iphone.png" width="320" />
        </platform>    

    </widget>

Compile logs here.

1 个答案:

答案 0 :(得分:0)

如果您在日志中一直向下滚动,则会看到多个错误消息:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:tbxml-android:] /build/intermediates/exploded-aar/tbxml-android/AndroidManifest.xml
    Suggestion: use tools:overrideLibrary="za.co.twyst" to force usage

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 7.29 secs
Error: /gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/AndroidManifest.xml:38:5-74 Error:
    uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:tbxml-android:] /build/intermediates/exploded-aar/tbxml-android/AndroidManifest.xml
    Suggestion: use tools:overrideLibrary="za.co.twyst" to force usage

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:tbxml-android:] /build/intermediates/exploded-aar/tbxml-android/AndroidManifest.xml
    Suggestion: use tools:overrideLibrary="za.co.twyst" to force usage

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    at ChildProcess.whenDone (/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

它们都指向同一个问题,有些东西(最有可能是一个插件)需要最低SDK版本16,而项目的最低要求是19。最低SDK版本19由{{1}设置} 插入。您必须找出其中哪些插件需要最低SDK版本16,并查看是否有可用的更新。

相关问题