7

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.

ZAFAR007
  • 3,049
  • 1
  • 34
  • 45
  • 2
    It is a bug in the Xcode Beta, temporary workaround is to remove the armv7 slice, more details are here - https://developer.apple.com/forums/thread/649918 – Manav Jul 23 '20 at 09:46

4 Answers4

1

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.

grebulon
  • 7,697
  • 5
  • 42
  • 66
  • `Valid Architectures` build setting no longer exists in Xcode 12 beta https://stackoverflow.com/a/63259096/6791677. `Excluded Architectures` needs to be changed. – gcharita Sep 01 '20 at 11:03
0

I am facing the same issue in my project, I resolved by just replace below the line,

If you are using prefix or suffix method of String, You just cast result into String

// Issue code
let pre = self.prefix(0) //self is String object
let suff = self.suffix(4) //self is String object

//Replace with below changes 
let pre = String(self.prefix(0))
let suff = String(self.suffix(4))
Yogesh Makwana
  • 448
  • 4
  • 16
0

I had four Undefined symbols errors causing my app to not compile but they were because I'm new to using Xcode to import content from Github. (I usually use Cocoapods)

After importing the framework https://github.com/CoreOffice/CoreXLSX via Xcode by going to Select project file > General> Frameworks, Libraries, and Embedded Content > Add Package Dependency > and pasting the Github URL...

It imported properly, but gave me the Undefined symbol errors when I tried to build. The errors were resolved when I clicked on my Xcode Target and then manually added the Package there too.

add framework manually too

Dave Levy
  • 1,036
  • 13
  • 20
-2

do Product -> Clean Builder Folder it will be fixed.