‘Cloud/CLAPIEngine.h’ file not found - ios

My application has been running fine with the Cloud-iOS.a library for the past few days. However, today, when I used the “Product > Clear Build Folder” command and tried to run the app again, it would give me this error:
‘Cloud/CLAPIEngine.h’ file not found
The Cloud library builds successfully, but the main project gives me that error along with 4 others in both the main project and the XCTest files (that are linked with this one).
I’ve tried removing and re-inserting the file from Build Phases > Headers and Build Phases > Compile Sources and that didn’t do anything (I also have tried to remove the -fno-objc-arc flag from the file to see if it would recognize it, and sure enough, it gave me an ARC error). I’ve tried looking through other SO questions like these:
Restkit/Restkit.h file not found Xcode 6.1
Adding frameworks to project in Xcode 5 and having *relative* paths added
... and nothing worked. I even tried restarting the app itself and nothing happened. I made a test project and included the same library to see if it’s my project, but this project also says the same errors. Both projects also have the file in the "include/" directory. I don’t know why this is happening and I’m starting to get really tired with Xcode’s random problems.
I’ve included the test project in a Dropbox link for others to check out and see why it’s doing this.
https://www.dropbox.com/sh/lu8hntaaww8y6r4/AAA1KJ085YvKjwMR-AZff6Nga?dl=0
What can I do to get this to run again? Thanks in advance.
(After this, I’m not running the “Clear Build Folder" command again.)

Ok. Looks like someone over at Apple Developer Forums was able to give me an answer. I chose the last one that they gave me, which was to change the static library into a framework. Thank goodness Apple made this available on iOS, because (after a bit of tweaking), everything works!

Related

Xcode - Archive product goes to Other Items instead of iOS Apps

I am using XCode 11.2.1 and out of nowhere the archives for deployment appear in the Other Items category, instead of iOS Apps (in Organizer). I am using my custom static framework and what I found that this may be the issue, but for a while, like a month or so after I created and used my framework, I had no problems with deploy (I am also using CocoaPods, but that was ok).
I have tried a lot of things like here:
Xcode 10 Archives to 'Other Items' instead of 'MacOS Apps'
and it worked for a few times, but now, with multiple cleanings, deleting derived data, etc, nothing works.
Here there is a reference to header files (but I have never changed anything about them when it worked): https://developer.apple.com/library/archive/technotes/tn2215/_index.html#//apple_ref/doc/uid/DTS40011221-CH1-PROJ
The problem is that the help link about Copy files is not working and also (I cannot find "Copy files" section in Build phases - maybe it was renamed), the Xcode version is different (I found other posts on StackOverflow) so I cannot manage to make them work (I am pretty new to Xcode and C++ / Obj C / Swift and it is difficult to manage those options if I cannot really understand the references (or with missing help/explanations, which I don't know where to look for)
I used this to create and use my framework: https://www.raywenderlich.com/5109-creating-a-framework-for-ios (and different other links but very similar to this one)
Can someone please provide some help regarding the steps needed to make your app deployable to AppStore while using my custom framework? I can provide other information and screenshots if needed. Thank you.
EDIT:
Is there a way to check what is different between the creation of the last archive that worked and the new one that I cannot deploy?
After archiving my app I also exported it and explored it in Finder (as instructed here: stackoverflow.com/a/15120289/1215791) So there is no libraries folder. It seems that the problem is not related to forgetting set Skip Install to YES for something.
Check the contents of the .xcarchive, this happens when there's more than one item in Products/Applications. It should contain only your application.
After finding the extra items there, you can then know for which target you should set "Skip Install" to Yes.
This just started happening with Xcode 13.3.
Turns out that I was adding the DocC to the Products/Applications directory. I turned off the flag for compiling documentation ("Build Documentation during 'Build'"), and it started working again.

After changing file locations, project can't recognize some of my classes

First off, I know this is a config issue because my code was building and running just fine before I synced my project to GitHub. Xcode's internal source control seems to be having trouble recognizing some of my files and I'm getting Use of unresolved identifier... errors where these files' initializers are in use, and were working before. I'm running the latest versions of Xcode and OS X, and these are the steps I was taking before and after the issue started...
BEFORE:
After several rounds of implementation and committing with the default local repository, I built and ran the app multiple times with no issues.
I created a new repository on GitHub, committed (w/push to remotes) and everything made it to GitHub just fine and was building and running in the simulator.
In order to organize the repository (to match the 'groups' I had created in Xcode) I did some brief research and then added nested directories to my project folder. I re-opened Xcode and repaired the file paths. Some took, but several kept showing ? (although I could still access the code just fine) and I got the corresponding Missing Files... warnings.
Because I couldn't get the new hierarchy to work (the files w/?s, not being recognized, were not able to be committed to GitHub), I tried to move the files back. This worked for most, but for a few (which seem to be the effected files) I had to rename them, recreate a new file and then paste their contents over (this is where I think the problem lies). I was able to commit everything to GitHub (even the problem files went up) but all the warnings remained.
To clear out the warnings I attempted to run my tests, and that's when the Use of unresolved identifier... errors popped up, and of course the build failed.
AFTER:
I verified all the paths and target memberships were correct.
When that didn't work, I built an entirely new project (although I did add it to the same workspace; not sure if that matters) and copy/pasted all my code over to new files. I didn't drag / reference the files and I didn't link the new project to GitHub. When I went to build, same errors in the same places...
I exited the workspace and opened the new project separately. Still no joy.
Any help or points in the right direction would be much appreciated.
EDIT:
After some help, I tried deleting the reference and dragging the file in manually but that didn't resolve the issue.
I also checked Build Phases -> Compile Sources and everything was listed fine with no compiler flags. I removed and re-added from Compile Sources, issue persists.
You can try removing referencer for the missing class file in Xcode,then add same file to folder (right click add file ) from physical workspace location this might help.
After rebuilding an entirely new app a third time, with all new files, I copied the files over and this time everything seems to be working fine. Had to repair a bunch of provisioning issues to make sure it worked (maybe that was part of the problem, but I doubt it), but everything is back to normal with the app. The only thing I did differently this time was not adding the new project to the same workspace.

Cocoapod issue not able to run on simulator

I have created my cocoapod and cross check in sample project but it is showing everytime this error.
I googled and found solution
Reset content and setting
Clear derived data
Clean and build
Restart xcode
But non of them works
i tried on device
Make sure you are opening the newly created .workspace file rather than your original project.
Refer to this answer for debugging.
https://stackoverflow.com/a/26129829
Basically you need to look at ~/Library/logs/CoreSimulator/CoreSimulator.log for the source of the errors.
You need to consider the fact that the simulator is not linking files properly than any specific cocoapod issue.
Alternately, the problem could be related to code signing.
Refer : https://stackoverflow.com/a/17402788/2569560
If details like the Podspec and the simulator log were shared, perhaps we could be of more help.

Error that RestKit.h was not found

I’m not certain that this is a RestKit issue, and I’ve tried reinstalling RestKit via CocoaPods many times, but eventually I get this error:
<RestKit/RestKit.h> file not found
Everything compiles fine, and RestKit works. I've set the header search paths to $(inherited), just as with other linker flags.
This is unfortunate, because now the autocomplete for those classes isn’t working.
I’ve tried cleaning, deleting derived data, and restarting Xcode, all to no avail.
I came across this question when having the same problem, but I had a very different solution that worked right away.
For whatever reason, sometimes a project seems to lose track of some settings that relate to CocoaPods. In my case it was triggered when I downloaded a project from a repository that had been set up by someone else - even running "pods install" again did not remove the compilation error.
I finally ran across the solution somewhere, the project needs to make use of Pods config files for your target. Go into your project settings "Info" tab, open the "Configurations" section. Expand both Debug and Release, check to make sure that for your project have the "pods" configuration set. If not, click on the drop down and select "pods" for Debug and Release - now compile and the error should go away.
Here's an image showing exactly what part of the XCode configuration I'm talking about.
I believe the issue is more related to Xcode than the cocoapods themselves. I've seen this issue on other pods I've imported as well where they don't autocomplete the headers. As Keith said in the comments, you should be able to import the header you need and the rest of the code should autocomplete from there.

All RestKit projects fail to build when archiving

THIS QUESTION REFERS TO RESTKIT 0.9.x.
IF YOU ARE NEW TO RESTKIT CONSIDER USING THE NEWER 0.10.x branch.
I recently inherited a project that uses restkit (restkit.org). I have started using a branch (402-new-build-process) that is more compatible with xcode4.2.
My project an all the example projects build and run, but when it comes to Archiving an app the build fails:
/Users/AUser/Documents/SubFolder/stable-branches/project-iOS-client/RestKit/Examples/RKTwitterCoreData/Classes/RKTwitterAppDelegate.m:9:9: fatal error: 'RestKit/RestKit.h' file not found [2]
#import <RestKit/RestKit.h>
^
1 error generated.
I have followed the Installation Troubleshooting guide on the project wiki, but this did not work.
As per Blake's answer I am building to the DerivedData directory:
In addition I have tried setting header search to these (in many combinations [just guesses]):
"$(BUILD_DIR)/RestKit/Build"
"$(SOURCE_ROOT)/RestKit/Build"
"$(SOURCE_ROOT)/../../Build"
"$(BUILD_DIR)/../../Build"
I think all these fixes were stabs in the dark, or at least felt like that to me. I half expected to read one about getting some hair from a young virgin and burning it over the Mac.
If it compiles for you in dev but not for archive its bound to be something simple. Or at least it was for me.
My source files were not in the right place:
The search header was set to "$(SOURCE_ROOT)/RestKit/Build"
But I had simply dragged the proj file from where I downloaded it into XCode. This was never an issue when compiling for debug etc. Just when archiving so I didnt spot it for a while.
Just make sure what ever that path is to the RestKit/Build is where the actual files are.
Fixed it for me, unlike all the cross your finger fixes I've read. Like moving headers into a group etc... what a load of rubbish that was.
Good luck, hope this helps. Thanks to the Restkit team, this really is a great framework.
Jamie
I am building against the development branch and integrate RestKit as a submodule in my root git folder
+ root project folder
|--+ RestKit
|--+ <Projectname>
|--+ <Projectname>.xcodeproj
So I use the following search paths
"$(BUILT_PRODUCTS_DIR)/../../Headers"
"$(SOURCE_ROOT)/../RestKit/Build"
!!!Update to the latest version of the branch!!!
I've just built RKCatalog and RKTwitterCoreData as an archive on Xcode 4.2 without issue. I am failing due to a Code Signing issue. Have you confirmed that you are building with the DerivedData directory:
RestKit assumes that you are using a modern Xcode project building to the DerivedData directory. Confirm your settings
via the "File" menu > "Project Settings...". On the "Build" tab within the sheet that opens, click the "Advanced..."
button and confirm that your "Build Location" is the "Derived Data Location".
I can push changes that rsync the headers to a known location, but I was hoping that standardizing on DerivedData would simplify the process.
To reiterate Jamie Reynolds answer, most (if not all) of you have set your header search paths to "$(SOURCE_ROOT)/RestKit/Build", this is fine while debugging and also fine for archiving, unless of course your Restkit framework IS actually in this directory.
Like the majority of you out there, you have probably just linked to the framework from the default download directory, in which case go to finder, open Restkit->Build cmd+i to see the info and select the directory path, copy and replace "$(SOURCE_ROOT)/RestKit/Build", dont forget the brackets.
mine was "/Users/edwin-b/Downloads/RestKit-RestKit-8d0d9fc/Build" worked like a charm
I followed the steps outlined in several SO answers, and the issue ended up being a problem with the Header Search Paths. Sometime between adding RestKit in XCode 4.2 and trying to archive in XCode 4.3.1 (I had updated twice between starting the project and providing a build), a comma had been injected in the Header Search Path list which Xcode could no longer parse. As a result, the entry for RestKit's header location was:
"$(SOURCE_ROOT)/RestKit/Build",
When it should have just been:
"$(SOURCE_ROOT)/RestKit/Build"
While this didn't produce any issues building to device or sim, once I tried to archive, it caused the error reported by the OP.
Just add "$(SOURCE_ROOT)/RestKit/Build" to you target "Header Search Paths", Thanks to this answer.
I'm sure some of these are redundant, but I just spent over 3 hours debugging this thing and almost ruined my project in the process. So... Here you have it.
For the sake of your sanity, create a zip backup of your project before messing with RestKit project paths, commit all files (especially the project) to source control, cross your fingers, burn a virgin hair over your mac, then proceed.
After eliminating them one by one, I narrowed it down to this line allowing me to archive.
"$(SOURCE_ROOT)/../RestKit/Build"
Restkit is a folder at the same level as the main project folder
I'm adding this answer so I can find it later - it matches some responses above. Look in your targets "Header Search Paths" - and depending on where your restkit directory is in your project, add one of the lines specified above in Alex Stones answer. In my case, it was "$(SOURCE_ROOT)/../RestKit/Build"

Resources