gpt4 book ai didi

ios - Cordova iOS 构建失败 - cordova-plugin-splashscreen 导致它?

转载 作者:行者123 更新时间:2023-12-01 20:03:24 26 4
gpt4 key购买 nike

我正在尝试让自定义初始屏幕适用于我的 iOS 版本,但它一直无法编译。

我将 cordova-plugin-splashscreen 添加到我的项目中,将我的文件复制到 res/screes/ios 并将其添加到我的配置中:

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

但是当我尝试从 CLI 编译它时,我得到了这个:
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

当我尝试在 Xcode 中执行此操作时,会出现以下错误:
/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".

看起来它正在尝试使用错误的图像,但我不明白为什么它在我的配置中显示不同时尝试使用 LaunchImage-Portrait~ipad.png。

此外,除非我删除配置中的 [splash] 标签,然后删除启动插件并再次添加,否则我无法编译项目。仅删除 [splash] 标签是行不通的。

最佳答案

这是我使用的启动配置:

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

在您的配置中,缺少最后一个。如果您更改配置,请记住调用 cordova build。

关于ios - Cordova iOS 构建失败 - cordova-plugin-splashscreen 导致它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39533383/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com