Xcode 10 build error - Multiple commands produce info.plist - xcode

I recently updated to Xcode 10 but now get this whenever I try to run my build:
Build system information
error: Multiple commands produce '/Users/shiningsunnyday/Library/Developer/Xcode/DerivedData/aiRun-aogoneumhlleekecmbglgiyifpwy/Build/Products/Debug-iphoneos/aiRun.app/Info.plist':
1) Target 'aiRun' (project 'aiRun') has copy command from '/Users/shiningsunnyday/Documents/GitHub/running_app/RUN BABY/aiRun/aiRun/Info.plist' to '/Users/shiningsunnyday/Library/Developer/Xcode/DerivedData/aiRun-aogoneumhlleekecmbglgiyifpwy/Build/Products/Debug-iphoneos/aiRun.app/Info.plist'
2) Target 'aiRun' (project 'aiRun') has process command with output '/Users/shiningsunnyday/Library/Developer/Xcode/DerivedData/aiRun-aogoneumhlleekecmbglgiyifpwy/Build/Products/Debug-iphoneos/aiRun.app/Info.plist'
I can remove my Info.plist's target membership and it works but I need the custom-set key values inside it. What do I do?

Workspace Project > Build Settings > find[Command+F] > info.plist >
Packaging > info.plist File - [your_target/info.plist]
The above method is the cleanest answer.
[XCode - File - Workspace Settings - New Build System(Default)]

Related

iOS project transfer from xcode11 to xcode14

I had project which is working all good in xcode11 but when i open and try to run the project xcode13 or xcode14 it gives be below error
Steps i did to solve it:
1) Clear the build
2) Delete Derived Data
3) Xcode13 -> File -> Workspace settings -> Change to New Build System instead of Legacy Build system (Legacy build system is depricated)
4) Build Phases -> Copy Bundle Resources -> check if there are duplicate files exist.
error build: Multiple commands produce '/Users/Username/Library/Developer/Xcode/DerivedData/Project-ekfgusdfwerwe wercemqfyjckxycw/Build/Products/Debug-iphonesimulator/projectTest.app/Model.cdm'
Please help me

Converting to swift 4 : Build input file cannot be found target:Tests/_5__2Tests.swift'

I have a project that I'm working on which runs perfectly in the simulator (in Xcode 10.1) but when I try to convert my project from swift 3 to swift 4.2 I get this error in my test targets.
Build input file cannot be found: '/Users/....... #2UITests/_5__2UITests.swift'
and Build input file cannot be found: '/Users/Roberto/Downloads.... #2UITests/Info.plist'
I have read several blogs about going into your test target removing the Plist and re adding the plist but if I remove it and re add it I get
:-1: Multiple commands produce '/Users/roberto/Library/Developer/Xcode/DerivedData/25_#2-edsolzqlcfejkgcvjolfrdmxdmon/Build/Intermediates.noindex/SwiftMigration/25 #2/Products/Debug-iphoneos/25 #2UITests-Runner.app/PlugIns/25 #2UITests.xctest/Info.plist':
1) Target '25 #2UITests' (project '25 #2') has copy command from '/Users/... #2UITests/Info.plist'
I would suggest just removing the test target entirely. If you actually have tests, it's no loss because deleting the target doesn't delete the files.

Copy build to a different directory after finishing building

When I build my project with Xcode 8, it saves the final build in ~/Library/Developer/Xcode/DerivedData/MyProject-[add-lots-of-random-chars-here]/Build/Products/Release-iphoneos. Is there any way to make Xcode copy the app bundle to a user-specified path after building it? e.g. how can I make Xcode copy the built app bundle to /MyBuilds after building it?
I know that I can change the path for storing derived data in my project's settings in Xcode but doing so will of course make Xcode store all data (including intermediate stuff like object code etc) in this location which I don't want. I really only want Xcode to copy the final, ready-for-distribution app bundle to a user-specified location without any intermediate files used in the build process.
How can I do that?
The solution using a script in "Build Phases" does not work properly since Xcode is not finished building the app when running the script. Here is a solution with a script that runs after all build tasks are finished:
Go to "Edit Scheme"
Click on the triangle next to "Build"
Select "Post-action"
Press the + button and select "New Run Script Option"
Select your app name in "Provide build settings from"
Add the following shell script:
Script:
PRODUCT="${BUILT_PRODUCTS_DIR}/${TARGET_NAME}.app"
cp -R "${PRODUCT}" ~/Desktop
Add a shell script to your build phases to copy the product:
Script:
PRODUCT="${BUILT_PRODUCTS_DIR}/${TARGET_NAME}.app"
cp -R "${PRODUCT}" ~/Desktop
Certainly replace ~/Desktop with a target directory of your choice.

Change Xcode Project's build path without breaking modules search path

I need to change the build path of my project to be folder in my project (without changing the global Xcode preferences), and I used this configuration I found in Stackoverflow:
//Intermediate build files go here
PROJECT_TEMP_DIR = $(SRCROOT)/build/$(PROJECT_NAME).build
// Build-related files for the active build configuration go here
CONFIGURATION_BUILD_DIR = $(SRCROOT)/build/$CONFIGURATION
// The final product executables and other build products go here
BUILT_PRODUCTS_DIR = $(SRCROOT)/build/$CONFIGURATION
But now the build is failing because he cannot find the frameworks...
Thanks.
You can try this way, work for me:
1. Go to File -> Project settings (or Workspace Setting)
2. Click the Advanced button
3. Click "Custom" and select "Relative to Workspace" in the pull down
4. Done
If your test target is failing to build, then you need to add the same build rules to your test target.

Getting a list of locales of a xcode project from a run script pahse

Is there a way of loading the list of locales added to a xcode project in a run script phase ? I need to create the proj folders automatedly.

Resources