Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undefined symbol: type metadata for Swift._StringObject.Variant, Undefined symbols for architecture armv7 - Xcode 12 Beta

Tags:

ios

xcode12

I'm trying to create archive through Xcode 12.0 beta but it giving me that error.

Undefined symbols for architecture armv7:
  "type metadata for Swift._StringObject.Variant", referenced from:
      outlined init with take of Swift._StringObject.Variant in OpenGraph.Data.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Undefined symbol: type metadata for Swift._StringObject.Variant

I found this post related to that issue but it didn't solve my issue. I created archive through Xcode 11.6 beta and it didn't give me that error, but now apple sent me that email after uploading the binary.

ITMS-90111: Invalid Toolchain - Your app was built with a beta version of Xcode or SDK. Apps submitted to the App Store must be built with the GM version of Xcode 10.1 and the SDK for iOS 12.1 and watchOS 5.1, Xcode 7.1 and the SDK for tvOS 9, or Xcode 6 and the SDK for macOS 10.9 or later. If you are using an Xcode beta version to test your app, make sure you are using the latest supported version.

Can anyone please tell me that how I can resolve this issue without downloading stable version of Xcode.

like image 895
ZAFAR007 Avatar asked Jul 05 '20 08:07

ZAFAR007


People also ask

How do I fix undefined symbol in XCode?

The error Undefined symbols for architecture arm64: "_OBJC_CLASS_$_SKAdImpression" during the iOS build usually happens if XCode or CocoaPods version is lower than required. To fix it update XCode to 12.5 or higher and CocoaPods to 1.10. 0 or higher.

What is undefined symbols for architecture x86_64?

Why Is the Undefined Symbols for Architecture x86_64: Error Happening? This error is happening due to the lack of included values inside the declared statements in your code. The browser is going to render the information incorrectly and show this error, especially if you are working with Main and Similarity tools.


1 Answers

You can either explicitly cast to strings as in Yogesh's answer.

Another solution would be to set the build architecture to only arm64 (in "Architectures -> Valid Architectures"). If there are no architectures, add one for arm64.

This is a bug in Xcode 12 since the first beta. Reference: Apple dev forum.

like image 81
grebulon Avatar answered Oct 06 '22 03:10

grebulon