amosavian / JWSETKit

A kit to create, sign and verify a JWT or JWS object
https://amosavian.github.io/JWSETKit/documentation/jwsetkit/
MIT License
38 stars 6 forks source link

Build fails when building for SwiftUI preview #13

Closed hemantf1 closed 1 month ago

hemantf1 commented 2 months ago

My app builds perfectly fine when running in device or simulator, but when building for preview in SwiftUI the build fails with below errors:

Ld /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Products/Debug-iphonesimulator/JWSETKitErrorReplicate.app/JWSETKitErrorReplicate normal (in target 'JWSETKitErrorReplicate' from project 'JWSETKitErrorReplicate') cd /Users/hemantshrestha/Documents/Repo/iOS/Practice/JWSETKitErrorReplicate /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Xlinker -reproducible -target arm64-apple-ios17.5-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.5.sdk -O0 -L/Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Intermediates.noindex/EagerLinkingTBDs/Debug-iphonesimulator -L/Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Products/Debug-iphonesimulator -F/Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Intermediates.noindex/EagerLinkingTBDs/Debug-iphonesimulator -F/Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Products/Debug-iphonesimulator -filelist /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Intermediates.noindex/JWSETKitErrorReplicate.build/Debug-iphonesimulator/JWSETKitErrorReplicate.build/Objects-normal/arm64/JWSETKitErrorReplicate.LinkFileList -Xlinker -rpath -Xlinker /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Products/Debug-iphonesimulator/PackageFrameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Intermediates.noindex/JWSETKitErrorReplicate.build/Debug-iphonesimulator/JWSETKitErrorReplicate.build/Objects-normal/arm64/JWSETKitErrorReplicate_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Intermediates.noindex/JWSETKitErrorReplicate.build/Debug-iphonesimulator/JWSETKitErrorReplicate.build/Objects-normal/arm64/JWSETKitErrorReplicate.swiftmodule -Wl,-no_warn_duplicate_libraries -Wl,-no_warn_duplicate_libraries -Wl,-no_warn_duplicate_libraries -Wl,-no_warn_duplicate_libraries -Wl,-no_warn_duplicate_libraries -Wl,-no_warn_duplicate_libraries -Wl,-no_warn_duplicate_libraries -Wl,-no_warn_duplicate_libraries -Wl,-no_warn_duplicate_libraries -Wl,-no_warn_duplicate_libraries -Xlinker -sectcreate -Xlinker TEXT -Xlinker entitlements -Xlinker /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Intermediates.noindex/JWSETKitErrorReplicate.build/Debug-iphonesimulator/JWSETKitErrorReplicate.build/JWSETKitErrorReplicate.app-Simulated.xcent -Xlinker -sectcreate -Xlinker TEXT -Xlinker ents_der -Xlinker /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Intermediates.noindex/JWSETKitErrorReplicate.build/Debug-iphonesimulator/JWSETKitErrorReplicate.build/JWSETKitErrorReplicate.app-Simulated.xcent.der -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Intermediates.noindex/JWSETKitErrorReplicate.build/Debug-iphonesimulator/JWSETKitErrorReplicate.build/Objects-normal/arm64/JWSETKitErrorReplicate_dependency_info.dat -o /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Products/Debug-iphonesimulator/JWSETKitErrorReplicate.app/JWSETKitErrorReplicate -Xlinker -add_ast_path -Xlinker /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Intermediates.noindex/JWSETKit.build/Debug-iphonesimulator/JWSETKit.build/Objects-normal/arm64/JWSETKit.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Intermediates.noindex/AnyCodable.build/Debug-iphonesimulator/AnyCodable.build/Objects-normal/arm64/AnyCodable.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Intermediates.noindex/swift-asn1.build/Debug-iphonesimulator/SwiftASN1.build/Objects-normal/arm64/SwiftASN1.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Intermediates.noindex/swift-certificates.build/Debug-iphonesimulator/X509.build/Objects-normal/arm64/X509.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Intermediates.noindex/swift-certificates.build/Debug-iphonesimulator/_CertificateInternals.build/Objects-normal/arm64/_CertificateInternals.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Intermediates.noindex/swift-crypto.build/Debug-iphonesimulator/Crypto.build/Objects-normal/arm64/Crypto.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Intermediates.noindex/swift-crypto.build/Debug-iphonesimulator/_CryptoExtras.build/Objects-normal/arm64/_CryptoExtras.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/hemantshrestha/Library/Developer/Xcode/DerivedData/JWSETKitErrorReplicate-axtzlptgdcrtxpdbrnuoqxxocwlx/Build/Intermediates.noindex/Previews/iphonesimulator/JWSETKitErrorReplicate/Intermediates.noindex/swift-crypto.build/Debug-iphonesimulator/CryptoBoringWrapper.build/Objects-normal/arm64/CryptoBoringWrapper.swiftmodule

