Xcode 12 ~ A TSC Love Story


Development toolchains can always take teams on wild rides when major versions get released by third party vendors or transient dependencies. Xcode is one of those that affects a large community of developers well beyond NativeScript. When your development tools start complaining about hieroglyphic architectures and fail to build, it is natural to feel a wide array of emotions ranging from the first glimpse you got of Sloth in the Goonies, to perhaps the theater scene in the Gremlins to even the thought an Alien is embedded in your body.

If those scenes don't make you shudder perhaps these console outputs do?

Linker command failed?! 😱

/project/path/platforms/ios/internal/NativeScript.framework/NativeScript' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **

Linking arm64 for iOS Simulator?? 😱

ld: in /project/path/Pods/mopub-ios-sdk/MoPubSDK/Viewability/MOAT/MPUBMoatMobileAppKit.framework/MPUBMoatMobileAppKit(MPUBMoatAnalytics.o),
building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

The build failed?! Code 65? What's that? 😱

Error: Command xcodebuild failed with exit code 65

The TSC is here for you

NativeScript is driven by a Technical Steering Committee (TSC) that, like you, depends on these tools for mission critical production scenarios. Every single member of the TSC uses these tools everyday, multiple times a day, if not 24/7 everyday (lookin' at you insomniacs out there! Health Note: please sleep.). We are a group of driven, highly skilled and compassionate human beings that care deeply about this toolchain as well as community members like you.

One thing that is really nice about a toolchain like NativeScript is that the runtimes are a pure celebration of the host platform in which they are run. It doesn't seek or desire to recreate the platform but rather gives you that platform at your fingertips through the language you love, JavaScript. This means that the core maintenance of the framework resolves down to the tools it relies on like Xcode.

Xcode 12 landed on September 16, 2020. Several beta's were distributed through the summer where the TSC had validated several toolsets. Close to the ending beta and final release some of the architecture changes were tracked.

From the final Xcode 12 Release Notes:

The Build Settings editor no longer includes the Valid Architectures build setting (VALID_ARCHS), and its use is discouraged. Instead, there is a new Excluded Architectures build setting (EXCLUDED_ARCHS). If a project includes VALID_ARCHS, the setting is displayed in the User-Defined section of the Build Settings editor. (15145028)

This was the key changeup which affected the toolchain and affected development communities far and wide.

The TSC identified and collected community reports to ensure the issue was resolved from multiple angles and diverse situations. We greatly thank the entire empassioned community for this feedback. It undoubtedly helped us resolve this in about 2 weeks.

Update versions

The fixes work on NativeScript 6 as well as NativeScript 7 projects.

  1. Install the latest cli (v7.0.10):

    npm i -g nativescript
    
  2. Update the ios runtime in devDependencies when using {N} 7, or update the nativescript key in your package.json when using {N} 6:

    • If you're using @nativescript/ios (the new v8) runtime you'll want to update your project to use: @nativescript/ios@7.0.1
    • If you're using tns-ios (the JavaScriptCore) runtime you'll want to update your project to use: tns-ios@6.5.3
  3. ns clean - if using {N} 7, otherwise manually delete node_modules, platforms, hooks and package-lock.json.

  4. Run and prosper!

Cheers 🍻

Comments


Comments are disabled in preview mode.
NativeScript is licensed under the Apache 2.0 license
© 2020 All Rights Reserved.