“Non-portable path to file ”File.h“; specified path differs in case from file name on disk” warning in bridging header after updating to Xcode 8.3

六眼飞鱼酱① 提交于 2019-12-20 11:35:12

问题


I updated to Xcode 8.3 and Swift 3.1 and got this warning in my bridging header file, referencing to an Objective-C header file:

Non-portable path to file "File.h"; specified path differs in case from file name on disk

How can I resolve this?


回答1:


It turned out that I misspelled the file's name, the correct name was "FILE.h" instead of "File.h". The warning appeared because of the soon coming APFS to macOS.




回答2:


In my case, the !!project folder name!! isn't match the bridging header path.

I changed

"project/project-Bridging-Header.h"

to

"Project/project-Bridging-Header.h"

Tested on Xcode 9.3




回答3:


One additional cause, that I experienced, was that a library project was importing itself incorrectly. For example, given projects Main and Library, Main would import Library with:

#import "Library/Library.h"

If Library attempts to use the same import, the Non-portable path warning will appear. Removing the path portion is the easy fix:

#import "Library.h"

The better fix is to import the specific components that Library needs from itself:

#import "Widget.h"
#import "NSString+Library.h" 


来源:https://stackoverflow.com/questions/43067017/non-portable-path-to-file-file-h-specified-path-differs-in-case-from-file-na

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