Undefined symbols for architecture arm64:

"static CryptoSwift.CS.BigUInt.== infix(CryptoSwift.CS.BigUInt, CryptoSwift.CS.BigUInt) -> Swift.Bool", referenced from: static (extension in JWSETKit):CryptoSwift.RSA.== infix(CryptoSwift.RSA, CryptoSwift.RSA) -> Swift.Bool in JWSETKit.o static (extension in JWSETKit):CryptoSwift.RSA.== infix(CryptoSwift.RSA, CryptoSwift.RSA) -> Swift.Bool in JWSETKit.o "type metadata for CryptoSwift.CS.BigUInt", referenced from: (extension in JWSETKit):CryptoSwift.RSA.hash(into: inout Swift.Hasher) -> () in JWSETKit.o lazy protocol witness table accessor for type CryptoSwift.CS.BigUInt and conformance CryptoSwift.CS.BigUInt : Swift.Hashable in CryptoSwift in JWSETKit.o "protocol conformance descriptor for CryptoSwift.CS.BigUInt : Swift.Hashable in CryptoSwift", referenced from: lazy protocol witness table accessor for type CryptoSwift.CS.BigUInt and conformance CryptoSwift.CS.BigUInt : Swift.Hashable in CryptoSwift in JWSETKit.o "CryptoSwift.CS.BigUInt.init(Foundation.Data) -> CryptoSwift.CS.BigUInt", referenced from: static (extension in JWSETKit):CryptoSwift.RSA.create(storage: JWSETKit.JSONWebValueStorage) throws -> Self in JWSETKit.o static (extension in JWSETKit):CryptoSwift.RSA.create(storage: JWSETKit.JSONWebValueStorage) throws -> Self in JWSETKit.o static (extension in JWSETKit):CryptoSwift.RSA.create(storage: JWSETKit.JSONWebValueStorage) throws -> Self in JWSETKit.o static (extension in JWSETKit):CryptoSwift.RSA.create(storage: JWSETKit.JSONWebValueStorage) throws -> Self in JWSETKit.o static (extension in JWSETKit):CryptoSwift.RSA.create(storage: JWSETKit.JSONWebValueStorage) throws -> Self in JWSETKit.o static (extension in JWSETKit):CryptoSwift.RSA.create(storage: JWSETKit.JSONWebValueStorage) throws -> Self in JWSETKit.o static (extension in JWSETKit):CryptoSwift.RSA.create(storage: JWSETKit.JSONWebValueStorage) throws -> Self in JWSETKit.o ... "CryptoSwift.RSA.allocating_init(n: CryptoSwift.CS.BigUInt, e: CryptoSwift.CS.BigUInt, d: CryptoSwift.CS.BigUInt, p: CryptoSwift.CS.BigUInt, q: CryptoSwift.CS.BigUInt) throws -> CryptoSwift.RSA", referenced from: static (extension in JWSETKit):CryptoSwift.RSA.create(storage: JWSETKit.JSONWebValueStorage) throws -> Self in JWSETKit.o "CryptoSwift.RSA.__allocatinginit(n: CryptoSwift.CS.BigUInt, e: CryptoSwift.CS.BigUInt, d: CryptoSwift.CS.BigUInt?) -> CryptoSwift.RSA", referenced from: (extension in JWSETKit):CryptoSwift.RSA.publicKey.getter : CryptoSwift.RSA in JWSETKit.o static (extension in JWSETKit):CryptoSwift.RSA.create(storage: JWSETKit.JSONWebValueStorage) throws -> Self in JWSETKit.o "CryptoSwift.RSA.externalRepresentation() throws -> Foundation.Data", referenced from: (extension in JWSETKit):CryptoSwift.RSA.storage.getter : JWSETKit.JSONWebValueStorage in JWSETKit.o (extension in JWSETKit):CryptoSwift.RSA.storage.getter : JWSETKit.JSONWebValueStorage in JWSETKit.o "CryptoSwift.RSA.decrypt(: [Swift.UInt8], variant: CryptoSwift.RSA.RSAEncryptionVariant) throws -> [Swift.UInt8]", referenced from: (extension in JWSETKit):CryptoSwift.RSA.decrypt<A, B where A: Foundation.DataProtocol, B: JWSETKit.JSONWebAlgorithm>(: A, using: B) throws -> Foundation.Data in JWSETKit.o "CryptoSwift.RSA.encrypt(: [Swift.UInt8], variant: CryptoSwift.RSA.RSAEncryptionVariant) throws -> [Swift.UInt8]", referenced from: (extension in JWSETKit):CryptoSwift.RSA.encrypt<A, B where A: Foundation.DataProtocol, B: JWSETKit.JSONWebAlgorithm>(_: A, using: B) throws -> Foundation.Data in JWSETKit.o "CryptoSwift.RSA.allocatinginit(keySize: Swift.Int) throws -> CryptoSwift.RSA", referenced from: (extension in JWSETKit):CryptoSwift.RSA.init(algorithm: JWSETKit.JSONWebAlgorithm) throws -> CryptoSwift.RSA in JWSETKit.o "type metadata accessor for CryptoSwift.RSA", referenced from: lazy protocol witness table accessor for type CryptoSwift.RSA and conformance CryptoSwift.RSA : Swift.Hashable in JWSETKit in JWSETKit.o lazy protocol witness table accessor for type CryptoSwift.RSA and conformance CryptoSwift.RSA : JWSETKit.JSONWebEncryptingKey in JWSETKit in JWSETKit.o lazy protocol witness table accessor for type CryptoSwift.RSA and conformance CryptoSwift.RSA : JWSETKit.JSONWebKey in JWSETKit in JWSETKit.o lazy protocol witness table accessor for type CryptoSwift.RSA and conformance CryptoSwift.RSA : Swift.Decodable in JWSETKit in JWSETKit.o lazy protocol witness table accessor for type CryptoSwift.RSA and conformance CryptoSwift.RSA : Swift.Encodable in JWSETKit in JWSETKit.o lazy protocol witness table accessor for type CryptoSwift.RSA and conformance CryptoSwift.RSA : Swift.Equatable in JWSETKit in JWSETKit.o "nominal type descriptor for CryptoSwift.RSA", referenced from: protocol conformance descriptor for CryptoSwift.RSA : JWSETKit.JSONWebDecryptingKey in JWSETKit in JWSETKit.o protocol conformance descriptor for CryptoSwift.RSA : JWSETKit.JSONWebEncryptingKey in JWSETKit in JWSETKit.o protocol conformance descriptor for CryptoSwift.RSA : JWSETKit.JSONWebKey in JWSETKit in JWSETKit.o protocol conformance descriptor for CryptoSwift.RSA : Swift.Decodable in JWSETKit in JWSETKit.o protocol conformance descriptor for CryptoSwift.RSA : Swift.Encodable in JWSETKit in JWSETKit.o protocol conformance descriptor for CryptoSwift.RSA : Swift.Hashable in JWSETKit in JWSETKit.o protocol conformance descriptor for CryptoSwift.RSA : Swift.Equatable in JWSETKit in JWSETKit.o ... "CryptoSwift.Padding.remove(from: [Swift.UInt8], blockSize: Swift.Int?) -> [Swift.UInt8]", referenced from: (extension in JWSETKit):CryptoSwift.RSA.decrypt<A, B where A: Foundation.DataProtocol, B: JWSETKit.JSONWebAlgorithm>(: A, using: B) throws -> Foundation.Data in JWSETKit.o "protocol witness table for SWCompression.Deflate : SWCompression.CompressionAlgorithm in SWCompression", referenced from: JWSETKit.JSONWebCompressionAlgorithm.swCompressor.getter : SWCompression.CompressionAlgorithm.Type in JWSETKit.o "protocol witness table for SWCompression.Deflate : SWCompression.DecompressionAlgorithm in SWCompression", referenced from: JWSETKit.JSONWebCompressionAlgorithm.swDecompressor.getter : SWCompression.DecompressionAlgorithm.Type in JWSETKit.o "type metadata accessor for SWCompression.Deflate", referenced from: JWSETKit.JSONWebCompressionAlgorithm.swCompressor.getter : SWCompression.CompressionAlgorithm.Type in JWSETKit.o JWSETKit.JSONWebCompressionAlgorithm.swDecompressor.getter : SWCompression.DecompressionAlgorithm.Type in JWSETKit.o ld: symbol(s) not found for architecture arm64

I have also created a new project of swiftUI, just importing the library causes this issue: https://github.com/sthahemant1st/JWSETKitErrorReplicate

amosavian commented 1 month ago

Hi @hemantf1 , This is fixed in JESETKit 0.21.1