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:
Related
I'm trying to import https://github.com/rFlex/SCRecorder in my swift project. I added SCRecoder.xcodeproj to my project and added
#import <SCRecoder/SCRecoder.h>
in my bridging header but it gives me an error
SCRecoder/SCRecoder.h file not found
then I tried
On the SCRecorder project:
Set Build Settings > Packaging > Public Headers Folder Path to include/$(TARGET_NAME)
Add SCRecordSession to Build Phases > Headers > Public
Move Project headers to Public headers
But still same error, any idea on what I did wrong? or the correct way to do it?
delete SCRecoder.xcodeproj file and simply add all .h,.m files and frameworks in SCRecoder
The correct (in my opinion) and easy way to do it is by using Cocoapods.
When adding the library with drag and drop make sure you are selection "copy if needed".
With Cocoapods installed , just edit the file adding "pod 'SCRecorder', '~> 2.4'" and install.
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.
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
I'm new in iOS development, and met this library linking problem in last few days.
I was trying to use GMGridView in a project, but cannot make it working.
This project is shipped as static library, so I just drag the xcodeproj file in my project. Then I added libGMGridView.a in Link Binary With Libraries, GMGridView in Target Dependencies. I also added the path in Header Search Paths.
However, Xcode still report .h file not found error when I tried to import GMGridView.h.
Could anyone give me a hand on this? Thanks in advance!
Had the same issue!!! Made it work!!!!
soooooooo:
copy GMGridView folder from https://github.com/gmoledina/GMGridView to your project dir
in xcode right click on any file group and choose add files
find GMGridView folder in your folder dir and choose GMGridView.xcodeproj - (dont copy, create groups not folders, add targets)
go to your project targets - search - HEADER_SEARCH_PATHS add- GMGridView/**
select Building phases in settings - choose target dependencies and add GMGridView
select Building phases in settings - link binary libraries and add libGMGridView.a
import should be:
#import "GMGridView.h"
#import <QuartzCore/QuartzCore.h>
I have created a sample application to perform bump distortion, using the GPUImage framework. I added this framework to my application, but I'm seeing the following error
Lexical or preprocessor issue 'GPUImage.h' file not found.
I have added the -ObjC flag to the Other Linker Flags, but I'm still seeing this error. How can I solve this problem and get my application to compile?
Adding GPUImage framework to XCode project could be tricky. So I haved added detailed step-by-step instructions w/ images on how to do it.
Static Compilation Method (detailed solution so we don't mess up)
This is Static compilation method. In this basically we will compile the framework using ./build.sh file. And simply add it to our XCode project, then configure XCode to properly use it.
Download GPUImage from Github and extract it (or just clone it).
Go to the GPUImagefolder in terminal
Run ./build.sh
Note: This will compile and create ready-to-use binary for all the sdks on your mac.
build.sh creates a folder called build and generates compiled binaries and dumps them to folders like: Release-iPhone, Release-iPhoneOS, Release-iphonesimulator etc folders.
For iPhone use Release-iphone (This also works for simulator).
Copy (not drag-drop) Release-iphone to your XCode project's root directory so that we have a local copy of framework.
Now iPhone drag-and-drop Release-iphone onto your XCode project. Make sure to check "Copy to .." option.
Note:
This Release-iphone folder contains two sub-folders: include and lib
include folder contains all the header .h files
lib folder contains compiled binary version file called libGPUImage.a
We now need to simply configure XCode to use .h and .a files.**
Select your project in the project explorer > Project name under Targets > select Build Phases > Expand Link Binary With Libraries
Add the libGPUImage.a to Link Binary With Libraries section. You may want to Right-click on libGPUImage.a then Open in Finder and finally drag-drop it.
While we are at it, also add the following GPUImage's dependent frameworks/ libraries
CoreMedia, CoreVideo, OpenGLES, AVFoundation, QuartzCore to Link Binary With Libraries section
Now, lets configure .h headers.
Select your project in the project explorer > Project name under Targets > select Build Settings > and type search paths to see search paths section.
Open Headers Search Paths by clicking on the value field.
Drag-and-drop the lib folder to that popup. Note: If it shows absolute path, change it to looks $(SRCROOT)/path/to/lib/. (You should have the framework relative to your xcode project see step 6).
Repeat 11 & 12 for Library Search Paths as well.
Additional tips: You can add .h files to Library Search Paths or Headers Search Paths, you can make them Recursive. I have a main root-folder called Dependencies folder where I keep all the dependencies like MySDK-framework including Release-iPhone. And I just have one search-path at the Dependencies (root folder) and made it recursive.
Did you follow all of the instructions from the Readme on the project page? From the installation instructions:
You'll also need to find the framework headers, so within your
project's build settings set the Header Search Paths to the relative
path from your application to the framework/ subdirectory within the
GPUImage source directory. Make this header search path recursive.
If you're seeing the above error, it means that you did not point the Header Search Paths at the right directory where you've installed GPUImage relative to your project, and / or did not click the checkbox to the left to make those search paths recursive.
I show some screenshots of where you need to go to set this in this answer, which explains something similar for the Core Plot framework. The same principles apply, only you need to find where you installed the GPUImage framework at.
I add relative path to "Header Search Paths", but there is still a error that is "not found".
Then, I add path to "User Header Search Paths", and it works.
May help you.
finally, I realized the KEY WORD is relative!
I put GPUImage source files in my project root dir:
before I solved the problem, I add Header Search Paths is:
$(PROJECT_DIR)/GPUImage/framework
$(PROJECT_DIR)/GPUImage/framework/iOS
and make them Recursive, but error is still there, So I changed Paths to:
GPUImage/framework and make it Recursive, then it works.
Hope it helps.