子Pod 用到xxx.xcassets
主工程也用到Images.xcassets
就一直報錯P朽汀M及亍压恒!
pod 版本 1.8.4
Xcode版本 11.x
Showing All Issues
Multiple commands produce '/Users/xxx/Library/Developer/Xcode/DerivedData/xxx-dtmfbratpdgyklbqvnmbtbnwhaje/Build/Products/Debug-iphoneos/xxx.app/Assets.car':
- Target 'xxx' (project 'xxx') has compile command with input '/Users/huchu/Desktop/xxx/xxx/xxx/Images.xcassets'
- That command depends on command in Target 'xxx' (project 'xxx'): script phase “[CP] Copy Pods Resources”
1茅主、
搜索podspec文檔纵刘,需要子pod不能用這種方式穴翩,需要包裝到bundle包里面
s.resources = "xxx/Resources/*.{xcassets,plist,json,png}"
即上面改為
spec.resource_bundles = {
'MapBox' => ['MapView/Map/Resources/*.png'],
'MapBoxOtherResources' => ['MapView/Map/OtherResources/*.png']
}
這不是鬧著玩嗎犬第, 這用的時候代碼不就很麻煩了,還得指定bundle芒帕,
2歉嗓、
還有一種方法,就是手動刪除!
3背蟆、
還有一種方法鉴分,說是修改workspace settings
這顯然不合適,既然有new build system 為啥要用legacy带膀!
4志珍、
還有一種做法就是 修改project.pbxproj, 將這個objectVersion版本號強(qiáng)制改為 小于50
{
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objects = {
# @return [String] Returns Minimum Xcode Object version for FileLists
#
MIN_FILE_LIST_OBJECT_VERSION = 50
class << self
# @param [Xcodeproj::Project::Object::AbstractObject] object
#
# @return [Boolean] Whether input & output paths for the given object
# should be stored in a file list file.
#
def input_output_paths_use_filelist?(object)
unless object.project.root_object.compatibility_version.nil?
version_match = object.project.root_object.compatibility_version.match(/Xcode ([0-9]*\.[0-9]*)/).to_a
end
if version_match&.at(1).nil?
object.project.object_version.to_i >= MIN_FILE_LIST_OBJECT_VERSION
else
Pod::Version.new(version_match[1]) >= Pod::Version.new(MIN_FILE_LIST_COMPATIBILITY_VERSION)
end
end
但這種方式后面替換腳本Pods-xxx-resources.sh 控制圖片是否需要每次編譯都打包不支持
最后
從https://github.com/CocoaPods/CocoaPods/issues/8122
找到啟發(fā):
在Podfile下面添加這么一行配置,
platform :ios, '9.0'
install! 'cocoapods', :disable_input_output_paths => true
終于算可以了垛叨, 只要肯下功伦糯,鐵棒磨成針,即使很無聊嗽元,它也是個問題的存在敛纲!
這個succesed 不容易啊