Apollo-ios: Xcode 12 Beta Archive issue

Created on 8 Jul 2020  路  15Comments  路  Source: apollographql/apollo-ios

I failed to archive app with 12.0 beta 2 and I found that other libraries have similar issues.

Error message

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

Environment

Apollo version: 0.28.0
Xcode version: 12.0 beta 2 (12A6163b)
Swift version: 5.3 (swiftlang-1200.0.16.13 clang-1200.0.22.25)
Platform(s) running Apollo: iOS
macOS version running Xcode: 10.15.5

beta-xcode

Most helpful comment

@designatednerd I tried it with Xcode 12 beta 4, it solved!

All 15 comments

Weird! I'm literally testing the new beta right now, and I was just able to build and test 0.29.1 with Xcode 12 b2 without any problem. Have you cleaned your build folder and/or done the derived data dance recently?

Have you cleaned your build folder and/or done the derived data dance recently?

I've tried it but it hasn't helped...

Could you try setting the build configuration to release? It seems that the optimization level is related. Or try archive.

Can't really do archive on a framework, but can confirm this is showing up if I switch the Run action to build for release.

It looks like the issue is some kind of bug with substrings in the beta. Unfortunately because we support older versions of iOS, disabling armv7 support in the library isn't really a good option for us.

It also looks like the workaround for our library isn't as simple as Lottie's - we're not using prefix and suffix methods on String anywhere in the main Apollo lib, and I'm getting an error on compilation in release mode with a totally different file than you are (GraphQLResultNormalizer.o) that's not doing any super-obvious string manipulation.

If you have some time to dig around, I'd encourage you to. At this point I've got enough on my plate that something clearly acknowledged by Apple as a bug and which only affects release builds on a beta Xcode is not going to be something I prioritize digging into on my own. Will definitely check back in on this with subsequent beta releases though.

@designatednerd Thank you for your research. I want to wait for this bug to be fixed in a future Xcode version.

I am experiencing this issue as well, which prevented Carthage from building Apollo. I mentioned the issue in the Xcode 12 thread: https://github.com/apollographql/apollo-ios/pull/1280

I fixed the issue here: https://github.com/danl3v/apollo-ios/tree/0.29.1-xcode12 and it works fine. Feel free to cherry-pick the latest commit to another version of apollo as required. Hopefully Apple will fix its substring issue

Xcode 12 beta 3 just came out, and I am now no longer able to reproduce this by switching the run action to build for release.

@danl3v @nkmrh Can you please confirm that this is no longer an issue on the betas/xcode-12 branch for you? Thank you!

Will do early next week

@designatednerd @danl3v I confirmed the issue on the betas/xcode-12 branch with Xcode 12.0 beta 3. Unfortunately the one reproduced :(

@nkmrh Weird! Did you do Clean Build Folder before trying to archive? I double-checked that I'd done that before trying to do the run action as build for release and it still worked.

@designatednerd I checked the betas/xcode-12 branch again and the build was successful but when I add it to a simple project with cocoapods, it still fails to build... (archive is still failing)

Interesting....I'll poke at that today. Thanks!

@designatednerd I tried it with Xcode 12 beta 4, it solved!

Excellent! I'm going to close this issue out then - if anyone has issues archiving on Beta 4 or after, please open a new issue. Thank you!

Beta 4 works for us!

Was this page helpful?
0 / 5 - 0 ratings