- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在开发一个使用 presentationDimensions(...) API 的相机应用程序:
if #available(iOS 13.0, *) {
let leftVideo = self.formatDescription.presentationDimensions()
let rightVideo = other.formatDescription.presentationDimensions()
// ...
}
现在,当我尝试构建项目时,出现以下错误:
Undefined symbol: (extension in CoreMedia):__C.CMFormatDescriptionRef.presentationDimensions(usePixelAspectRatio: Swift.Bool, useCleanAperture: Swift.Bool) -> __C.CGSize
这是最后的 Xcode 日志(错误):
Ld /Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/VisionCameraExample.app/VisionCameraExample normal (in target 'VisionCameraExample' from project 'VisionCameraExample')
cd /Users/mrousavy/Projects/react-native-vision-camera/example/ios
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios12.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/CocoaAsyncSocket -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/DoubleConversion -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/FBReactNativeSpec -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/Flipper -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/Flipper-DoubleConversion -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/Flipper-Folly -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/Flipper-Glog -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/Flipper-PeerTalk -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/Flipper-RSocket -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/FlipperKit -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/Folly -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/RCTTypeSafety -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/React-Core -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/React-CoreModules -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/React-RCTAnimation -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/React-RCTBlob -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/React-RCTImage -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/React-RCTLinking -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/React-RCTNetwork -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/React-RCTSettings -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/React-RCTText -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/React-RCTVibration -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/React-cxxreact -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/React-jsi -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/React-jsiexecutor -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/React-jsinspector -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/ReactCommon -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/Yoga -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/YogaKit -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/glog -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/libevent -L/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/react-native-vision-camera -F/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos -F/Users/mrousavy/Projects/react-native-vision-camera/example/ios/Pods/OpenSSL-Universal/Frameworks -F/Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/OpenSSL -filelist /Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Intermediates.noindex/VisionCameraExample.build/Debug-iphoneos/VisionCameraExample.build/Objects-normal/arm64/VisionCameraExample.LinkFileList -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Intermediates.noindex/VisionCameraExample.build/Debug-iphoneos/VisionCameraExample.build/Objects-normal/arm64/VisionCameraExample_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Intermediates.noindex/VisionCameraExample.build/Debug-iphoneos/VisionCameraExample.build/Objects-normal/arm64/VisionCameraExample.swiftmodule -ObjC -lCocoaAsyncSocket -lDoubleConversion -lFBReactNativeSpec -lFlipper -lFlipper-DoubleConversion -lFlipper-Folly -lFlipper-Glog -lFlipper-PeerTalk -lFlipper-RSocket -lFlipperKit -lFolly -lRCTTypeSafety -lReact-Core -lReact-CoreModules -lReact-RCTAnimation -lReact-RCTBlob -lReact-RCTImage -lReact-RCTLinking -lReact-RCTNetwork -lReact-RCTSettings -lReact-RCTText -lReact-RCTVibration -lReact-cxxreact -lReact-jsi -lReact-jsiexecutor -lReact-jsinspector -lReactCommon -lYoga -lYogaKit -lglog -llibevent -lreact-native-vision-camera -lstdc++ -framework AudioToolbox -framework CFNetwork -framework JavaScriptCore -framework MobileCoreServices -framework OpenSSL -framework Security -framework UIKit -ObjC -lc++ -lPods-VisionCameraExample -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Intermediates.noindex/VisionCameraExample.build/Debug-iphoneos/VisionCameraExample.build/Objects-normal/arm64/VisionCameraExample_dependency_info.dat -o /Users/mrousavy/Library/Developer/Xcode/DerivedData/VisionCameraExample-aeiaddcztqvxgygupinrzjkkdodr/Build/Products/Debug-iphoneos/VisionCameraExample.app/VisionCameraExample
Undefined symbols for architecture arm64:
"(extension in CoreMedia):__C.CMFormatDescriptionRef.presentationDimensions(usePixelAspectRatio: Swift.Bool, useCleanAperture: Swift.Bool) -> __C.CGSize", referenced from:
(extension in react_native_vision_camera):__C.AVCaptureDeviceFormat.isBetterThan(__C.AVCaptureDeviceFormat) -> Swift.Bool in libreact-native-vision-camera.a(AVCaptureDevice.Format+isBetterThan.o)
(extension in react_native_vision_camera):__C.AVCaptureDeviceFormat.matchesFilter(__C.NSDictionary) -> Swift.Bool in libreact-native-vision-camera.a(AVCaptureDevice.Format+matchesFilter.o)
(extension in react_native_vision_camera):__C.AVCaptureDeviceFormat.toDictionary() -> [Swift.String : Any] in libreact-native-vision-camera.a(AVCaptureDevice.Format+toDictionary.o)
(maybe you meant: default argument 1 of (extension in CoreMedia):__C.CMFormatDescriptionRef.presentationDimensions(usePixelAspectRatio: Swift.Bool, useCleanAperture: Swift.Bool) -> __C.CGSize, default argument 0 of (extension in CoreMedia):__C.CMFormatDescriptionRef.presentationDimensions(usePixelAspectRatio: Swift.Bool, useCleanAperture: Swift.Bool) -> __C.CGSize )
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我的 .pbxproj(删除了不相关的部分,如发布配置等):
// ...
/* Begin XCBuildConfiguration section */
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 47F7ED3B7971BE374F7B8635 /* Pods-VisionCameraExample.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = CJW62Q77E7;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = VisionCameraExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativevisioncamera;
PRODUCT_NAME = VisionCameraExample;
SWIFT_OBJC_BRIDGING_HEADER = "VisionCameraExample-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
// ...
83CBBA201A601CBA00E9B192 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
LIBRARY_SEARCH_PATHS = (
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
"\"$(inherited)\"",
);
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
// ...
请注意,当我删除对 presentationDimensions 的那些调用时,一切正常。
有人可以帮我吗?该 API 从 iOS 13.0 开始可用,即使我的 iOS 部署目标是 11.0,我仍然应该能够构建它,不是吗?
最佳答案
终于找到答案了。我将 SWIFT_VERSION
固定到 5.0,但 iOS 13 附带了 Swift 5.2,因此将 Swift 固定到 5.2(并删除指向 5.0 的 LIBRARY_SEARCH_PATH
)解决了这个问题。
这意味着,这:
LIBRARY_SEARCH_PATHS = (
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
"\"$(inherited)\"",
);
SWIFT_VERSION = 5.0;
应该是这样的:
LIBRARY_SEARCH_PATHS = (
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
"\"$(inherited)\"",
);
SWIFT_VERSION = 5.2;
耶稣基督。
关于ios - Swift 链接器错误 : Undefined symbol for surely available API presentationDimensions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66281687/
有没有办法在 .swift 文件(编译成 .swift 模块)中声明函数,如下所示: 你好.swift func hello_world() { println("hello world")
我正在尝试使用 xmpp_messenger_ios 和 XMPPFramework 在 iOS 上执行 MUC 这是加入房间的代码。 func createOrJoinRoomOnXMPP()
我想在我的应用程序上创建一个 3D Touch 快捷方式,我已经完成了有关快捷方式本身的所有操作,它显示正确,带有文本和图标。 当我运行这个快捷方式时,我的应用程序崩溃了,因为 AppDelegate
我的代码如下: let assetTag = Expression("asset_tag") let query2 = mdm.select(mdm[assetTag],os, mac, lastRe
我的 swift 代码如下所示 Family.arrayTuple:[(String,String)]? = [] Family.arrayTupleStorage:String? Family.ar
这是我的 JSON,当我读取 ord 和 uniq 数据时出现错误 let response2 : [String: Any] = ["Response":["status":"SUCCESS","
我想将 swift 扩展文件移动到 swift 包中。但是,将文件移动到 swift 包后,我遇到了这种错误: "Type 'NSAttributedString' has no member 'ma
使用CocoaPods,我们可以设置以下配置: pod 'SourceModel', :configurations => ['Debug'] 有什么方法可以用 Swift Package Manag
我正在 Xcode 中开发一个 swift 项目。我将其称为主要项目。我大部分都在工作。我在日期选择器、日期范围和日期数学方面遇到了麻烦,因此我开始了另一个名为 StarEndDate 的项目,其中只
这是 ObjectiveC 代码: CCSprite *progress = [CCSprite spriteWithImageNamed:@"progress.png"]; mProgressBar
我正在创建一个命令行工具,在 Xcode 中使用 Swift。我想使用一个类似于 grunt 的配置文件确实如此,但我希望它是像 Swift 包管理器的 package.swift 文件那样的快速代码
我假设这意味着使用系统上安装的任何 swift 运行脚本:#!/usr/bin/swift 如何指定脚本适用的解释器版本? 最佳答案 Cato可用于此: #!/usr/bin/env cato 1.2
代码说完全没问题,没有错误,但是当我去运行模拟器的时候,会出现这样的字样: (Swift.LazyMapCollection (_base:[ ] 我正在尝试创建一个显示报价的报价应用。 这是导入
是否可以在运行 Swift(例如 Perfect、Vapor、Kitura 等)的服务器上使用 RealmSwift 并使用它来存储数据? (我正在考虑尝试将其作为另一种解决方案的替代方案,例如 no
我刚开始学习编程,正在尝试完成 Swift 编程书中的实验。 它要求““编写一个函数,通过比较两个 Rank 值的原始值来比较它们。” enum Rank: Int { case Ace = 1 ca
在您将此问题标记为重复之前,我检查了 this question 它对我不起作用。 如何修复这个错误: error: SWIFT_VERSION '5.0' is unsupported, suppo
从 Xcode 9.3 开始,我在我的模型中使用“Swift.ImplicitlyUnwrappedOptional.some”包裹了我的字符串变量 我不知道这是怎么发生的,但它毁了我的应用程序! 我
这个问题在这里已经有了答案: How to include .swift file from other .swift file in an immediate mode? (2 个答案) 关闭 6
我正在使用 Swift Package Manager 创建一个应用程序,我需要知道构建项目的配置,即 Debug 或 Release。我试图避免使用 .xcodeproj 文件。请有人让我知道这是否
有一个带有函数定义的文件bar.swift: func bar() { println("bar") } 以及一个以立即模式运行的脚本foo.swift: #!/usr/bin/xcrun s
我是一名优秀的程序员,十分优秀!