2016-11-07 160 views
3

我的團隊正在使用React Native構建我們的第一個iOS應用程序。出於某種原因,僅在我的Mac上運行react-native run-ios後,構建失敗。自從我們將Facebook身份驗證與react-native-fbsdk相加後,這一直髮生。Facebook SDK導致React Native構建失敗

我們都運行node -v 7.0和最新版本的Xcode。我甚至嘗試刪除本地回購,並將其克隆回來。作爲一個實驗,我的團隊的另一位成員在本地刪除了他的回購,將其克隆回來,並能夠使所有工作都能正常進行。我們並排坐在一起,做了完全相同的步驟,它爲他工作,但不是我。

下面是錯誤消息我收到我的終端:

** BUILD FAILED ** 


The following build commands failed: 
CompileC /Users/philmok/js_projects/pLot/ios/build/Build/Intermediates/RCTFBSDK.build/Debug-iphonesimulator/RCTFBSDK.build/Objects-normal/x86_64/RCTFBSDKGraphRequestManager.o RCTFBSDK/core/RCTFBSDKGraphRequestManager.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler 
(1 failure) 
Installing build/Build/Products/Debug-iphonesimulator/pLot.app 
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2): 
Failed to install the requested application 
An application bundle was not found at the provided path. 
Provide a valid path to the desired application bundle. 
Print: Entry, ":CFBundleIdentifier", Does Not Exist 

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/pLot.app/Info.plist 
Print: Entry, ":CFBundleIdentifier", Does Not Exist 

每答案上this question,我曾嘗試運行react-native upgrade。這將允許構建完成,但它會阻止Facebook身份驗證正常工作。

回答

3

確保您已經下載FBSDK進行fb登錄。將其放置在您的文檔文件夾中,然後在xcode中打開您的項目。點擊左側菜單中的項目並選擇構建設置選項卡,在文檔中給出'框架路徑'到FBSDK的路徑。

+0

確保使用這個: https://developers.facebook.com/docs/ios/ – plmok61

+0

你應該在android中做什麼? –

+0

@ShariqMusharaf不確定,這是iOS特定的。我還沒有試過它的Android –

0

您是否經歷過所有配置步驟?這裏有很好的介紹,一步一步的如何添加Facebook的SDK來回應原生應用程序:https://github.com/magus/react-native-facebook-login。順便說一句。如果可以,我推薦使用這個庫,我有許多問題與官方Facebook SDK,移動到那一個,並且一切正常。

+0

我的團隊成員已經在使用官方的React Native fbsdk,它適用於所有人。切換到另一個庫不是一個選項 – plmok61

+0

您是否嘗試從'xCode'運行應用程序?有時你必須手動設置BundleIdentifier('xCode' - >'General' - >'Bundle Indentifier'),如'com.myproject') – jonzee

+0

是的,已經設置了軟件包標識符 – plmok61

相關問題