2016-10-03 154 views
0

我有Xcode版本7.3.1節點版本v4.4.6和npm版本3.8.6如何從React^0.14.8和React-native^0.24.1升級到React 15.0.2和React-native 0.26.3

所以現在我的IOS陣營原生應用是沒有問題,但建設我試圖用一個庫:https://github.com/aksonov/react-native-router-flux/blob/master/docs/MIGRATION.md

需要作出反應,原生版本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.) 
+0

你看了[本指南](https://facebook.github.io/react-native/docs/upgrading.html)嗎?你有沒有運行'react-native upgrade'?它旨在更新所有與新版本的本機反應相關的附件和文件。您必須進入並手動更正升級後覆蓋的任何值。 –

+0

升級不起作用,以反應原生0.26我試圖從0.14 - > 0.26.3 –

回答

0

首先更新你的反應,原產於較新版本,之後運行此react-native upgrade項目中的根。