自从一周以后,我的phonegap构建失败,无法弄清楚构建失败的原因。 做了一些研究并尝试了一些选项,比如添加一个mipmap文件夹,但构建失败了。
/project/build/intermediates/manifests/full/release/AndroidManifest.xml:59:错误:错误:找不到与给定名称匹配的资源(在'图标'与值' @ mip映射/图标'。)
我的config.xml文件如下:
<content src="index.html" />
<preference name="loadUrlTimeoutValue" value="70000" />
<platform name="ios" >
<preference name="orientation" value="all" />
<preference name="ShowSplashScreenSpinner" value="true" />
</platform>
<platform name="android" >
<preference name="orientation" value="portrait" />
<!-- <resource-file src="google-services.json" target="google-services.json" /> -->
</platform>
<preference name="android-build-tool" value="gradle" />
<preference name="permissions" value="none"/>
<preference name="fullscreen" value="true" />
<preference name="SplashScreen" value="splash" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="SplashScreenDelay" value="1000" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreen" value="false"/>
<plugin spec="https://github.com/rodrigo-martinezd/cordova-dialog-gps.git#f110314" />
<plugin spec="https://github.com/cuisineje/cordova-plugin-dreams-inappbrowser.git#fafbc28" />
<plugin spec="https://github.com/razorpay/razorpay-cordova.git#011f82b" />
<plugin name="com.paypal.cordova.mobilesdk" spec="3.5.0" />
<plugin name="cordova-plugin-android-permissions" spec="1.0.0" />
<plugin name="cordova-plugin-device" spec="1.1.7" />
<plugin name="cordova-plugin-geolocation" spec="2.4.3" /> <!-- Had issue with 3.0.0 as it required cordova 6.3.0 -->
<plugin name="cordova-plugin-googlemaps" spec="2.1.1" />
<plugin name="cordova-plugin-media" spec="3.0.0" />
<plugin name="cordova-plugin-network-information" spec="1.3.4" />
<plugin name="cordova-plugin-request-location-accuracy" spec="2.2.0" />
<plugin name="cordova-plugin-splashscreen" spec="4.1.0" source="npm" />
<plugin name="cordova-plugin-whitelist" spec="1.3.3" />
<plugin name="cordova-plugin-x-toast" spec="2.6.0" />
<plugin name="cordova.plugins.diagnostic" spec="3.4.2" />
<plugin name="phonegap-plugin-push" spec="1.5.3" />
<plugin name="uk.co.workingedge.phonegap.plugin.launchnavigator" spec="4.1.0" />
<plugin name="cordova-plugin-uniquedeviceid" source="npm" />
<!--
<plugin name="cordova-plugin-whitelist" source="npm" />
<gap:plugin name="phonegap-plugin-push" source="npm" spec="1.5.3" />
<gap:plugin name="com.paypal.cordova.mobilesdk" source="npm" />
<gap:plugin name="cordova-plugin-device" source="npm"/>
<gap:plugin name="cordova-plugin-splashscreen" source="npm"/>
<gap:plugin name="cordova-plugin-geolocation" source="npm" spec="2.4.3"/>
<gap:plugin name="cordova-plugin-android-permissions" source="npm"/>
<gap:plugin name="cordova-plugin-network-information" source="npm" />
<gap:plugin name="cordova-plugin-request-location-accuracy" source="npm" spec="2.2.0" />
<gap:plugin name="cordova-plugin-x-toast" source="npm" spec="2.6.0" />
<plugin name="uk.co.workingedge.phonegap.plugin.launchnavigator" source="npm" />
<gap:plugin spec="https://github.com/rodrigo-martinezd/cordova-dialog-gps.git" source="git" />
<gap:plugin spec="https://github.com/cuisineje/cordova-plugin-dreams-inappbrowser.git" source="git" />
<gap:plugin spec="https://github.com/razorpay/razorpay-cordova.git" source="git" />
<gap:plugin name="cordova-plugin-media" source="npm" spec="3.0.0" />
<gap:plugin name="cordova.plugins.diagnostic" source="npm" spec="3.4.2" />
-->
<gap:plugin name="cordova-plugin-googlemaps" source="npm" spec="2.1" >
<param name="API_KEY_FOR_ANDROID" value="AIzaSyC25RhPHKmvQTz7OzprugQyzWssMlvWKHA" />
<param name="API_KEY_FOR_IOS" value="AIzaSyC25RhPHKmvQTz7OzprugQyzWssMlvWKHA" />
</gap:plugin>
<feature name="Geolocation">
<param name="android-package" value="org.apache.cordova.GeoBroker" />
</feature>
<feature name="SplashScreen">
<param name="ios-package" value="CDVSplashScreen" />
</feature>
<preference name="AutoHideSplashScreen" value="false" />
<preference name="SplashScreenDelay" value="3000" />
<preference name="fullscreen" value="false" />
<preference name="android-minSdkVersion" value="16" />
<preference name="deployment-target" value="7.0" />
<!-- ios preferences -->
<preference name="exit-on-suspend" value="false" />
<preference name="prerendered-icon" value="true" />
<preference name="target-device" value="universal" />
<preference name="detect-data-types" value="true" />
<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>
<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" />
</platform>
<icon platform="android" qualifier="ldpi" src="res/icon/android/icon-36-ldpi.png" />
<icon platform="android" qualifier="mdpi" src="res/icon/android/icon-48-mdpi.png" />
<icon platform="android" qualifier="hdpi" src="res/icon/android/icon-72-hdpi.png" />
<icon platform="android" qualifier="xhdpi" src="res/icon/android/icon-96-xhdpi.png" />
<icon platform="android" qualifier="xxhdpi" src="res/icon/android/icon-152-xxhdpi.png" />
<icon platform="android" qualifier="xxxhdpi" src="res/icon/android/icon-192-xxxhdpi.png" />
<splash platform="ios" src="splash.png" />
<splash src="splash.png" />
答案 0 :(得分:0)
通过添加以下标记并更改文件名来修复它。 并指定cli版本看起来像这样
<preference name="phonegap-version" value="cli-6.4.0" />
图标标签
<platform name="android">
<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" />
</platform>