react-native-community / upgrade-support

A central community-backed place to request and give help when upgrading your app.
MIT License
256 stars 2 forks source link

0.61.5 -> 0.62.2 - Build error with watchOS #62

Closed PaitoAnderson closed 4 years ago

PaitoAnderson commented 4 years ago

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
WJimmyCook commented 4 years ago

Did you ever figure this out? I'm running into the same error trying to add a Watch App to my RN 62.2 app.

PaitoAnderson commented 4 years ago

@WJimmyCook I did not, no rush for me to update atm.

iyegoroff commented 4 years ago

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.

mtford90 commented 4 years ago

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.

WJimmyCook commented 4 years ago

Thank you @iyegoroff you're a legend!

baronha commented 4 years ago

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.

You're my legend

chadhobson commented 4 years ago

Absolute beast... leaving this error below so Google can help the next guy not waste a day and a half of his life.

swift_getTypeByMangledNameInContextInMetadataState

Menardi commented 4 years ago

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
mkausas commented 4 years ago

Thank you!!!

luatnd commented 4 years ago

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 built new appclips got the same error and that did the trick for me

m4rcoperuano commented 4 years ago

Thank you so much 😭

luatnd commented 4 years ago

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 built new appclips got the same error and that did the trick for me

I built a new widget extension and got the same error, all new Xcode template conflict with react-native

ramisalem commented 3 years ago

@iyegoroff You saved me, thanks a lot

hariantara commented 3 years ago

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

alisherk commented 3 years ago

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?

muhammadashfaq commented 3 years ago

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

gbmahili commented 3 years ago

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.

Ace090 commented 2 years ago

@iyegoroff Jesus Christ thank you so much