Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 12 Beta Archive issue #1300

Closed
nkmrh opened this issue Jul 8, 2020 · 15 comments
Closed

Xcode 12 Beta Archive issue #1300

nkmrh opened this issue Jul 8, 2020 · 15 comments
Labels
beta-xcode Issues occurring on a beta version of Xcode

Comments

@nkmrh
Copy link

nkmrh commented Jul 8, 2020

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

@designatednerd
Copy link
Contributor

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?

@designatednerd designatednerd added the beta-xcode Issues occurring on a beta version of Xcode label Jul 8, 2020
@nkmrh
Copy link
Author

nkmrh commented Jul 8, 2020

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.

@designatednerd
Copy link
Contributor

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.

@OmarJalil
Copy link

@nkmrh
Copy link
Author

nkmrh commented Jul 9, 2020

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

@danl3v
Copy link

danl3v commented Jul 22, 2020

I am experiencing this issue as well, which prevented Carthage from building Apollo. I mentioned the issue in the Xcode 12 thread: #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

@designatednerd
Copy link
Contributor

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!

@danl3v
Copy link

danl3v commented Jul 22, 2020

Will do early next week

@nkmrh
Copy link
Author

nkmrh commented Jul 23, 2020

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

@designatednerd
Copy link
Contributor

@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.

@nkmrh
Copy link
Author

nkmrh commented Jul 24, 2020

@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)

@designatednerd
Copy link
Contributor

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

@nkmrh
Copy link
Author

nkmrh commented Aug 5, 2020

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

@designatednerd
Copy link
Contributor

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!

@danl3v
Copy link

danl3v commented Aug 6, 2020

Beta 4 works for us!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-xcode Issues occurring on a beta version of Xcode
Projects
None yet
Development

No branches or pull requests

4 participants