regarding - Xcode error-> Clang: error: no input files - objective-c

I am totally new to the Xcode and getting the error below:
clang: error: no such file or directory:
'/usersd/chairman/desktop/MySecondTabApp/MySecondTabbApp/"MySecondTabbApp/MySecondTabbApp-Prefix.pch"'
Clang: error: no input files
Command/Users/chairman/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/user/bin/clang
failed with exit code 1

Did you move your folder/files after making the project? It's because Xcode can't find the prefix header for some reason. It can be easily fixed by relocating it.
Change the Prefix Header to where the .pch file is located in your folder.

Select your project and go to Build Phases and search go through whole list under "Compile Sources". If some files are red then delete those files by pressing - button at the bottom. Also make sure these files are in the list without red color.

Make new file: ⌘cmd+N iOS/Mac > Other > PCH File >
YourProject-Prefix.pch. Project > Build Settings > Search:
"Prefix Header". Under "Apple LLVM 6.0" you will get the Prefix
Header key. Type in: "YourProjectName/YourProject-Prefix.pch"
Clean project: ⌘cmd+⇧shift+K Build project: ⌘cmd+B

please go to Prefix header file
Target> Build Settings > Prefix Header.
then copy paste this line & change Your Project name
$(SRCROOT)/Your_Project_name-Prefix.pch
Its working you 100% gurantee.

Had the same problem. Try replacing MySecondTabbApp/MySecondTabbApp-Prefix.pch with MySecondTabbApp-Prefix.pch.

Had same problem. Had to go into Finder (outside of Xcode) and place my .pch file in a new folder to match the requested path.
Once the file's location matched the path it was fixed.

Comment Quoted from another site was the issue is resolved for me
hmm that's strange. Try this - click on the name of your project on the list of files/folders on the left in Xcode (at the very top of the list). Look at the "Targets" section on the left-hand side of the window to the right. Likely, there's two listed with the second being a "test" item. Right-click on that item and select "delete". Then try to run the project again. See screenshot below for a visual cue.
enter image description here

updating the pods helped me
pod update
It turned out to be a dependency issue. Updating the pod installed necessary components

clang: error: no such file or directory: '/usersd/chairman/desktop/MySecondTabApp/MySecondTabbApp/"MySecondTabbApp/MySecondTabbApp-Prefix.pch"'
It means your Pch file does not exists in above path. Check in you code where PCH file is available and and take that path and upload in PrefixHeader in Apple LLVM 8.0. Like
$(SRCROOT)/PATH/app_PrefixHeader.pch

Related

Copied Xcode Project won't build

OS X Version 10.10.5
Xcode version 7.2.1
Very simple steps, yet Xcode can't fathom what to do when you duplicate a folder that contains an Xcode project.
Start with Xcode CLOSED.
Start with an Xcode project that builds and runs perfectly.
Go to Finder window and right click on the directory that contains the buildable Xcode project and hit "Duplicate"
New directory is created, called "SomeProject copy"
Go into this new directory and double-click on the SomeProject.xcodeproj file to open it in Xcode.
Bam... enjoy your build errors.
In my case, it's complaining about an enum.
Tried deleting derived data folder (did so directly using finder)
Tried super-cleaning the build folder by holding down the option key.
Tried removing and re-adding complained about file that contains errors.
Tried changing path to file in Xcode File Inspector from "Relative To Group" to "Absolute Path"
I should also point out that either Finder -> Duplicate doesn't actually do what it says it does. Neither does Finder -> Copy, ~OR~ Xcode for some reason has now adopted not only the original source location as where to get its build files, but also the new location, hence the "Redefinition" error. I noticed that if I open the "copied" project and edit a file, then go back to my original project in an entirely different folder, the file is changed THERE.
And my paths (according to Xcode File Inspector), are RELATIVE TO THE PROJECT IN QUESTION. So in other words, ProjectAAA's files are pointed to the path under ProjectAAA's directory, and the same with copied project, ProjectBBB's files.
So somehow, the copy/duplicate is refusing to actually copy/duplicate.
Any ideas how to solve this?
Per John Elemans comment, moving my original project then revealed in the copied Xcode project a number of build paths and issues that needed resolving. I fixed those, and it worked as expected.
I solved this issue as follows:
After duplicating the root folder of the project, open the podfile of the duplicated project:
Podfile
then comment all the previously added pods by adding "#":
Commented Pods
hit CTRL + S in order to save the changes
Open the terminal and change the directory to the folder of the duplicated project and then perform: "pod install". Yes it will delete all the pods but don't worry we will install again in the next step
Pods deletion
Open again podfile and uncomment the previously commented pods:
Uncommented pods
hit CTRL + S to save the changes
Open the terminal and change the directory to the folder of the duplicated project and then perform "pod install". it will install again all the pods:
Pods installation
Finally, run the Project and it should run without any problem.

Xcode 6 beta build fails after moving -Bridging-Header objective-c swift xcode6

