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

0.61.5 -> 0.62.2 - Build error with watchOS #62

Closed
PaitoAnderson opened this issue Apr 20, 2020 · 18 comments
Closed

0.61.5 -> 0.62.2 - Build error with watchOS #62

PaitoAnderson opened this issue Apr 20, 2020 · 18 comments

Comments

@PaitoAnderson
Copy link

PaitoAnderson commented Apr 20, 2020

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

@PaitoAnderson PaitoAnderson changed the title Adding a watchOS App to React Native 62 Project 0.61.5 -> 0.62.2 - Build error with watchOS Apr 20, 2020
@WJimmyCook
Copy link

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
Copy link
Author

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

@iyegoroff
Copy link

iyegoroff commented May 2, 2020

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
Copy link

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
Copy link

Thank you @iyegoroff you're a legend!

@baronha
Copy link

baronha commented Jun 27, 2020

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
Copy link

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
Copy link

Menardi commented Aug 6, 2020

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
Copy link

mkausas commented Aug 26, 2020

Thank you!!!

@luatnd
Copy link

luatnd commented Oct 9, 2020

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
Copy link

Thank you so much 😭

@luatnd
Copy link

luatnd commented Oct 29, 2020

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
Copy link

@iyegoroff You saved me, thanks a lot

@hariantara
Copy link

hariantara commented Apr 29, 2021

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
Copy link

alisherk commented Jul 6, 2021

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
Copy link

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
Copy link

gbmahili commented Sep 20, 2021

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
Copy link

Ace090 commented Oct 28, 2022

@iyegoroff Jesus Christ thank you so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests