Copy an existing Xcode project results in files with wrong references - ios

I have a working project that builds ok. (Xcode 6.0.1)
There were images added that were at one folder (/Downloads) and were substituted by new ones (/MyDir/MyProject).
At adding files process copy options, group and add to it's targets were selected.
After a copy and paste at Finder from the root project folder to the new project some images contain references at Targets / Build Phases / Copy Bundle Resources to old folder (Downloads) while they are ok at original project.
I've deleted the .git from initial project to make sure it's not a git problem.
Already tried
rm -rf ~/Library/Developer/Xcode/DerivedData/
Any ideas? Thank you

In the rightmost panel, which contains Identity and Type, check to see if the "Location" field is Absolute Path, Relative to Group, or Relative to Project, and set each file accordingly to what it should be. Xcode seems to create new files with creative ideas on how this should be set.

check in your project build phases if there are some missing references and delete the one you don't need

Related

Library not found for -lRNAppleAuthentication react-native iOS

I have tried deleting "$(inherited)" in library search paths and but it's not working
Have a try with the below solution.
You can go to File > Workspace Settings if you are in a workspace environment or File > Project Settings for a regular project environment.
Then click over the little grey arrow under the Derived data section and select your project folder and close the workspace and Xcode then delete the project directory from the derived data directory.
Open the workspace again in Xcode and clean and rebuild the project.
Also, make sure that you have applied pod install after the package installation.

Xcode 6 project folders

I am having issues since upgrading to xcode 6 with renaming or moving a project. In older versions I could rename the parent directory of a project safely.
For example:
from:mybasefolder/ios/App/App.xcodeproj
to:
newname/ios/App/App.xcodeproj
Now when I do this it seems to mess up the whole build cycle and keeps pushing to the device an older binary and all debugging stops working. I have been looking through the project settings but I cannot find anything related to paths for this. Does anyone know why this is happening and where I might be able to fix it?
It appears to be cached data in the "build/" directory. If you have your build location set to "Legacy" in Settings > Locations > Devived Data > Advanced.
Steps to reproduce.
Create project
Build project, files in build/
Move project
Build project, files will continue to build to original location, you can verify by looking in Finder, there will be a new folder at the old location with only build/ in it.
Steps to fix:
Delete the old build/ dir if xcode mistakenly created it.
Delete the build/ directory in your project dir.
Clean and rebuild.

Does Xcode include miscellaneous files in the project folder when building

I keep some miscellaneous files in the folder for my project, files not actually involved in the build. I was wondering, however, wether Xcode will include these in the build. I need to make sure these files aren't taking up space and slowing down builds. Do these files have any effect?
Xcode will only include files that have been added to the projects copy bundle resources build phase.
You can see these files by selecting your project , click on the target , the select the build phases tab, and click on the Copy Bundle Resources.

Xcode copying unnecessary files into target

In my Xcode project, I have it set to copy all the files I need in the "Copy bundle resources" step and it doesn't link to any extra libraries, yet when I compile the project it copies a number of files that aren't even in the project's file references (a number of .dll files that have nothing to do with this version of the app).
The files may have accidentally been added to the "copy bundle resources" step at one point but were since removed. How can I find out why are these files still being copied and how can I prevent it?
Turns out the files were left over from a build before those files were removed. Trashing the app from the products folder got rid of the extra files.

How can I get my project's folder structure to be mirrored in Finder?

I have an Xcode (4.2) project with a bunch of class files, and I have them neatly organized into folders. These folder aren't "real", however; in Finder, my classes are all just dumped into the one "Classes" folder. Is there any way to get the virtual folder structure I see in Xcode to be reflected in the real Finder folder structure? Or do I have to do this manually?
https://github.com/venmo/synx
A command-line tool that reorganizes your Xcode project folder to match your Xcode groups
Installation
$ gem install synx
Usage
Basic
:warning: WARNING: Make sure that your project is backed up through source control before doing anything :warning:
Execute the command on your project to have it reorganize the files on the file system:
$ synx path/to/my/project.xcodeproj
It may have confused CocoaPods. If you use them, execute this command:
$ pod install
You're good to go!
Advanced
Synx supports the following options:
--prune, -p remove source files and image resources that are not referenced by the the Xcode project
--no-color removes all color from the output
--no-default-exclusions doesn't use the default exclusions of /Libraries, /Frameworks, and /Products
--quiet, -q silence all output
--exclusion, -e EXCLUSION ignore an Xcode group while syncing
For example, OCMock could have been organized using this command:
$ synx -p -e "/OCMock/Core Mocks" -e /OCMockTests Source/OCMock.xcodeproj/
if they had wanted not to sync the /OCMock/Core Mocks and /OCMockTests groups, and also remove (-p) any image/source files found by synx that weren't referenced by any groups in Xcode.
I often want to do the same thing, but as far as I know there is no automatic way to do it, you have to do it manually unfortunately...
There is no 'automatic' way to make the XCode file pane structure automagically conform to the finder folder structure, although I agree there should be a setting for this.
I follow these steps when making a project:
Create the project.
Delete by reference any files I want to move.
Open finder and move the files, then drag them back into XCode.
When adding new files:
Create a folder in finder if needed.
Drag the folder into XCode.
Right-click and make a new file on the group that represents the folder just dragged in.
If you're using git, it's a little more work:
Commit your project before making a folder or file deletions/moves.
Delete them by reference from XCode.
Move them in finder.
Using terminal, type git mv sourcePath destPath to move files or git rm sourcePath to delete them.
Then drag back into XCode.
You can see more about my frustration with learning git here:
How can I move files & folders using git in Xcode 4?

Resources