React-native: YogaKit in OneSignalNotificationServiceExtension

Created on 31 Mar 2020  Â·  13Comments  Â·  Source: facebook/react-native

react-native info

System:
OS: macOS 10.15.1
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 93.24 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node
Yarn: 1.22.0 - ~/.yarn/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v10.16.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 21, 23, 26, 27, 28, 29
Build Tools: 26.0.2, 26.0.3, 27.0.3, 28.0.3
System Images: android-27 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5791312
Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
Languages:
Python: 2.7.16 - /usr/local/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: ^16.9.0 => 16.13.1
react-native: ^0.61.5 => 0.62.0
npmGlobalPackages:
react-native: Not Found

----- Error on Xcode after build on OneSignalNotificationServiceExtension

ld: warning: Could not find or use auto-linked library 'swiftCoreFoundation'
ld: warning: Could not find or use auto-linked library 'swiftCompatibility50'
ld: warning: Could not find or use auto-linked library 'swiftObjectiveC'
ld: warning: Could not find or use auto-linked library 'swiftQuartzCore'
ld: warning: Could not find or use auto-linked library 'swiftCore'
ld: warning: Could not find or use auto-linked library 'swiftCoreGraphics'
ld: warning: Could not find or use auto-linked library 'swiftUIKit'
ld: warning: Could not find or use auto-linked library 'swiftDarwin'
ld: warning: Could not find or use auto-linked library 'swiftMetal'
ld: warning: Could not find or use auto-linked library 'swiftCoreImage'
ld: warning: Could not find or use auto-linked library 'swiftCompatibilityDynamicReplacements'
ld: warning: Could not find or use auto-linked library 'swiftFoundation'
ld: warning: Could not find or use auto-linked library 'swiftDispatch'
Undefined symbols for architecture x86_64:
"protocol descriptor for Swift.ExpressibleByFloatLiteral", referenced from:
protocol conformance descriptor for __C.YGValue : Swift.ExpressibleByFloatLiteral in YogaKit in libYogaKit.a(YGLayoutExtensions.o)
"associated conformance descriptor for Swift.ExpressibleByFloatLiteral.FloatLiteralType: Swift._ExpressibleByBuiltinFloatLiteral", referenced from:
protocol conformance descriptor for __C.YGValue : Swift.ExpressibleByFloatLiteral in YogaKit in libYogaKit.a(YGLayoutExtensions.o)
"associated type descriptor for FloatLiteralType", referenced from:
protocol conformance descriptor for __C.YGValue : Swift.ExpressibleByFloatLiteral in YogaKit in libYogaKit.a(YGLayoutExtensions.o)
"associated conformance descriptor for Swift.ExpressibleByIntegerLiteral.IntegerLiteralType: Swift._ExpressibleByBuiltinIntegerLiteral", referenced from:
protocol conformance descriptor for __C.YGValue : Swift.ExpressibleByIntegerLiteral in YogaKit in libYogaKit.a(YGLayoutExtensions.o)
"method descriptor for Swift.ExpressibleByFloatLiteral.init(floatLiteral: A.FloatLiteralType) -> A", referenced from:
protocol conformance descriptor for __C.YGValue : Swift.ExpressibleByFloatLiteral in YogaKit in libYogaKit.a(YGLayoutExtensions.o)
"_OBJC_CLASS_$_RCTOneSignalExtensionService", referenced from:
objc-class-ref in NotificationService.o
"protocol descriptor for Swift.ExpressibleByIntegerLiteral", referenced from:
protocol conformance descriptor for __C.YGValue : Swift.ExpressibleByIntegerLiteral in YogaKit in libYogaKit.a(YGLayoutExtensions.o)
"associated type descriptor for IntegerLiteralType", referenced from:
protocol conformance descriptor for __C.YGValue : Swift.ExpressibleByIntegerLiteral in YogaKit in libYogaKit.a(YGLayoutExtensions.o)
"method descriptor for Swift.ExpressibleByIntegerLiteral.init(integerLiteral: A.IntegerLiteralType) -> A", referenced from:
protocol conformance descriptor for __C.YGValue : Swift.ExpressibleByIntegerLiteral in YogaKit in libYogaKit.a(YGLayoutExtensions.o)
"value witness table for Builtin.Int32", referenced from:
full type metadata for __C.YGUnit in libYogaKit.a(YGLayoutExtensions.o)
"__swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements", referenced from:
__swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_YogaKit in libYogaKit.a(YGLayoutExtensions.o)
(maybe you meant: __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_YogaKit)
"protocol witness table for Swift.Float : Swift._ExpressibleByBuiltinFloatLiteral in Swift", referenced from:
associated type witness table accessor for FloatLiteralType : Swift._ExpressibleByBuiltinFloatLiteral in __C.YGValue : Swift.ExpressibleByFloatLiteral in YogaKit in libYogaKit.a(YGLayoutExtensions.o)
"__swift_FORCE_LOAD_$_swiftCompatibility50", referenced from:
__swift_FORCE_LOAD_$_swiftCompatibility50_$_YogaKit in libYogaKit.a(YGLayoutExtensions.o)
(maybe you meant: __swift_FORCE_LOAD_$_swiftCompatibility50_$_YogaKit)
"_swift_getForeignTypeMetadata", referenced from:
merged type metadata accessor for __C.YGValue in libYogaKit.a(YGLayoutExtensions.o)
"protocol witness table for Swift.Int : Swift._ExpressibleByBuiltinIntegerLiteral in Swift", referenced from:
associated type witness table accessor for IntegerLiteralType : Swift._ExpressibleByBuiltinIntegerLiteral in __C.YGValue : Swift.ExpressibleByIntegerLiteral in YogaKit in libYogaKit.a(YGLayoutExtensions.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Author Feedback Environment Info

Most helpful comment

@jeffy7 Yeah:
1) Right-click on your app name in Xcode
2) Choose Swift file
3) Make sure that your app name specified in the target
4) Press create bridge
5) Clean and rebuild

