For illustration purposes two Xcode project created and dependency managed by Cocoapods. First one is the iOS Apps project and another one is the dependency Framework. Both project build and run properly in absent of GoogleMaps. In presence of GoogleMaps as an indirect dependency for the first project causes error, Here is the dependency tree:
AcademiaMainAPP/
├─ TARGETS/AcademiaMainAPP [Error: Multiple commands produce for Assets.car]
└─ PODS/
└─ AcademiaMainGUI/
├─ TARGETS/AcademiaMainDMO [No error, build & run successfully]
└─ PODS/
├─ GoogleMaps
└─ AcademiaCoreLIB
Build Cases for GoogleMaps as an Indirect Dependency:
iOS Apps project build error for the default target
Error:
Multiple commands produce '/Users/Academia/Library/Developer/Xcode/DerivedData/AcademiaMainAPP-dchavmxvfznhbifvdocjhrxhitug/Build/Products/Debug-iphonesimulator/Academia.app/Assets.car':
1) Target 'AcademiaMainAPP' (project 'AcademiaMainAPP') has compile command with input '/opt/dev/ios_workspace/academia-main-iosapp/AcademiaMainAPP/Preview Content/Preview Assets.xcassets'
2) That command depends on command in Target 'AcademiaMainAPP' (project 'AcademiaMainAPP'): script phase "[CP] Copy Pods Resources"
Warning:
duplicate output file '/Users/Academia/Library/Developer/Xcode/DerivedData/AcademiaMainAPP-dchavmxvfznhbifvdocjhrxhitug/Build/Products/Debug-iphonesimulator/Academia.app/Assets.car'
on task: PhaseScriptExecution [CP] Copy Pods Resources /Users/Academia/Library/Developer/Xcode/DerivedData/AcademiaMainAPP-dchavmxvfznhbifvdocjhrxhitug/Build/Intermediates.noindex/AcademiaMainAPP.build/Debug-iphonesimulator/AcademiaMainAPP.build/Script-3D735383E09B1F357AA7768E.sh
Query?
Right now we are using Xcode 11.4.1. Actually no such Assets.car used by us. s.static_framework = true
added in Podspec for GoogleMaps. For details please find our Podfile and Podspec as blew. Indeed we need to know that if there is any mistake or lacking of configuration in the Podfile or Podspec. Our only query to the expertise those who already resolved such issues please guide us to solve this.
1. AcademiaMainAPP/Podfile:
platform :ios, '13.0'
target 'AcademiaMainAPP' do
use_frameworks!
# Pods for AcademiaMainAPP
pod 'AcademiaMainGUI', :git => 'git.chorke.org:academia/academia-main-iosgui.git'
pod 'AcademiaCoreLIB', :git => 'git.chorke.org:academia/academia-core-ioslib.git'
target 'AcademiaMainAPPTests' do
# Pods for testing
end
end
2.a AcademiaMainGUI/Podfile:
platform :ios, '13.0'
target 'AcademiaMainGUI' do
use_frameworks!
# Pods for AcademiaMainGUI
pod 'AcademiaCoreLIB', :git => 'git.chorke.org:academia/academia-core-ioslib.git'
pod 'GoogleMaps', '~> 3.8.0'
target 'AcademiaMainGUITests' do
# Pods for testing
end
target 'AcademiaMainDMO' do
target 'AcademiaMainDMOTests' do
# Pods for testing
end
target 'AcademiaMainDMOUITests' do
# Pods for testing
end
end
end
2.b AcademiaMainGUI.podspec:
Pod::Spec.new do |s|
s.name = 'AcademiaMainGUI'
s.module_name = 'AcademiaMainGUI'
s.version = '1.0.0'
s.source = { :git => 'git.chorke.org:academia/academia-main-iosgui.git', :tag => "v#{s.version}" }
s.homepage = 'https://cdn.chorke.org/docs/academia/swift/main/academia-main-iosgui'
s.documentation_url = 'https://cdn.chorke.org/docs/academia/swift/main/academia-main-iosgui'
s.source_files = 'AcademiaMainGUI', 'AcademiaMainGUI/**/*.{h,m,swift}'
s.authors = {'Chorke Academia' => 'academia@chorke.org'}
s.resources = ['AcademiaMainGUI/Resource/*.xcassets']
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.social_media_url = "https://twitter.com/chorkeinc"
s.swift_versions = ['5.0', '5.1']
s.requires_arc = true
s.static_framework = true
s.ios.deployment_target = '13.0'
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '3.0'
s.summary = 'Swift Classess, Structures and Utilities for SwiftUI & UIKit'
s.description = <<-DESC
AcademiaMainGUI is the dependnecy for the AcademiaMainAPP by the Academian for the Academian.
SwiftUI and UIKit related reusable protocols, extensions, classess, strutures, utilites,
functions and constants developed for encapsulation, security and agile software
development for Swift. Minimizing the learning curve and the development costing of
an Academian. Academia developed such library targeting Multi-Lingual Academian.
DESC
s.dependency 'AcademiaCoreLIB'
s.dependency 'GoogleMaps'
end