upgrade-support: 0.61.5 -> 0.62.2 - Build error with watchOS

Environment

System:
    OS: macOS 10.15.4
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 2.02 GB / 32.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.7.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
  IDEs:
    Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
  npmPackages:
    react: 16.11.0 => 16.11.0
    react-native: 0.62.2 => 0.62.2
  npmGlobalPackages:
    react-native-create-library: 3.1.2

Upgrading version

0.61.5 -> 0.62.2

Description

Error building watchOS app after upgrading from React Native 61.5:

Undefined symbols for architecture i386:
  "_swift_getOpaqueTypeConformance", referenced from:
      associated type witness table accessor for SwiftUI.View.Body : SwiftUI.View in AwesomeProject_Watch_Extension.ContentView : SwiftUI.View in AwesomeProject_Watch_Extension in ContentView.o
      associated type witness table accessor for SwiftUI.PreviewProvider.Previews : SwiftUI.View in AwesomeProject_Watch_Extension.ContentView_Previews : SwiftUI.PreviewProvider in AwesomeProject_Watch_Extension in ContentView.o
      associated type witness table accessor for SwiftUI.View.Body : SwiftUI.View in AwesomeProject_Watch_Extension.NotificationView : SwiftUI.View in AwesomeProject_Watch_Extension in NotificationView.o
      associated type witness table accessor for SwiftUI.PreviewProvider.Previews : SwiftUI.View in AwesomeProject_Watch_Extension.NotificationView_Previews : SwiftUI.PreviewProvider in AwesomeProject_Watch_Extension in NotificationView.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Reproducible demo

npx react-native init AwesomeProject

Add Watch App for iOS App Target Screen Shot 2020-04-20 at 10 06 20 AM

Accept Defaults Screen Shot 2020-04-20 at 10 06 40 AM

Error building AwesomeProject for iPhone 11 Simulator Screen Shot 2020-04-20 at 10 07 21 AM

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 18

Most upvoted comments

I fixed similar error in my iOS app by removing "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", line from LIBRARY_SEARCH_PATHS in project.pbxproj file.

I ran in to a similar issue when trying to create a home screen widget in Xcode 12 for iOS 14. The fix mentioned above didn’t work for me, but it set me on the right path. I’m posting my fix here in case others may find it useful!

For me, there were two steps to fixing this issue:

  1. Removed all entries from LIBRARY_SEARCH_PATHS in the Project configuration
  2. Add a new Swift file to the project (File > New > File > Swift), and call it whatever you want

I fixed similar error in my iOS app by removing "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", line from LIBRARY_SEARCH_PATHS in project.pbxproj file.

Thanks @iyegoroff - this did the trick for me.

I had to delete this from both the watchapp & watchapp extension targets.

Thank you @iyegoroff you’re a legend!

I fixed similar error in my iOS app by removing "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", line from LIBRARY_SEARCH_PATHS in project.pbxproj file.

This seems to only fix the issue while in Debug scheme. Once I try to build the app in the Release scheme, I still get the same error. This happened to me when I added the @stripe/stripe-react-native package. Anyone else got that issue in Release, please advise. Thanks in advance.

I fixed similar error in my iOS app by removing "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", line from LIBRARY_SEARCH_PATHS in project.pbxproj file.

Thanks @iyegoroff - this did the trick for me. I had to delete this from both the watchapp & watchapp extension targets.

that is on “Debug” or “Release” because on Library Search Paths has two drop down ? I am not seem those line available , could you give the more detail about it ? I face the issue on RN 0.64

Same here. Can someone provide more information?

Same here