lexical or preprocessor issue file not found occurs while archiving?
Asked Answered
G

13

47

this is the screen shot foe the error

I am new to this iPhone development and i have almost completed my first application but when i try for creating an archive it gives an error lexical or preprocessed issue file not found But it runs fine in simulator and also has also tested on device. I have included SDwebimage architecture for lazy loading of image in table view.Can any tell me what is the issue?

Girand answered 7/6, 2012 at 4:8 Comment(1)
Delete the unit testing from your project follow the steps select your project from the project navigator to open the project editor. From the target delete the test from the left side of the project editor and press the Delete key.Kandrakandy
E
57

Few things to try, Ensure the Framework and all it's headers are imported into your project properly.

Also in your Build Settings set YES to Always search user paths, and make sure your User header paths are pointing to the Framework.

Finally, Build->Clean and Restart Xcode.

Hope this helps !

UPDATE: According to SDWebImage's installation, it's required you make a modification to Header Search Path and not User header paths, As seen below.

enter image description here

Have you done this as well? I suggest slowly, re-doing all the installation steps from the beginning.

Elmira answered 7/6, 2012 at 4:20 Comment(7)
I have done all the setting according to github.com/rs/SDWebImage in that it is specified that there is not need to give the user header path.Can u tell me how to get the user header path to set in the user header pathGirand
yea i have done the installation steps as told in the site .Then also the same error occurs.This occurs only when archiving.Can u suggest me any method to solve this?Girand
If it fails only for Archiving, your archive build settings must be different from the other build settings. Compare paths from Debug settings and your Archive scheme. Are you using Release for Archive? Try Duplicating Debug and use that for Archiving.Elmira
may i know how it is done ? actually i am new to this iphone developmentGirand
I Have same problem. ![Please see this image:][1] [1]: i.sstatic.net/daXTF.png I am developed project in 4.3 iOS and after the switched to iOS 6.0. Then xcode gives that error.Antinucleon
Clean and Restart Rocks !Darin
Header Search Path: $(PROJECT_DIR)/HEADER_FOLDERBayer
L
10

Spaces in a folder name in your header search path can cause this problem. Make sure the folders in your project do not have spaces in their names.

Larios answered 10/6, 2013 at 15:21 Comment(2)
I had this!! Thought of posting as an answer.. Found yours.!Neomineomycin
Spaces were my problem as well. Would not have thought to try this solution. Thanks!!Vitrification
P
5

My project was building fine until I updated to Xcode 10.1. After the Xcode update, started getting Lexical or preprocessor Issue errors on build. Some XCDataModel header files could not be found.

This fixed the issue.

Go to Build Settings, Header Search Paths Change the appropriate value from $(SRCROOT) non-recursive to recursive.

This ensures that subfolders are also searched for headers during build.

enter image description here

Peshawar answered 15/11, 2018 at 11:31 Comment(0)
D
4

I had this same issue now and found that my sub-projects 'Public Header Folder Path' was set to an incorrect path (when compared with what my main project was using as its 'Header Search Path' and 'User Header Search Path').

e.g.

My main project had the following:

  • Header Search Paths
    • Debug "build/Debug-iphoneos/../../Headers"
    • Release "build/Debug-iphoneos/../../Headers"

And the same for the User Header Search Paths


Whereas my sub-project (dependency) had the following:

  • Public Header Folder Path
    • Debug "include/BoxSDK"
    • Release "include/BoxSDK"

Changing the 'Public Header Folder Path' to "../../Headers/BoxSDK" fixed the problem since the main project was already searching that folder ('../../Headers').

PS: I took some good screenshots, but I am not allowed to post an answer with images until I hit reputation 10 :(

Deeann answered 25/10, 2013 at 9:50 Comment(3)
can you add images now your repotation is more than 100Thematic
Unfortunately that issue is long gone and the screenshots are gone with it :( What are you having an issue with exactly, maybe I can help out?Deeann
I have a cocos2d ios project generated by the cocos creator IDE. Let's say ProjectA The ProjectA has references to cocos library project (cocos2d.xcodeproj) I exported the ProjectA as a framework with the required dependencies. The framework is build successfully. I have imported the framework in another ProjectB. When I run the Build the ProjectB it gives me this error. The file sits in the cocos2d.xcodeproj. Could you please helpRustice
S
4

I had this problem after changed project name. I used all the methods mentioned on the internet but still doesn't work. Then I realized that all the header files not found was from cocoapods, so I re-installed the cocoapods using pod install, and thus solved the problem.

Hope this could help.

Shifty answered 29/11, 2014 at 0:31 Comment(0)
A
3

In my case I was developing a framework and had a test application inside it, what was missing is inside the test application target -> build settings -> Framework Search Paths:

  • The value needed to be the framework path (the build output - .framework) which is in my case: "../FrameworkNameFolder/" - the 2 points indicates to go one folder up.

Also, inside the test application target -> Build Phases -> Link Binary With Libraries:

  • I had to remove the framework file, clean the project, add the framework file again, compile and this also solved the issue.
Anthe answered 3/9, 2015 at 11:26 Comment(0)
M
0

The new version contain fix for this, feel free to update. Or you can just replace

#include "iPhone_View.h"

with

#if UNITY_VERSION < 450

#include "iPhone_View.h"

#endif
Monohydroxy answered 3/3, 2015 at 13:20 Comment(0)
K
0

Delete the unit testing from your project follow the below steps this will solve the issue.

select your project from the project navigator to open the project editor. From the target delete the test from the left side of the project editor and press the Delete key.

Kandrakandy answered 18/5, 2015 at 18:21 Comment(0)
I
0

I know this is old, but I'm gonna chime in anyway because it may be useful to someone. If you can still see the file in Finder, then click on the file in your project and delete it, selecting "remove references" and not "move to trash".

Once the reference is removed, drag and drop the file from finder into your project again and it should sort itself out.

Idaline answered 2/3, 2017 at 17:2 Comment(0)
H
0

Just adding another thing that worked for me :

react-native link

Evidently my ReactNative files were no longer there. I could figure that out by clicking on

Build Phases -> Link Binary with Libraries ->

Then right clicking a file I knew was responsible for React, and clicking Show In Finder .

But nothing opened. So assuming the library went missing, I just ran the above command which relinked everything again.

Also if you havn't, try :

rm -rf node_modules/ && npm install
Highstrung answered 16/3, 2017 at 9:29 Comment(0)
S
0

This happened to me after I renamed a file. For some reason it was still looking for the file with the old name. What I did was create the file that it was complaining about and added to the project. Then I did a Project->clean, then Project->Build and verified the error was gone. Then I selected the newly added files and deleted them. This removed all references and I no longer see the error.

Senate answered 21/4, 2017 at 11:21 Comment(0)
C
0

I fixed mine. The fb sdk downloaded (from my browser) as 'FacebookSDKs-iOS-4.22.0' -- I just had to rename the folder to FacebookSDK. So now in Build

Settings --> Framework Search Paths

the path looks something like /Users/.../Documents/FacebookSDK (where as before it was /Users/.../Documents/FacebookSDKs-iOS-4.22.0) Hope this helps!

Carlocarload answered 12/7, 2017 at 11:42 Comment(0)
C
0

For what it's worth, my problem was completely unrelated to the error Xcode was giving. I stumbled onto a solution by deleting the .h reference, compiling, adding the reference back and compiling again. The actual error then became evident.

Catechu answered 24/7, 2019 at 15:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.