我有一个包含iOS平台的cordova项目。
作为config.xml
的{{1}}的一部分,我需要将platform="ios"
复制到项目中。
我这样做如下:
GoogleService-Info.plist
我也尝试过以下变化
<resource-file src="GoogleService-Info.plist"/>
该文件正在被正确地复制到<resource-file src="GoogleService-Info.plist" target-dir="Resources"/>
,但大约50%的时间没有使用platforms/ios/RMCv2dev/Resources
构建,cordova build ios
抱怨它无法删除CopyPlistFile
从构建输出中,虽然奇怪的是它有时会构建。
GoogleService-Info.plist
在Xcode中,它也不能相当一致地构建。
我可以看到CopyPlistFile /Users/adf/Library/Developer/Xcode/DerivedData/RMCv2dev-azdfkixnsmcojlhkzhmfjdrtncns/Build/Intermediates.noindex/ArchiveIntermediates/RMCv2dev/InstallationBuildProductsLocation/Applications/RMCv2dev.app/GoogleService-Info.plist RMCv2dev/Resources/GoogleService-Info.plist
cd /Users/adf/Sites/RMC2/dev/BZ95599/Cordova/RMCv2dev/platforms/ios
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet:/usr/local/MacGPG2/bin:/Users/adf/android-sdks/tools:/Users/adf/android-sdks/platform-tools:/Users/adf/bin:/Users/adf/Projects/Chromium/depot_tools"
builtin-copyPlist --convert binary1 --outdir /Users/adf/Library/Developer/Xcode/DerivedData/RMCv2dev-azdfkixnsmcojlhkzhmfjdrtncns/Build/Intermediates.noindex/ArchiveIntermediates/RMCv2dev/InstallationBuildProductsLocation/Applications/RMCv2dev.app -- RMCv2dev/Resources/GoogleService-Info.plist
error: failed to remove /Users/adf/Library/Developer/Xcode/DerivedData/RMCv2dev-azdfkixnsmcojlhkzhmfjdrtncns/Build/Intermediates.noindex/ArchiveIntermediates/RMCv2dev/InstallationBuildProductsLocation/Applications/RMCv2dev.app/GoogleService-Info.plist: “GoogleService-Info.plist” couldn’t be removed.
列出了3次。如果我删除其中两个,那么项目将会构建。
在撰写此问题时,我设法解决了每次运行GoogleService-Info.plist
时,它都会添加对cordova build ios
的另一个引用,所以我认为这是我问题的根源。
但是可能导致这种行为的原因是什么?
我可以确认,每次运行构建时,GoogleService-Info.plist
<resource-file>
中的config.xml
都会添加到项目中。
答案 0 :(得分:0)
cordova-ios 4.4.0
cordova-ios 4.5.1
中的错误
更新config.xml
并设置<engine name="iso" spec="^4.5.1"/>
cordova platform remove ios
cordova platform add ios