All 13 comments

:warning: Missing Environment Information
:information_source: Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.

I am experiencing the same issue while upgrading ios from 0.61.5 to 0.62.2; will come back after finding a solution (it might have something with editing the pbxproj file wrong)

@omarDtp @pastean you may want to check this out - https://github.com/react-native-community/upgrade-support/issues/13

Same issue for me (0.61.5 -> 0.62.2)

Same issue for me (0.61.5 -> 0.62.2)

Same issue for me,0.62.2.did you re solve it?

@jeffy7 Yeah:
1) Right-click on your app name in Xcode
2) Choose Swift file
3) Make sure that your app name specified in the target
4) Press create bridge
5) Clean and rebuild

@jeffy7 Yeah:

  1. Right-click on your app name in Xcode
  2. Choose Swift file
  3. Make sure that your app name specified in the target
  4. Press create bridge
  5. Clean and rebuild

thx,it works。

Sorry to be dumb but I normally build using react native (yarn ios)
I am in xcode now and getting the same build errors but I don't understand the instructions to fix. I must be in the wrong headspace because every step seems unclear or wrong (and I'm sure it's not). Could you elaborate a little more?
1) Where do I right click on the app name? No r-c menus I see mention swift
I can't progress to the other steps without understanding this!

EDIT: For anybody else struggling like me, this is fully explained in https://github.com/react-native-community/upgrade-support/issues/13
The above description is fine, just a bit too much of a shortcut for me!

Same issue upgrading to 0.63.2 - but with other libraries involved

The upgrade notes, aldo looking great, did not solve the issue for me (don't really know which version I was upgrading)

Undefined symbols for architecture x86_64: "_swift_getFunctionReplacement", referenced from: _swift_getFunctionReplacement50 in libswiftCompatibilityDynamicReplacements.a(DynamicReplaceable.cpp.o) (maybe you meant: _swift_getFunctionReplacement50) "_swift_getOrigOfReplaceable", referenced from: _swift_getOrigOfReplaceable50 in libswiftCompatibilityDynamicReplacements.a(DynamicReplaceable.cpp.o) (maybe you meant: _swift_getOrigOfReplaceable50) ld: symbol(s) not found for architecture x86_64

It´s working for me: https://blog.cpming.top/p/react-native-0-62-undefined-symbol

All errors was solved, except the "linker command failed with exit code 1 (use -v to see invocation)"

@patrickbattisti not the same issue, but your link helped me with a previous article:

https://blog.cpming.top/p/undefined-symbol-swift-getfunctionreplacement

bullseye.

Aldo I felt in the same issue as yours:

"linker command failed with exit code 1 (use -v to see invocation)"

with a message above I believe it's relevant, that says:

ld: library not found for -lYogaKit

this one I'm getting no clue.

That article from cpming helped a lot, but I had to change swift-5 to swift 4.2 to create the build before upgrading to swift-5

It´s working for me: https://blog.cpming.top/p/react-native-0-62-undefined-symbol

All errors was solved, except the "linker command failed with exit code 1 (use -v to see invocation)"

Thanks for the resource! Closing, feel free to open another issue if it comes up again

Was this page helpful?
0 / 5 - 0 ratings