我在我的项目中使用Cocoapods,但我也想使用非Cocoapods管理的框架。我最近尝试在我的podfile中使用use_frameworks!
命令切换到框架,但结果是构建失败,因为它无法从我的第三方框架中找到标头。在我的项目的xcconfig文件中,我有FRAMEWORK_SEARCH_PATHS = $(inherited) $(PROJECT_DIR)/vendor
,它在过去工作(供应商是存储.framework文件的地方)。
我对这个话题不太了解;我尝试解决这个问题的方法是使用与HEADER_SEARCH_PATHS
相同的设置向xcconfig文件添加FRAMEWORK_SEARCH_PATHS
设置,但这并没有解决问题。任何帮助,将不胜感激。
FRAMEWORK_SEARCH_PATHS = "$PODS_FRAMEWORK_BUILD_PATH"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/x.framework/Headers" -iquote "$PODS_FRAMEWORK_BUILD_PATH/y.framework/Headers" -iquote "$PODS_FRAMEWORK_BUILD_PATH/z.framework/Headers" -iquote "$PODS_FRAMEWORK_BUILD_PATH/a.framework/Headers"
OTHER_LDFLAGS = $(inherited) -ObjC -framework "x" -framework "y" -framework "z" -framework "a"
OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-ProjectName
PODS_ROOT = ${SRCROOT}/Pods
APPLICATION_EXTENSION_API_ONLY = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) $(PROJECT_DIR)/vendor
WARNING_CFLAGS = $(inherited) -include "$(SOURCE_ROOT)/ProjectName/ProjectNameVersion.h"
INFOPLIST_FILE = ProjectName/Info.plist
PRODUCT_NAME = ProjectName
SKIP_INSTALL = YES
#include "ProjectName.xcconfig"
<h1>include "../Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.debug.xcconfig"
问题是,当我打开xcporoject文件并转到Build Settings-&gt; Framework Search Paths时,我实际看到的是bulid/Debug-iphoneos/Pods-ProjectName
。所以我的供应商搜索路径被覆盖了。
格式化的道歉,SO并不想强调这些东西作为代码,在某些情况下甚至试图使它变得粗体......