我已经将SpatialIite合并到一个Xcode项目中,该项目使用了来自projproject .4的头文件,只有一个头文件。两者都是Xcode项目,都有静态目标。
我试图从git子模块迁移到Cocoapods。由于静态目标似乎很难与Cocoapods一起使用,我只想以通常的方式构建项目。我为项目4做了podspec。在为SpatialLite编写podfile后,我得到了警告:
[!] The target `SpatialiteIOS [Debug]` overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Pods.xcconfig'.
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The target `SpatialiteIOS [Debug]` overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Pods.xcconfig'.
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The target `SpatialiteIOS [Debug - Release]` overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Pods.xcconfig'.
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The target `SpatialiteIOS [Debug - Release]` overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Pods.xcconfig'.
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
我读了这个问题,但我对警告是什么意思以及我能做些什么来解决它一无所知。
另外一个问题是,当我单独打开工作区以及打开SpatiaLite项目时,两者都是针对Mac OSX 64的,而它应该是一个iOS项目。我的播客文件上写着“平台:ios”。
当我将$(inherited)标记添加到有问题的文件(在本例中是LIBRARY_SEARCH_PATHS)时,它导致了架构arm64的未定义符号:“_swift_getTypeByMangledNameInContextInMetadataState”的另一个错误
改变以下工作,我能够构建:
>LIBRARY_SEARCH_PATHS = (
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
- "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", <--- Change this...
+ "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.2/$(PLATFORM_NAME)\"", <--- to this
"\"$(inherited)\"",
> );
当我将$(inherited)标记添加到有问题的文件(在本例中是LIBRARY_SEARCH_PATHS)时,它导致了架构arm64的未定义符号:“_swift_getTypeByMangledNameInContextInMetadataState”的另一个错误
改变以下工作,我能够构建:
>LIBRARY_SEARCH_PATHS = (
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
- "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", <--- Change this...
+ "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.2/$(PLATFORM_NAME)\"", <--- to this
"\"$(inherited)\"",
> );
您的构建设置和Cocoapods希望的默认构建设置之间存在冲突。要查看Cocoapods的构建设置,请查看项目中的Pods/Target Support Files/Pods-${PROJECTNAME}/中的.xcconfig文件。对我来说,这个文件包含:
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/Commando"
OTHER_LDFLAGS = -ObjC -framework Foundation -framework QuartzCore -framework UIKit
PODS_ROOT = ${SRCROOT}/Pods
如果您对Cocoapods的设置满意,那么请转到项目的Build settings,找到合适的设置并点击Delete键。这将使用Cocoapods的设置。
另一方面,如果您有一个需要使用的自定义设置,则向该设置添加$(inherited)。