AppCode iOS application: Group folders not visible? - ios

P.S. I am new to both AppCode and iOS
I added 2 groups menu and summary and added somefiles to it. I accidentally reverted some file hides these folders from project structure
But as you can see, these are available on filesystem
How do I get them back on project structure? I can't even search for them in AppCode

In AppCode right click on the pennyapp-ios group, click Add->Files... Choose your two folders and select "create groups for added folders."

Related

Can't make files or folders inside main Xcode project folder

I am trying to create swift files and groups inside my main Xcode project group but for some reason it doesn't let me do it. When selecting new file it creates it outside of the group selected, and if I try and create a new group inside, the option is just greyed out.
I have never had this issue before with Xcode 11 and earlier, is this a feature that has been removed? Do I now have to make a separate group and work outside the initial project group?
Hopefully the image below will help explain what I mean.
NOTE: I am running Xcode 12.2 on BigSur 11.0.1
Here is what happens when I try to drag and drop the folder into the products group.
I also created an iOS App titled "Products". Upon changing the name to something else (Product Manager) I was able to add files to the project
in the second step of creating the file, do you still have selected the right folder?
Or is there maybe an other folder selected?

/Products/Debug-iphoneos/: No such file or directory Xcode 8 [duplicate]

Xcode keeps prompting telling me I don't have a certain image in the project and it errors when I try to build. If I deleted the .png Xcode is complaining about from the project, why does Xcode error out when I try to build?
[Edited by Rhubarb (got too big for the comments)]
I'm getting the same thing with these details. The copy command looks like this
CpResource MyIcons/../13-bicycle.png /Users/Me/Library/Developer/Xcode/DerivedData/MyProject-cxsohyxdecdbptgrrtaixbhhixrj/Build/Products/Debug-iphonesimulator/MyProject.app/13-bicycle.png
then there's a bunch of setenv and the command is translated to "builtin-copy" but none of that matters, the result is when I compile I get this error:
error: /Users/Me/Development/MyProject/MyIcons/../13-bicycle.png: No such file or directory
Now, I opened the Copy Bundle Resources tab as suggested by Robert Harvey, and my .png is there, with nothing appearing in read. And it is in the file system (Finder) and in the Project Navigator. So I deleted it from the resources using the - button and added it manually using the + button at the bottom left of the list in the Copy Bundle Resources tab. This put it at the root of the project in the Navigator, so I moved it into my group again - but no luck, same error. So I just deleted it altogether (from the Project Navigator, allowing it to be moved to Trash). That worked, but I ran into the same error with the very next icon (it only reports one or two at a time).
Looking at the error message, it appears to think that MyIcons is a folder. It's not, it's just a group. There is no such folder, I can see in the file system.
When I added via drag-drop, I left the "Copy items into ... group folder (if needed)" checked and the "Create groups for any added folders" button selected. But note that I only dragged icons (en masse) into an existing group; I did not drag over any folders, nor where any groups or folders created. But somehow, the compiler thinks that these resources are in a folder in the file system that doesn't exist.
I right clicked the icon in the Copy Resources List and tried both Show in Finder and Reveal in Project Navigator: and both worked - the file is there and it knows where to get it - until it builds.
I haven't even found a workaround beyond deleting the icons yet - cleaning doesn't work. I think my group is corrupted.
look up here XCode Build – CopyPNGFile Error and No Such File or Directory .
I had same problem and this solution helps me.
If you receive either of these annoying errors when building your
xcode app, something has corrupted in your project bundle.
Open your project in Xcode
Click on your project
Click on your project under Targets
Hit the build phases tab
Open “Copy Bundle Resources” near the bottom
Look for any resources listed in red!
I had the same problem but my solution was a bit different:
Open project in Xcode
Open project navigator
In the filter down below, search for your erroneous file name
I found the file under a group called "Recovered References" and it was marked in red
Delete the red files and everything should work perfectly
Okay here's the unsatisfactory workaround that fixed it for me.
(First, note that when I right-clicked my dodgy Group in the Project Navigator) it looked like any other group except that Open in External Editor was greyed - weird eh?)
I closed XCode and restarted it.
=> Now I see all of the icons under the offending group are red (in the Project Navigator)
Delete the entire group.
Create a new group (same name) and drag-drop the icons from the original source into the group
=> Error failed to copy (or some such - I can't remember but I have seen and fixed this before - and seen it elsewhere on SO)
This error is due to leftover icons, so to fix this one now,
I deleted all other groups with icons and moved their icons to trash
open finder at the project location
delete every icon in the project (sort by kind, delete all the .png)
make a new group again, and drag all the icons in _again.
whew, now hit Builder
=> XCode crashes.
Lovely.
Restart Xcode
fingers crossed: Build
=> it works. Brief celebration and back to work.
(See what I mean about unsatisfactory)
perhaps you move the file named **-Prefix.pch,you can change the dictionary of the file ,do like this : the error about “no such file or directory”
Check your project file paths. If there is a space in any of the folders, it causes this error. Simply remove spaces.
Using XCode 10, I got this error after deleting some files I no longer needed in my project.
In my case, I went to XCode, clicked on the project name, then under Resources, the missing files were listed in red. All I did was to delete them.
In case you need the files, you will need to add them by going to File ->Add files to , then select the files. After selecting the file, make sure you have Copy files if needed checked.
Hope that helps someone.
HappyCoding
try set target CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS=NO
XCode Build – CopyPNGFile Error and No Such File or Directory
If you receive either of these annoying errors when building your xcode app, something has corrupted in your project bundle.
Open your project in Xcode
Click on your project
Click on your project under Targets
Hit the build phases tab
Open “Copy Bundle Resources” near the bottom
Look for any resources listed in red!

Creating custom framework in iOS

I am trying to create my own iOS framework for my project. I am following the below link to create it:-
Creating custom framework in iOS
I am not getting any error as well as warning but not able to see the content of Product folder generated during project creation.
I am facing problem in this step:-
To build, select the target as iOS Device and press cmd+B to perform the build. Once completed, the libRWUIControls.a product in the Products group of the Project Navigator will turn from red to black, signaling that it now exists. Right click on libRWUIControls.a and select Show in Finder.
Looking for all yours help and support on this.
Suppose you are using Xcode 6, and Apple has provided an easier way to create a custom framework.
You can refer to some instruction on How to create an iOS Cocoa Touch Framework using Xcode
And you may still encounter some problems while using your custom framework in your app.
Here are 3 tips to solve the problems you may face.
Add your public headers:
In your custom framework project, please select TARGETS->Build Phases->Headers->Public, and drag and drop your headers here.
Build a static library framework:
In your custom framework project, please select TARGETS->Build Settings->Linking->Mach-O Type, and select it as Static Library.
To fix Xcode “Missing Submodule” warning while import your custom framework in your app:
Please refer the solution here.
Enjoy your own framework.
There are several parts to this "step"
Assuming since frameworks are fairly advanced that building is not your issue.
This tutorial uses multiple targets. To choose which target you want to build you must select it from the drop down menu at the top left of your Xcode window. This is immediately to the left (and loosely tied to) the drop down for choosing the device/emulator type. The target selected in the drop down becomes the active target and will respond to the build menu and shortcut keys.
Once a target is built the object created by the build will be displayed in the XCode Project Navigator inside the folder named "Products" In the default view the left most panel in XCode is the Navigator panel. Selecting the folder icon at the top of this panel will display the Project Navigator and the projects file structure. This is where you will find the Products folder containing your newly created file.
If the file is still red then the build did not complete correctly.
If it is black then you can right click on the file and choose "Show in Finder" to see the file.
If the file remains red or as an alternative to finding the file location you can use the build log.
To show the build log - in the Navigation Panel select the "Report Navigator". This is the right most icon at the top of the panel and looks like a cartoon text bubble. In the Report Navigator highlight the "Build" Entry associated with your static library. You can now review the build log to determine why the target didn't build correctly or if it did build correctly you will see an entry near the end of the log showing the path of build files.

Rename xcode project

In all of my stupidity I've notice I misspelled my own project. I'm honestly scared to rename it in Mac due to certain filepaths referencing folders that now do not exist. Is there an easy way to rename a project?
Try refactoring, It should work fine, if it doesn't refactoring creates a snapshot instantly.
In Xcode, go to the navigator panel and select the target:
Go to the inspector panel (on the far right) and select the File Inspector icon. You can change the project name here. (You will get a pop-up dialogue to confirm the changes.)
so try it out, if it blows up restore, and create a new project, and migrate to the new one slowly (as #troop231) mentioned.
good luck!
source
I've posted this as an answer elsewhere, but this works like it should...
This is a four step change. And is a real pain
Step 0 - Backup your existing project
Quit Xcode
Right click the master folder containing the project file and the assets, select archive
This will create you an archive of the OLD project
Open the OLD project in Xcode again
Step 1 - Rename the project.
Click on the project you want to rename in the “project navigator” on the left of the Xcode view.
On the right select the “file inspector” and the OLD name of your project should be in there under “Identity and Type”, change it to the new name.
A drop down appears, with a “rename” ok box
Click rename.
Step 2 - Rename the Scheme
In the top bar, just by the “Stop” button, is the scheme for your OLD product, click this then “manage schemes”
Click on the OLD name in the scheme, and it will become editable, change the name. (If you click it twice, you go into the editor (which you don’t want) click the manage schemes button to get back again)
Step 3 - Rename the folder with your assets
Quit out of Xcode
In the correctly named master folder, there is your newly named xcodeproj file with the the wrongly named OLD assets folder. Rename the OLD folder to your new name
Reopen the project and you get a warning “The folder OLD does not exist”, dismiss the warning
On the left in the “project navigator” click the top level OLD folder name.
On the right in the “file navigator” under “Identity and type” you will see the “Name” entry, change this from the OLD to the new name
Just under this is the “location” entry, just below that is a folder symbol with the OLD name. click this and chose the newly renamed folder
Step 4 - Rename the Build plist data
Click on the project in the “project inspector” on the left, in the centre panel select “Build Settings”
in this section search for plist
Under packaging, you will see Info.plist, and Product bundle identifier.
In Info.plist rename the OLD entry
In the Product Identifier and rename the OLD entry
FINALLY you are done and can rebuild (Apple-key+shift+k clean, Apple-Key+b then build)
I've found myself in these situations many times and this is what has helped me without any issues. https://github.com/shabbirh/Xcode-Project-Renamer
There are many options out there, a few works, others don't.
Follow this and you can enjoy a cold or hot drink instead of fighting with the Xcode rename process.
Install dependency
Run the command
gem install xcode-project-renamer
And then lookup for the ProjectToBeRenamed.xcodeproj file
cd yourParentProject/
xcode-project-renamer ProjectToBeRenamed NewProjectName
# Verbose information here.
# at the end you would see
Done.
I hope this helps others.
If you've just started it's easiest to just create a new project with the correct name, then delete the old one. We (I) do this all the time.
To change Project name go through this scenario.
Select target
Select Build Settings
Search product name here
Then Change the new App name here
please note that the XCODE project name will not change but when you run the App name will be change

How to share files between two xcode projects in workspace?

I learnt about Xcode workspace .I know how to share the static library but i want to share the files between two xcode projects in workspace and is it possible to run multiple targets at a time?Can you provide me the information of how to do this.
Thanks in advance
Sharing files between projects in the same workspace is easy, even if the projects are on the same level (no subprojects):
Assume you want to share constants between Project1 and Project2, and these constants are defined in a file SharedConstants.swift, which is defined in Project1.
In order to be used in Project2, it must be compiled there.
Thus, activate in the project navigator Project2, select the target and open the Build Phases tab.
Open there Compile Sources by tapping the little triangle left.
Tap the + button below the listed sources for this target. This will show you a list of files of Project2. There you cannot select your shared constants, because they do not belong to this project.
However left bottom is a button Add other…
Tapping it will open a standard file selection window where you can select SharedConstants.swift from Project1.
After tapping Open, a 2nd window opens with a Destination: Copy items if needed checkbox.
Important: Do not check this box!
If you would check it, a copy of SharedConstants.swift would be used in Project2, and any changes that you make in Project1 would not be visible in Project2. Instead, it you uncheck it, only a reference to SharedConstants.swift in Project1 would be used in Project2, and any changes will affect both projects.
To share the files you can probably use the bundles
Targets are manipulated with Schemes in Xcode 4, you can launch several targets in the same time if you select the different destinations (with OS X you can probably have the same destination :) )
You'll see a little triangle below the stop button indicating that you can long-press it to select which operation should be terminated:
You can switch the console with the popover at the Debug area where you see the target name and icon - that's a button.
You can drag Xcode projects into other Xcode projects to nest them.
More info here:
How should I manage dependencies across projects in an Xcode workspace?

Resources