在发行版本中构建本机应用程序时,我得到体系结构arm64的未定义符号。我上个月在商店上部署了该应用程序,没有任何问题,现在我做了一些更改,想更新它,但是我无法构建它。
我尝试过:
-删除.rncache
-删除DerivedData
-删除构建文件夹
-删除libReact.a并再次添加
-将死代码剥离设置为否
-删除node_modules并重新安装
我遇到的其他导致设置的解决方案:
-有效架构:arm64 armv7 armv7s
-其他链接器标志:-ObjC -lc ++
也不起作用。
谁能帮助我解决这个问题?
有关该错误的更多具体信息:
Undefined symbols for architecture arm64:
"_JSClassCreate", referenced from:
void std::__1::__call_once_proxy<std::__1::tuple<facebook::jsc::JSCRuntime::createObject(std::__1::shared_ptr<facebook::jsi::HostObject>)::$_0&&> >(void*) in libReact.a(JSCRuntime.o)
void std::__1::__call_once_proxy<std::__1::tuple<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)>)::$_1&&> >(void*) in libReact.a(JSCRuntime.o)
"_JSContextGetGlobalObject", referenced from:
facebook::jsc::JSCRuntime::global() in libReact.a(JSCRuntime.o)
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 libReact.a(JSCRuntime.o)
"_JSEvaluateScript", referenced from:
facebook::jsc::JSCRuntime::evaluateJavaScript(std::__1::unique_ptr<facebook::jsi::Buffer const, std::__1::default_delete<facebook::jsi::Buffer const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libReact.a(JSCRuntime.o)
"_JSGlobalContextCreateInGroup", referenced from:
facebook::jsc::JSCRuntime::JSCRuntime() in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::JSCRuntime() in libReact.a(JSCRuntime.o)
"_JSGlobalContextRelease", referenced from:
facebook::jsc::JSCRuntime::JSCRuntime() in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::~JSCRuntime() in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::JSCRuntime() in libReact.a(JSCRuntime.o)
"_JSGlobalContextRetain", referenced from:
facebook::jsc::JSCRuntime::JSCRuntime(OpaqueJSContext*) in libReact.a(JSCRuntime.o)
"_JSObjectCallAsConstructor", referenced from:
facebook::jsc::JSCRuntime::callAsConstructor(facebook::jsi::Function const&, facebook::jsi::Value const*, unsigned long) in libReact.a(JSCRuntime.o)
"_JSObjectCallAsFunction", referenced from:
facebook::jsc::JSCRuntime::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) in libReact.a(JSCRuntime.o)
"_JSObjectCopyPropertyNames", referenced from:
facebook::jsc::JSCRuntime::getPropertyNames(facebook::jsi::Object const&) in libReact.a(JSCRuntime.o)
"_JSObjectGetPrivate", referenced from:
facebook::jsc::JSCRuntime::getHostObject(facebook::jsi::Object const&) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::getHostFunction(facebook::jsi::Function const&) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::createObject(std::__1::shared_ptr<facebook::jsi::HostObject>)::HostObjectProxy::finalize(OpaqueJSValue*) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::createObject(std::__1::shared_ptr<facebook::jsi::HostObject>)::HostObjectProxy::getProperty(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::createObject(std::__1::shared_ptr<facebook::jsi::HostObject>)::HostObjectProxy::setProperty(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const*, OpaqueJSValue const**) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::createObject(std::__1::shared_ptr<facebook::jsi::HostObject>)::HostObjectProxy::getPropertyNames(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSPropertyNameAccumulator*) in libReact.a(JSCRuntime.o)
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 libReact.a(JSCRuntime.o)
...
"_JSObjectGetProperty", referenced from:
facebook::jsc::JSCRuntime::getProperty(facebook::jsi::Object const&, facebook::jsi::String const&) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::getProperty(facebook::jsi::Object const&, facebook::jsi::PropNameID const&) in libReact.a(JSCRuntime.o)
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 libReact.a(JSCRuntime.o)
"_JSObjectGetPropertyAtIndex", referenced from:
facebook::jsc::JSCRuntime::getValueAtIndex(facebook::jsi::Array const&, unsigned long) in libReact.a(JSCRuntime.o)
"_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 libReact.a(JSCRuntime.o)
"_JSObjectHasProperty", referenced from:
facebook::jsc::JSCRuntime::hasProperty(facebook::jsi::Object const&, facebook::jsi::String const&) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::hasProperty(facebook::jsi::Object const&, facebook::jsi::PropNameID const&) in libReact.a(JSCRuntime.o)
"_JSObjectIsFunction", referenced from:
facebook::jsc::JSCRuntime::isFunction(facebook::jsi::Object const&) const in libReact.a(JSCRuntime.o)
"_JSObjectMake", referenced from:
facebook::jsc::JSCRuntime::makeObjectValue(OpaqueJSValue*) const in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::createObject(std::__1::shared_ptr<facebook::jsi::HostObject>) in libReact.a(JSCRuntime.o)
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)>) in libReact.a(JSCRuntime.o)
"_JSObjectMakeArray", referenced from:
facebook::jsc::JSCRuntime::createArray(unsigned long) in libReact.a(JSCRuntime.o)
"_JSObjectSetPrivate", referenced from:
facebook::jsc::JSCRuntime::createObject(std::__1::shared_ptr<facebook::jsi::HostObject>)::HostObjectProxy::finalize(OpaqueJSValue*) in libReact.a(JSCRuntime.o)
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::finalize(OpaqueJSValue*) in libReact.a(JSCRuntime.o)
"_JSObjectSetProperty", referenced from:
facebook::jsc::JSCRuntime::setPropertyValue(facebook::jsi::Object&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::setPropertyValue(facebook::jsi::Object&, facebook::jsi::String const&, facebook::jsi::Value const&) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::createArray(unsigned long) in libReact.a(JSCRuntime.o)
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 libReact.a(JSCRuntime.o)
"_JSObjectSetPropertyAtIndex", referenced from:
facebook::jsc::JSCRuntime::setValueAtIndexImpl(facebook::jsi::Array&, unsigned long, facebook::jsi::Value const&) in libReact.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 libReact.a(JSCRuntime.o)
"_JSPropertyNameAccumulatorAddName", referenced from:
facebook::jsc::JSCRuntime::createObject(std::__1::shared_ptr<facebook::jsi::HostObject>)::HostObjectProxy::getPropertyNames(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSPropertyNameAccumulator*) in libReact.a(JSCRuntime.o)
"_JSPropertyNameArrayGetCount", referenced from:
facebook::jsc::JSCRuntime::getPropertyNames(facebook::jsi::Object const&) in libReact.a(JSCRuntime.o)
"_JSPropertyNameArrayGetNameAtIndex", referenced from:
facebook::jsc::JSCRuntime::getPropertyNames(facebook::jsi::Object const&) in libReact.a(JSCRuntime.o)
"_JSPropertyNameArrayRelease", referenced from:
facebook::jsc::JSCRuntime::getPropertyNames(facebook::jsi::Object const&) in libReact.a(JSCRuntime.o)
"_JSStringCreateWithUTF8CString", referenced from:
facebook::jsc::JSCRuntime::evaluateJavaScript(std::__1::unique_ptr<facebook::jsi::Buffer const, std::__1::default_delete<facebook::jsi::Buffer const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::makeStringValue(OpaqueJSString*) const in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::createPropNameIDFromAscii(char const*, unsigned long) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::createPropNameIDFromUtf8(unsigned char const*, unsigned long) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::createStringFromUtf8(unsigned char const*, unsigned long) in libReact.a(JSCRuntime.o)
facebook::jsc::(anonymous namespace)::getLengthString() in libReact.a(JSCRuntime.o)
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 libReact.a(JSCRuntime.o)
...
"_JSStringGetMaximumUTF8CStringSize", referenced from:
facebook::jsc::(anonymous namespace)::JSStringToSTLString(OpaqueJSString*) in libReact.a(JSCRuntime.o)
"_JSStringGetUTF8CString", referenced from:
facebook::jsc::(anonymous namespace)::JSStringToSTLString(OpaqueJSString*) in libReact.a(JSCRuntime.o)
"_JSStringIsEqual", referenced from:
facebook::jsc::JSCRuntime::compare(facebook::jsi::PropNameID const&, facebook::jsi::PropNameID const&) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::strictEquals(facebook::jsi::String const&, facebook::jsi::String const&) const in libReact.a(JSCRuntime.o)
"_JSStringRelease", referenced from:
facebook::jsc::JSCRuntime::evaluateJavaScript(std::__1::unique_ptr<facebook::jsi::Buffer const, std::__1::default_delete<facebook::jsi::Buffer const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::JSCStringValue::invalidate() in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::createPropNameIDFromAscii(char const*, unsigned long) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::createPropNameIDFromUtf8(unsigned char const*, unsigned long) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::createValue(OpaqueJSValue const*) const in libReact.a(JSCRuntime.o)
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 libReact.a(JSCRuntime.o)
"_JSStringRetain", referenced from:
facebook::jsc::JSCRuntime::JSCStringValue::JSCStringValue(OpaqueJSString*, std::__1::atomic<long>&) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::JSCStringValue::JSCStringValue(OpaqueJSString*, std::__1::atomic<long>&) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::makeStringValue(OpaqueJSString*) const in libReact.a(JSCRuntime.o)
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)>) in libReact.a(JSCRuntime.o)
"_JSValueIsArray", referenced from:
facebook::jsc::JSCRuntime::isArray(facebook::jsi::Object const&) const in libReact.a(JSCRuntime.o)
"_JSValueIsBoolean", referenced from:
facebook::jsc::JSCRuntime::createValue(OpaqueJSValue const*) const in libReact.a(JSCRuntime.o)
"_JSValueIsInstanceOfConstructor", referenced from:
facebook::jsc::JSCRuntime::instanceOf(facebook::jsi::Object const&, facebook::jsi::Function const&) in libReact.a(JSCRuntime.o)
"_JSValueIsNull", referenced from:
facebook::jsc::JSCRuntime::createValue(OpaqueJSValue const*) const in libReact.a(JSCRuntime.o)
"_JSValueIsNumber", referenced from:
facebook::jsc::JSCRuntime::createValue(OpaqueJSValue const*) const in libReact.a(JSCRuntime.o)
"_JSValueIsObject", referenced from:
facebook::jsc::JSCRuntime::createValue(OpaqueJSValue const*) const in libReact.a(JSCRuntime.o)
"_JSValueIsObjectOfClass", referenced from:
facebook::jsc::JSCRuntime::isHostObject(facebook::jsi::Object const&) const in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::isHostFunction(facebook::jsi::Function const&) const in libReact.a(JSCRuntime.o)
"_JSValueIsString", referenced from:
facebook::jsc::JSCRuntime::createValue(OpaqueJSValue const*) const in libReact.a(JSCRuntime.o)
"_JSValueIsUndefined", referenced from:
facebook::jsc::JSCRuntime::createValue(OpaqueJSValue const*) const in libReact.a(JSCRuntime.o)
"_JSValueMakeBoolean", referenced from:
facebook::jsc::JSCRuntime::valueRef(facebook::jsi::Value const&) in libReact.a(JSCRuntime.o)
"_JSValueMakeNull", referenced from:
facebook::jsc::JSCRuntime::valueRef(facebook::jsi::Value const&) in libReact.a(JSCRuntime.o)
"_JSValueMakeNumber", referenced from:
facebook::jsc::JSCRuntime::valueRef(facebook::jsi::Value const&) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::createArray(unsigned long) in libReact.a(JSCRuntime.o)
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 libReact.a(JSCRuntime.o)
"_JSValueMakeString", referenced from:
facebook::jsc::JSCRuntime::valueRef(facebook::jsi::Value const&) in libReact.a(JSCRuntime.o)
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 libReact.a(JSCRuntime.o)
"_JSValueMakeUndefined", referenced from:
facebook::jsc::JSCRuntime::valueRef(facebook::jsi::Value const&) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::createObject(std::__1::shared_ptr<facebook::jsi::HostObject>)::HostObjectProxy::getProperty(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**) in libReact.a(JSCRuntime.o)
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::call(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) in libReact.a(JSCRuntime.o)
"_JSValueProtect", referenced from:
facebook::jsc::JSCRuntime::JSCObjectValue::JSCObjectValue(OpaqueJSContext*, std::__1::atomic<bool> const&, OpaqueJSValue*, std::__1::atomic<long>&) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::JSCObjectValue::JSCObjectValue(OpaqueJSContext*, std::__1::atomic<bool> const&, OpaqueJSValue*, std::__1::atomic<long>&) in libReact.a(JSCRuntime.o)
facebook::jsc::JSCRuntime::makeObjectValue(OpaqueJSValue*) const in libReact.a(JSCRuntime.o)
"_JSValueToBoolean", referenced from:
facebook::jsc::JSCRuntime::createValue(OpaqueJSValue const*) const in libReact.a(JSCRuntime.o)
"_JSValueToNumber", referenced from:
facebook::jsc::JSCRuntime::createValue(OpaqueJSValue const*) const in libReact.a(JSCRuntime.o)
"_JSValueToObject", referenced from:
facebook::jsc::JSCRuntime::createValue(OpaqueJSValue const*) const in libReact.a(JSCRuntime.o)
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 libReact.a(JSCRuntime.o)
"_JSValueToStringCopy", referenced from:
facebook::jsc::JSCRuntime::createValue(OpaqueJSValue const*) const in libReact.a(JSCRuntime.o)
"_JSValueUnprotect", referenced from:
facebook::jsc::JSCRuntime::JSCObjectValue::invalidate() in libReact.a(JSCRuntime.o)
"_kJSClassDefinitionEmpty", referenced from:
void std::__1::__call_once_proxy<std::__1::tuple<facebook::jsc::JSCRuntime::createObject(std::__1::shared_ptr<facebook::jsi::HostObject>)::$_0&&> >(void*) in libReact.a(JSCRuntime.o)
void std::__1::__call_once_proxy<std::__1::tuple<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)>)::$_1&&> >(void*) in libReact.a(JSCRuntime.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
答案 0 :(得分:93)
确保将JavaScriptCore.framework添加到“使用库链接二进制文件”
答案 1 :(得分:0)
当我编译发行版以“ Test”为目标时,我发现了类似的问题。 (编译为调试版本时不会遇到)
Undefined symbols for architecture arm64:
"_RCTSetLogFunction", referenced from:
-[citieswegoTests testRendersWelcomeScreen] in citieswegoTests.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我尝试从目标“测试”中的“有效体系结构”中删除选项“ arm64&arm7”,问题已解决。希望有帮助。
SDKs: iOS SDK: Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3 IDEs: Xcode: 10.3/10G8 - /usr/bin/xcodebuild npmPackages: react: 16.8.6 => 16.8.6 react-native: 0.60.5 => 0.60.5 npmGlobalPackages: react-native-cli: 2.0.1 react-native-git-upgrade: 0.2.7 react-native-macos-cli: 2.0.1