简体   繁体   中英

Cordova iOS build fails - cordova-plugin-splashscreen causes it?

I'm trying to get custom splash screens to work for my iOS build and it keeps failing to compile.

I added the cordova-plugin-splashscreen to my project, copied my files to res/screes/ios and added this to my config:

  <platform name="ios">
    <allow-intent href="itms:*"/>
    <allow-intent href="itms-apps:*"/>
    <preference name="KeyboardDisplayRequiresUserAction" value="false"/>
    <splash height="480" src="res/screen/ios/iphone-320-p.jpg" width="320"/>
    <splash height="960" src="res/screen/ios/iphone-640-p.jpg" width="640"/>
    <splash height="1136" src="res/screen/ios/iphone-640-4in-p.jpg" width="640"/>
    <splash height="1334" src="res/screen/ios/iphone-750-p.jpg" width="750"/>
    <splash height="2208" src="res/screen/ios/iphone-1242-p.jpg" width="1242"/>
    <splash height="1024" src="res/screen/ios/ipad-768-p.jpg" width="768"/>
    <splash height="2048" src="res/screen/ios/ipad-1536-p.jpg" width="1536"/>
    <splash height="768" src="res/screen/ios/ipad-1024-l.jpg" width="1024"/>
    <splash height="1536" src="res/screen/ios/ipad-2048-l.jpg" width="2048"/>
  </platform>

But when I try to compile it from CLI I get this:

The following build commands failed:
    CompileAssetCatalog build/device/BoekWijzer.app BoekWijzer/Images.xcassets
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/roderickg/Documents/Working/svn/bsl_bwapp/src/boekwijzer-cordova/platforms/ios/cordova/build-debug.xcconfig,-project,BoekWijzer.xcodeproj,-target,BoekWijzer,-configuration,Debug,-destination,platform=iOS,build,CONFIGURATION_BUILD_DIR=/Users/roderickg/Documents/Working/svn/bsl_bwapp/src/boekwijzer-cordova/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/roderickg/Documents/Working/svn/bsl_bwapp/src/boekwijzer-cordova/platforms/ios/build/sharedpch

When I try to do it in Xcode I get errors like these:

/Users/roderickg/Documents/Working/svn/bsl_bwapp/src/boekwijzer-cordova/platforms/ios/BoekWijzer/Images.xcassets: Failed to write image data for the launch image set from "LaunchImage.launchimage/Default-Portrait~ipad.png" to "/Users/roderickg/Library/Developer/Xcode/DerivedData/BoekWijzer-hgmapcbguwcdwlbzhegkgwjgwxgj/Build/Products/Debug-iphoneos/BoekWijzer.app/LaunchImage-Portrait~ipad.png".

Looks like it's trying to use the wrong images but I don't understand why it's trying to use LaunchImage-Portrait~ipad.png when it says differently in my config.

Also, I can't get the project to compile unless I remove the [splash] tags in the config, then remove the splash plugin and add it again. Just removing the [splash] tags doesn't work.

This is the splash-config which I use:

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

In your config, the last one is missing. Remember to call cordova build if you change your config.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM