I have a ruby code that uses xcodeproject that adds my Google-Info.plist to Runner.xcodeproj as a reference. However I want to remove the older reference because I get following error:
Xcode's output:
↳
error: Multiple commands produce '/Users/figengungor/Documents/projects/app_gmo/base/build/ios/Release-iphoneos/Runner.app/GoogleService-Info.plist':
1) Target 'Runner' (project 'Runner') has copy command from '/Users/figengungor/Documents/Base Firebase Files/GoogleService-Info.plist' to
'/Users/figengungor/Documents/projects/app_gmo/base/build/ios/Release-iphoneos/Runner.app/GoogleService-Info.plist'
2) Target 'Runner' (project 'Runner') has copy command from '/Users/figengungor/Documents/projects/app_gmo/base/ios/GoogleService-Info.plist' to
'/Users/figengungor/Documents/projects/app_gmo/base/build/ios/Release-iphoneos/Runner.app/GoogleService-Info.plist'
Here’s how I add the Google-Info.plist reference:
require 'xcodeproj'
project = Xcodeproj::Project.open(ARGV[0])
main_target = project.targets.first
gsi_reference = project.main_group['Runner'].new_file(ARGV[1])
main_target.add_file_references([gsi_reference])
project.save
Here’s the me trying to delete but not being successful code(I’m not familiar with Ruby, tried to follow documentation):
old_gsi_reference = project.main_group['Runner'].find_file_by_path('/Users/figengungor/Documents/Base Firebase Files/GoogleService-Info.plist')
old_gsi_reference.remove_from_project()
Does anyone have experience with xcodeproject and can help me out?