I am facing build fail error after moving Bridging-Header
objective-c swift on xcode6.
Before I moved header file, it had been working fine.
The error shows header file not exist. The header file path remains still old path in error log. I tried build clean, but still old path remains.
How can clean the objc-header-path?
You need to update the path in your project's Build Settings to point to the new bridging header location.
Click your target and then click 'Build Settings' then search for Objective-C Bridging Header
You'll find the path to the bridging header in your target's Build Settings, under "Swift Compiler - Code Generation"/"Objective C Bridging Header".
I tried with Xcode6.1-Beta, as well.
But still impossible to update the objective-c header path.
I don't know where the configuration file is. I gave up to figure out.
Finally, I deleted the target xcode project and recreated new project.
Now it is working.
Yes it's possible.
Delete the .h file
Clear the path at Objective-C Bridging Header
Create new Objective-C File
Name your header file to the same name as before (popup will ask you to create new header file)
Goto File > Project Settings > Data Location
Make sure your path is correct and press "Done"
Your app should run again pointing to the right location of the header file and delete the files ModuleCache
Happens to me many times when i move app folder around.
I had a workspace that I was using when I had the same thing happen. I moved my project to a different folder. Despite having a relative path on my bridge headers, it was still referencing the old location when building and threw an error.
Here's what I did to fix this:
Close the workspace
Open the .xcworkspace file using TextWrangler. TextWrangler allowed me to navigate the package to /xcuserdata/[username].xcuserdatad/UserInterfaceState.xcuserstate. I did a search for the old path and found it. Make the change to the new location of the header file.
This by itself didn't fix it. After cleaning and building, the old value showed back up! Then I deleted the Build folder. It has a ModuleCache that I think was holding on to the old value as well.
After doing this, my project picked up my new value and I was able to build the project. I'm not certain step 2 is necessary. But it did store the old value in there.
In my case, I changed the path from relative path to absolute path and solved.
like
From:
project_name/project_name-Bridging-Header.h
To:
$(SRCROOT)/project_name/project_name-Bridging-Header.h

Installing Reskit and libRestKit.a is missing (red text)

I am following the RestKit setup instructions perfectly, but I am getting libRestKit.a in red in the Linked Binary With Libraries.
Install instructions:
https://github.com/RestKit/RestKit/wiki/Installing-RestKit-in-Xcode-4.x
I would try to drag the libRestKit.a file to my project, but cannot find it anywhere in the Restkit download?
Anyone run across this issue?
Running Xcode 4.5.2
UPDATE: See comments below. Now I am getting "File not Found" for #import
The solution is NOT to copy the "$(BUILT_PRODUCTS_DIR)/../../Headers" from any webpage. Type it out as Xcode didn't like the " copied and pasted. I just replaced the " copied and pasted with manually typed and it worked.
You can try to install RestKit using CocoaPods, then you include like this: #import "RestKit/RestKit.h"
check how to work with cocoapods and restkit here:
https://stackoverflow.com/a/13762665/1848750
If your getting the "File not found" error, check your project settings.
File > Project settings
Derived Data Location > "Project-relative"
Select "Advanced"
Select "Unique"
Clean & Build
The ".a" file doesn't exist until it's built. And if you followed those directions perfectly, I'm guessing you have embedded the RestKit project within your own project, yes?
Here is a image from the instructions; a critical step you need to do (provided you have properly added the RestKit.xcodeproj into your own project). You need to add the .a file (which doesn't exist yet, but will once it's built) as a target dependency to your own app.

How can I add a header folder to my project?

I'm developing an iOS application with latest Xcode 4.5.2.
I have the following folder structure:
/.../SourceCode/MyProjectFolder/projectName.xcodeproject
/.../SourceCode/MyProjectFolder/projectName/
/.../SourceCode/MyProjectFolder/projectName/xxx.m
/.../SourceCode/MyProjectFolder/projectName/xxx.h
/.../SourceCode/MyProjectFolder/projectName/PVRT/
/.../SourceCode/MyProjectFolder/projectName/PVRT/header1.h
/.../SourceCode/MyProjectFolder/projectName/PVRT/OtherFolder/header2.h
If in my header files I add this:
#include "header1.h"
I get a "header1.h" not found error.
But, if I add:
#include "PVRT/header1.h"
I get a "header2.h" not found.
On project settings I have add the following path:
${SOURCE_ROOT}/projectName/PVRT
But I'm getting the same error.
How can I fix this?
Adjust "Header Search Path" values in build settings of target & set according to your project's header file paths.
Hope it may solve your problem.
In the 'Build settings' of your target, search for 'Header Search Paths'. In the highest field (so before 'Debug' and 'Release') type in the following line:
"$(SRCROOT)"/**
This will add your entire source directory to the header search path. You can always expand the path if you want to include specific folders.

compilation warning: no rule to process file for architecture i386

How can I resolve this warning?
[WARN]warning: no rule to process file
'$(PROJECT_DIR)/MyApp/MessageCell.h' of type sourcecode.objj.h for
architecture i386
Click on your project, and check that this file is not present in the tab Build Phases. Normally no header files should stay here. Clean and build it again, it should work!
Graphical guide for Xcode 4.x to remove this warning:
http://joytek.blogspot.tw/2011/09/xcode-4-warning-no-rule-to-process-file.html
We can resolve this issue by simply following the steps below:-
Some .md, .mdown .h files are included in the Compile Sources
Step 1) Select Project Navigator
Step 2) Select your project
Step 3) Select your targetStep
Step 4) Select Build PhasesStep
Step 5) Move files which we don't want the compiler to process from Compile Sources to Copy Bundle Resources
Check this
If you are getting this warning from your cocoapod you ned to make sure the s.source_files is set correctly in the .podspec.
For example I originally included all files with this line in my .podspec
s.source_files = "MyUIElements/**/*"
I was getting this compilation warning for some font files I had in the pod. You control which files show up in BuildPhases -> CompileSources on pod consumption like this:
s.source_files = "MyUIElements/**/*.swift", "MyUIElements/**/*.h"
My problem was't header files because under Target > Build Phases > Compile Resources there weren't any .h files to begin with. The system was complaining about some other files. I followed this link which basically said delete the files the system was complaining about but instead I cntrl + dragged them to Copy Bundle Resources.
The easiest way to search for the files is to use the Filter in the upper right hand corner:
Here are the directions from the link: