external framework File/File.h (Parse/Parse.h) fil

2019-01-17 12:23发布

问题:

So every time I update my app, Xcode claims not to be able to find a particular external framework even though it's there. It's happened again with Xcode 6 and my usual methods (I'm fairly inexperienced, so these basically involve clicking and typing things until something happens (I exaggerate but not by much)) aren't working.

I'm getting a Lexical or Preprocessor Issue error that says 'Parse/Parse.h' file not found.' But here are screenshots of it in the project and added to the library:

I also followed the steps in the most upvoted answer at ‘ld: warning: directory not found for option’ but still nothing.

Any idea what to do? Any idea at all? I'm tearing my hair out here.

回答1:

Actually I was facing the same problem but after doing lots of (removing/adding parse framework) efforts I come to know that parse.framework is already added and error was still there.

Real Problem was not in link Binary for main project but it was with Tests link Binary. Lets say your project name is "project1" and Xcode create one more folder with it called "project1Tests". So select "project1Tests" and add parse.framework in link Binary.

Check out the hierarchy:

PROJECT
project1

TARGETS
project1
project1Tests (you need to select this to add parse framework).

Hope this would help you resolve this issue.



回答2:

I had this error also. I'm developing in Swift, so I added a "bridge header" as described in this Parse blog post.

The reason I got the "Parse.h not found" was that my project name contained spaces. (For project name I mean the Product Name you enter when creating a new project, which determines your folder's name.) The first day all went well, but after closing and opening Xcode, it turns out that Xcode interprets the words separated by spaces as different paths.

To fix this, you can go to Build Settings -> Search Paths -> Framework Search Paths and add an "\" before each space. (If you double click the path you'll see that Xcode shows each word separated by space as a different entry.)

Also note that the bridge header with #import <Parse/Parse.h> it's not compulsory: you can simply do import Parse.



回答3:

All I had to do was remove Parse.framework from this list by highlighting and pressing delete.

Then I went down to the plus sign at the bottom of that list and had to select Add Other and manually locate the downloaded .framework file.



回答4:

In my case, the error went away after I added the path to the directory where Parse.framework was to the Frameworks Search Paths Build Setting:

My project didn't even have an entry for that setting, so you may need to create it as well.



回答5:

I had the same issue when upgrading parse to 1.4v. You have to delete Parse.framework from Framework List and from the project directory, when removed from both places copy again and check "Copy items to destination's group folder". It worked for me.



回答6:

Its work for me. Just go to Build Active Architecture Only and Debug should be yes and Release should be No



回答7:

In my case I had to do one more thing additional to Sukhchais' answer. It seems that though the parse.framework appears in the 'link Binary with Libraries' list for the targets, they might not have linked properly for some reason. Just remove parse.framework from the list and add it again as mentioned. By that way I was able to resolve my issue.



回答8:

Just to Share my findings in case if somebody might have the same issue:

Accidentally we had two references of Parse.framework inside our source code base at two different places. And a reference of Parse.framework was linked in Build Phases of the target, from the first place. But when the app is compiled, Xcode was not smart enough to get a reference and trowed an error: "Lexical or Preprocessor Issue" error when "Parse/Parse.h" is imported in .pch file. After spending couple of hours by trying various options, removed a reference of Parse.framework from the source base and kept only a single reference. This solved the issue.

And the app compiled successfully :)



回答9:

For people coming from Ionic + Cordova if you are getting this error I solved it by removing my current parsePlugin and replacing it with this fork.

For simplicity, I used these console commands (Replace PARSE_APP_ID and PARSE_CLIENT_KEY with your keys in the Parse Console):

cordova plugin rm com.parse.cordova.core.pushPlugin
cordova plugin add https://github.com/grrrian/phonegap-parse-plugin --variable APP_ID=PARSE_APP_ID --variable CLIENT_KEY=PARSE_CLIENT_KEY


回答10:

Ok, so I was having this problem as well. I uninstalled all my pods, reinstalled them again, and had no luck. So the good news (and bad news considering the time I spent trying to find the problem) is that I eventually managed to solve it. Apparently, you have to import Foundation/Foundation.h before parse. I don't know whether this will work for you or not, but I tried everything on the net, and only this seemed to work. If you have any instances of this:

#import <Parse/Parse.h>
#import <Foundation/Foundation.h>

flip it around so that Foundation is declared first:

#import <Foundation/Foundation.h>
#import <Parse/Parse.h>

I also read somewhere that some people had issues with Facebook SDK and Parse SDK import. Apparently, the two have Bolt.Framework in common or something, which causes error. I removed Facebook SDK as well, which at first didn't make any difference. I hope I could help.