ERROR: iPhone Private Frameworks "没有这样的文件或目录"[英] ERROR: iPhone Private Frameworks "No such file or directory"

本文是小编为大家收集整理的关于ERROR: iPhone Private Frameworks "没有这样的文件或目录"的处理方法,想解了ERROR: iPhone Private Frameworks "没有这样的文件或目录"的问题怎么解决?ERROR: iPhone Private Frameworks "没有这样的文件或目录"问题的解决办法?那么可以参考本文帮助大家快速定位并解决问题。

问题描述

我已将私有框架添加到我的项目中.当我在 DEVICE 中构建时 |RELEASE 一切正常,我可以 ldid -S 应用程序,它在我的设备上成功启动.

但是,当尝试在模拟器中构建并运行时,我收到错误"没有这样的文件或目录",如下所示:(我也收到两次错误,这也很奇怪.)

 Line Location HomeProfileViewController.h:10: error:  BluetoothManager/BluetoothManager.h:  No such file or directory

以下是我目前拥有的项目和构建设置,也许有人可以找到错误并告诉我,那太棒了!

项目设置:

PRIVATE_HEADERS_FOLDER_PATH = "/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include"
PUBLIC_HEADERS_FOLDER_PATH = "/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include"
USER_HEADER_SEARCH_PATHS = "/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include"

OTHER_CFLAGS = "-I/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include-I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include-I/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/arm-apple-darwin9/4.0.1/include-F/System/Library/Frameworks-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks-DMAC_OS_X_VERSION_MAX_ALLOWED=1050"

目标构建设置:

PRIVATE_HEADERS_FOLDER_PATH = "/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks"
FRAMEWORK_SEARCH_PATHS = "$(inherited) $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks"
USER_HEADER_SEARCH_PATHS = "/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include/**"

OTHER_CFLAGS = "-I/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include-I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include-I/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/arm-apple-darwin9/4.0.1/include-F/System/Library/Frameworks-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks-DMAC_OS_X_VERSION_MAX_ALLOWED=1050"

注意:路径中的引号实际上并没有出现在我的项目中,我把它们放进去是为了让网站的语法更好.

Cydia

推荐答案

实际上,对于 SDK 3.0+,请确保二进制文件和头文件位于 PrivateFrameworks 文件夹中,如下例所示:/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks/BluetoothManager.framework

二进制文件和头文件必须在这个目录下,头文件必须在/Headers下,例如:/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks/BluetoothManager.framework/Headers/BluetoothManager.h

然后在需要私有标头的地方使用这些语句:

#if TARGET_IPHONE_SIMULATOR
    //This is where you put code for simulator
#else
    //Private functions will go here!       
#endif

现在您可以从上面列出的第一个目录添加私有框架,您可以构建并运行模拟器,构建设备!在设备/模拟器之间切换时,您不必添加/删除框架!

本文地址:https://www.itbaoku.cn/post/1793820.html