如何从React升级^ 0.14.8& React-native ^ 0.24.1 to React 15.0.2和React-native 0.26.3

时间:2016-10-03 15:15:57

标签: ios react-native

我有Xcode版本7.3.1节点版本v4.4.6和npm版本3.8.6

所以现在我的ios React Native应用程序正在构建,没有任何问题,但我正在尝试使用库:https://github.com/aksonov/react-native-router-flux/blob/master/docs/MIGRATION.md

需要React-native版本0.26.3

所以我检查了https://github.com/facebook/react-native/blob/0.26-stable/package.json,发现有一个稳定版本的React-native 0.26.3和React 15.0.2

所以我在package.json中更改了我对项目的依赖关系并删除了我的node_modules文件夹并重新安装。

  "dependencies": {
    "react": "15.0.2",
    "react-native": "0.26.3",
    "react-native-sound": "^0.8.3",
    "react-redux": "^4.4.5",
    "redux": "^3.5.2",
    "redux-thunk": "^2.1.0"
  }

然而,我的应用程序不再有效,我在启动时不断收到此错误。我该如何正确升级到React 15?

ld: warning: object file (/Users/appollo_liu/Documents/workspace/laybium_workspace/laybium/ios/build/Build/Products/Debug-iphonesimulator/libRNSound.a(RNSound.o)) was built for newer iOS version (9.0) than being linked (7.0)
Undefined symbols for architecture x86_64:
  "std::terminate()", referenced from:
      ___clang_call_terminate in libReact.a(RCTJSCExecutor.o)
  "___cxa_begin_catch", referenced from:
      ___clang_call_terminate in libReact.a(RCTJSCExecutor.o)
  "___gxx_personality_v0", referenced from:
      -[RCTJavaScriptContext initWithJSContext:onThread:] in libReact.a(RCTJSCExecutor.o)
      -[RCTJavaScriptContext init] in libReact.a(RCTJSCExecutor.o)
      -[RCTJavaScriptContext invalidate] in libReact.a(RCTJSCExecutor.o)
      _RCTNSErrorFromJSError in libReact.a(RCTJSCExecutor.o)
      +[RCTJSCExecutor runRunLoopThread] in libReact.a(RCTJSCExecutor.o)
      -[RCTJSCExecutor init] in libReact.a(RCTJSCExecutor.o)
      -[RCTJSCExecutor context] in libReact.a(RCTJSCExecutor.o)
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
    Ld build/Build/Products/Debug-iphonesimulator/laybium.app/laybium normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/laybium.app
An error was encountered processing the command (domain=LaunchServicesError, code=0):
The operation couldn’t be completed. (LaunchServicesError error 0.)
Launching org.reactjs.native.example.laybium
An error was encountered processing the command (domain=FBSOpenApplicationErrorDomain, code=4):
The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 4.)

1 个答案:

答案 0 :(得分:0)

首先将您的react-native更新为较新版本,然后在项目根目录中运行此react-native upgrade