Skip to content

Commit

Permalink
ios: Fix a build failure with Xcode 13
Browse files Browse the repository at this point in the history
Done with Xcode Version 13.0 (13A233).

I got two errors while trying to build:

  Undefined symbol: __swift_FORCE_LOAD_$_swiftDataDetection
  Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider

The root cause is reportedly [1] a bug in Xcode. The line with
`swift-5.0` in LIBRARY_SEARCH_PATHS, removed in this commit, leads
to a "Mach-O universal binary" that mistakenly omits the arm64
architecture, which reportedly causes this compilation failure.

facebook/react-native@a1c445a39, as yet unreleased, removes that
line from LIBRARY_SEARCH_PATHS in the template app. [2]

The other interesting line in LIBRARY_SEARCH_PATHS, the one with
just `swift`, doesn't have that bug.

But we go ahead and remove all of LIBRARY_SEARCH_PATHS, just because
that commit says it wants to.

They say they don't do that because it's supposedly not possible
without also upgrading to CocoaPods v1.11, which has
CocoaPods/CocoaPods@6985cbf7d. While RN figures out whether they can
or should require a minimum CocoaPods version, I notice that we seem
to have no trouble upgrading CocoaPods ourselves, so we might as
well.

[1] facebook/react-native#31480

[2] It also (with facebook/react-native@51bf55794) marks a
    `react-native` script named
    __apply_Xcode_12_5_M1_post_install_workaround, from
    facebook/react-native@ac4ddec54, as no longer needed. IOW, you
    don't have to call it from your Podfile anymore. But
    facebook/react-native@ac4ddec54 is also unreleased, so we've
    never had to worry about calling that script from our Podfile.
  • Loading branch information
chrisbobbe committed Oct 1, 2021
1 parent c9d5fdc commit 80a8621
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -705,4 +705,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: d654ed98ab31318f9ce195dc15a1148e60c2d4e9

COCOAPODS: 1.10.1
COCOAPODS: 1.11.2
10 changes: 0 additions & 10 deletions ios/ZulipMobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,6 @@
/usr/lib/swift,
"$(inherited)",
);
LIBRARY_SEARCH_PATHS = (
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
"\"$(inherited)\"",
);
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.zulip.ZulipMobile;
Expand Down Expand Up @@ -544,11 +539,6 @@
/usr/lib/swift,
"$(inherited)",
);
LIBRARY_SEARCH_PATHS = (
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
"\"$(inherited)\"",
);
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = org.zulip.ZulipMobile;
SDKROOT = iphoneos;
Expand Down

0 comments on commit 80a8621

Please sign in to comment.