Post

Replies

Boosts

Views

Activity

iOS Build fails when using vImage_CGImageFormat(cgImage: CGImage), even with target=13.0
I'm getting a build error when attempting to use the function vImageCGImageFormat(cgImage: CGImage), which the documentation indicates is only available >= ios 13.0. I also get errors if I try to use any other vImage function that is only available >- ios 13.0. I set the "iOS Deployment Target" to "iOS 13.0", but the error persists. I also tried cleaning and rebuilding. This is the exact error: Undefined symbol: (extension in Accelerate):C.vImageCGImageFormat.init(cgImage: C.CGImageRef) -> _C.vImageCGImageFormat? This is demo code that's causing the build error: 	 import Foundation 	 import Accelerate.vImage 	 import CoreGraphics class ImageProcessor : NSObject { 	@objc func resizeImg(img: UIImage) -> UIImage? { 		 		guard var format = vImage_CGImageFormat(cgImage: img.cgImage!) else { 								print("Unable to create format.") 				return nil 		} 		return img 	} } Interestingly, the XCode doesn't detect the error until building. My environment: XCode 12.5 MacOS 10.15.17 Swift 5 If I create a new project with these same settings the build works fine, so there must be something else in my main project that is causing the iOS 13+ methods to be excluded. Is there another target setting that needs to be changed? Could it be related to other pods I have in the project? I'd appreciate any help. Thanks!
3
0
1.6k
Jan ’21