external framework File/File.h (Parse/Parse.h) file not found

假装没事ソ 提交于 2019-11-28 07:01:39

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.

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.

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.

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.

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.

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

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.

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 :)

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!