Sport
Sport

Reputation: 8945

react-native code push getting error in ios ,using pod

I am using code push in react native app but getting error at compile time ,

pod version in project

# React Native requirements
pod 'React', :path => '../node_modules/react-native', :subspecs => [
   'Core',
   'CxxBridge', # Include this for RN >= 0.47
   'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
   'RCTText',
   'RCTNetwork',
   'RCTWebSocket', # Needed for debugging
   'RCTAnimation', # Needed for FlatList and animations running on native UI thread
   # Add any other subspecs you want to use in your project
]
# Explicitly include Yoga if you are using RN >= 0.42.0
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

and package.json

"react-native-code-push": "^5.7.0",
 "react": "16.8.3",
"react-native": "0.59.8",

error I am getting

 [![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 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)
      "_JSObjectCopyPropertyNames", referenced from:
          facebook::jsc::JSCRuntime::getPropertyNames(facebook::jsi::Object const&) 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)
      "_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)
      "_JSValueIsNumber", referenced from:
          facebook::jsc::JSCRuntime::createValue(OpaqueJSValue const*) const in libReact.a(JSCRuntime.o)
      "_JSClassCreate", referenced from:
          facebook::jsc::JSCRuntime::createObject(std::__1::shared_ptr<facebook::jsi::HostObject>)::$_0::operator()() 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)>)::$_1::operator()() const in libReact.a(JSCRuntime.o)
      "_JSObjectGetPropertyAtIndex", referenced from:
          facebook::jsc::JSCRuntime::getValueAtIndex(facebook::jsi::Array const&, unsigned long) in libReact.a(JSCRuntime.o)
      "_JSObjectMakeArray", referenced from:
          facebook::jsc::JSCRuntime::createArray(unsigned long) 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)
      "_JSValueIsUndefined", referenced from:
          facebook::jsc::JSCRuntime::createValue(OpaqueJSValue const*) const 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)
      "_JSValueMakeUndefined", referenced from:
          facebook::jsc::JSCRuntime::valueRef(facebook::jsi::Value const&) in libReact.a(JSCRuntime.o)][1]][1]

enter image description here

Upvotes: 0

Views: 1341

Answers (2)

Murilo Paix&#227;o
Murilo Paix&#227;o

Reputation: 646

Changing the version of SSZipArchive from 2.1.x to 2.2.x on CodePush.podspec worked for me.

And to keep track of this change on my project I used patch-package:

  1. Open node_modules/react-native-code-push/CodePush.podspec and change the version of SSZipArchive from ~> 2.1 to ~> 2.2:
s.dependency 'SSZipArchive', '~> 2.2' # Like this
  1. Generate a patch:
$ yarn patch-package react-native-code-push

The patch file should look like this:

diff --git a/node_modules/react-native-code-push/CodePush.podspec b/node_modules/react-native-code-push/CodePush.podspec
index dca6e84..0b8928d 100644
--- a/node_modules/react-native-code-push/CodePush.podspec
+++ b/node_modules/react-native-code-push/CodePush.podspec
@@ -21,7 +21,7 @@ Pod::Spec.new do |s|
   # we explicitly let CocoaPods pull in the versions below so all dependencies are resolved and 
   # linked properly at a parent workspace level.
   s.dependency 'React'
-  s.dependency 'SSZipArchive', '~> 2.1'
+  s.dependency 'SSZipArchive', '~> 2.2'
   s.dependency 'JWT', '~> 3.0.0-beta.7'
   s.dependency 'Base64', '~> 1.1'
 end
  1. Commit the patch:
$ git add patches/react-native-code-push+5.7.0.patch
$ git commit -m "patch(react-native-code-push): bump SSZipArchive to 2.2.x"

That's it.

Note: I'm using React Native 0.61.2 and code push 5.7.0.

Upvotes: 1

errorau
errorau

Reputation: 2334

The following steps worked for me;

cd ios
rm -rf Pods Podfile.lock
pod cache clean --all
pod install --repo-update

After worked this lines you can try again run you project.

Also another solution as down below;

watchman watch-del-all && rm -rf node_modules/ && yarn cache clean && yarn install && yarn start --reset-cache

Upvotes: 1

Related Questions