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

Xcode: Undefined symbols for architecture x86_64: "_JSObjectGetPrototype" #23183

Closed
tapz opened this issue Jan 28, 2019 · 24 comments
Closed

Xcode: Undefined symbols for architecture x86_64: "_JSObjectGetPrototype" #23183

tapz opened this issue Jan 28, 2019 · 24 comments
Labels
Bug Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@tapz
Copy link

tapz commented Jan 28, 2019

Environment

React Native Environment Info:
System:
OS: macOS 10.14.2
CPU: x64 Intel(R) Core(TM) i7-6567U CPU @ 3.30GHz
Memory: 476.27 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.12.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
Build Tools: 21.1.1, 21.1.2, 22.0.0, 22.0.1, 23.0.1, 23.0.2, 23.0.3, 24.0.1, 25.0.0, 25.0.2, 25.0.3, 26.0.0, 26.0.2, 27.0.3, 28.0.0, 28.0.2, 28.0.3
API Levels: 22, 24, 26, 27, 28
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5014246
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.7.0 => 16.7.0
react-native: 0.58.1 => 0.58.1
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7

MacOS 10.14.2 (18C54)
Xcode 10.1 (10B61)

Description

After upgrading from 0.57.8 to 0.58.1 started to get this error in Xcode when compiling to a simulator:

Undefined symbols for architecture x86_64:
"_JSObjectGetPrototype", referenced from:
facebook::jsc::JSCRuntime::createFunctionFromHostFunction(facebook::jsi::PropNameID const&, unsigned int, std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>)::HostFunctionMetadata::initialize(OpaqueJSContext const*, OpaqueJSValue*) in libjsi.a(JSCRuntime.o)
"_JSObjectSetPrototype", referenced from:
facebook::jsc::JSCRuntime::createFunctionFromHostFunction(facebook::jsi::PropNameID const&, unsigned int, std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>)::HostFunctionMetadata::initialize(OpaqueJSContext const*, OpaqueJSValue*) in libjsi.a(JSCRuntime.o)
"_JSPropertyNameAccumulatorAddName", referenced from:

Reproducible Demo

Just try to compile the project to a simulator.

@react-native-bot
Copy link
Collaborator

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] under Environment to let us know.

@tapz
Copy link
Author

tapz commented Jan 28, 2019

Adding JavaScriptCore.framework to the linked libraries solved the issue. This probably should be added to the release notes.

@oferRounds
Copy link

Great, did it also for me. But now I’m getting the build error (on iOS):
error: {project_path}/node_modules/react-native/ReactCommon/privatedata/PrivateDataBase.h: No such file or directory

Any idea?

@sergeyshpadyrev
Copy link

sergeyshpadyrev commented Jan 28, 2019

Great, did it also for me. But now I’m getting the build error (on iOS):
error: {project_path}/node_modules/react-native/ReactCommon/privatedata/PrivateDataBase.h: No such file or directory

Any idea?

Try to clean build folder and rebuild

@oferRounds
Copy link

Thank you, that did the trick for me!

@retyui
Copy link
Contributor

retyui commented Jan 28, 2019

@tapz

Can you tell how add JavaScriptCore.framework to the linked libraries ?!


Update:

@kelset kelset added the Platform: iOS iOS applications. label Jan 28, 2019
@kelset
Copy link
Contributor

kelset commented Jan 28, 2019

👋 folks - thanks for reporting!

Yes it seems that we should add this to the changelog 👍 Maybe right below the highlights section? https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#0580

@mikehardy
Copy link
Contributor

@retyui highly recommend visiting this project which exposes the exact changes between react-native versions in the form of easy-to-read diffs that you could even (likely) automatically apply if you wanted: https://github.com/pvinis/rn-diff-purge

@necixy
Copy link

necixy commented Jan 29, 2019

Adding JavaScriptCore.framework to the linked libraries solved the issue. This probably should be added to the release notes.

I was getting same error after updating ReactNative version, adding JavaScriptCore.framework did the trick.

@fungilation
Copy link

@kelset yes please, close to the highlights to not miss it

@hramos
Copy link
Contributor

hramos commented Jan 29, 2019

Thanks for looking into this. I'll close it given a solution has been found (projects need to add JavaScriptCore.framework during the upgrade).

@hramos hramos closed this as completed Jan 29, 2019
@SAnegondhi
Copy link

Guess what. This is not resolved. I added javascriptCore.framework and it still fails with the same error.
react-native: 0.58.3

@toblerpwn
Copy link

@IndeDude I also struggled with this problem for a while and had to clean the build folder using Xcode specifically. See my note here: #23166 (comment)

Good luck!

@jiawenbin2013
Copy link

thank you very much, that also resolve my question;

@jonathangreco
Copy link

The answer form @tapz works, but if you wanna use the Release Scheme, don't forget to also add the JavaScriptCore.framework in you Tests Target too.

@chengdh
Copy link

chengdh commented Mar 3, 2019

this answer from @tapz works, thanks a lot

@SAnegondhi
Copy link

SAnegondhi commented Apr 17, 2019 via email

@jwanga
Copy link

jwanga commented May 6, 2019

@tapz solution worked except I had to also repeat it for my test project.

@yadigarbz
Copy link

The answer form @tapz works, but if you wanna use the Release Scheme, don't forget to also add the JavaScriptCore.framework in you Tests Target too.

This is absoluetly actual solve (y)

@drwasho
Copy link

drwasho commented Jun 21, 2019

image

Adding this did the trick!

@NathanNovak
Copy link

The answer form @tapz works, but if you wanna use the Release Scheme, don't forget to also add the JavaScriptCore.framework in you Tests Target too.

Awesome this worked!

@raman-sidhu
Copy link

thanks @tapz, adding JavaScriptCore.framework to the linked libraries solved the issue for me

@hamdigatri
Copy link

The JavaScriptCore.framework is added to my linked libraries but I'am still having the issue.
I'am using React Native 0.59.10

@jogoool
Copy link

jogoool commented Jan 22, 2020

Still having the issue after adding JavaScriptCore.framework to linked libraries.
I'm using React Native 0.60.3

@facebook facebook locked as resolved and limited conversation to collaborators Jan 29, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jan 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests