Facebook SDK causes React Native build to fail - ios

My team is building our first iOS app using React Native. For some reason on my Mac only, the build fails after running react-native run-ios. This has been happening since we added Facebook authentication with the react-native-fbsdk.
We are all running node -v 7.0 and the latest version of Xcode. I have even tried deleting the repo locally and cloning it back down. As an experiment, another member of my team deleted his repo locally, cloned it back down, and was able to get everything working. We sat next to each other and did the exact same steps and it worked for him but not me.
Below is the error message I receive in my terminal:
** 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
Per the answer on this question, I have tried running react-native upgrade. This will allow the build to complete but it prevents Facebook authentication from working.

Make sure you have downloaded the FBSDK for fb login. Place it in your documents folder and then open your project in xcode. click your project in the left menu and select the build settings tab, give 'framework path' the path to your FBSDK in documents.

add
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
to your Podfile and then pod install

Did you went through all configuration steps? Here is great introduction, step by step how to add facebook sdk to react native app: https://github.com/magus/react-native-facebook-login . Btw. I recommend to use this lib if you can, I had many problems with official facebook sdk, moved to that one, and everything works.

Related

Can't archive with Xcode (error - PhaseScriptExecution failed with a non zero exit code), but the build is successful

I am sorry for the black marks in the image.
I have seen multiple posts suggesting an answer to this problem, Lock unlocks keychain (tried it), pod Update (tried it), clear build(tried it), signing, skip install in build settings(tried it) - None of them actually worked.
I built my iOS app in react native with Expo, after which I did expo eject to create the iOS folder for Xcode build and archiving, the build is successful every time and it even runs on the simulator and in my device(iPhone 7) but it always failed to archive by throwing this error - Uncategorised - Command PhaseScriptExecution failed with a non zero exit code..
Any help to point me in which direction should I go or what can be the possible mistake that I am doing will be of great help. Do let me know if, I should provide any more detail about this. Thank you!
Xcode Version - 11.0
Mac Version - 10.15 Catalina
iPhone OS - 13.1.3
Few links I tried from -
"${PODS_ROOT}/SwiftLint/swiftlint" causes "Command PhaseScriptExecution failed with a nonzero exit code" with Xcode 10
https://github.com/apollographql/apollo-ios/issues/395
https://www.reddit.com/r/iOSProgramming/comments/al9box/getting_an_error_command_phasescriptexecution/
Make sure you have installed your pods correctly. For me I removed all the pods from my pod file, updated the pod through the terminal, then re-added the pods to the pod file and installed through the terminal. This worked perfectly for me.
I had the same exact problem. What worked for me was I opened the podifle and deleted all the pods, then saved it. After that run pod update in terminal. Go back to the podfile and past the pods back into the file and save it. Then run pod update in terminal again. After that open xcode and run the cleaner and then try to Archive...it worked for me.
Based on the previous answers, the following worked for me:
Quit XCode.
Delete all relevant files: Podfile, Podfile.lok, Pods folder and .workspace file.
Recreate the Podfile and open the new .workspace file.
Cheers
PS: In my case, I hit this issue after copying an existing project (workspace) to a new machine.
Try go to accounts and press download manual profilesenter image description here

Xcode 10 - Can't Build React Native Application

Since updating the Xcode 10, I cannot build and run my app either on a physical device or on the simulator. I have tried via the terminal and directly through Xcode. What I have tried:
Removing my repo and re pulling.
https://github.com/facebook/react-native/issues/19573
https://github.com/facebook/react-native/issues/14382
https://medium.com/#swyx/if-you-get-a-third-party-config-h-35a3c54e9278
Print: Entry, ":CFBundleIdentifier", Does Not Exist
"config.h" file not found in iOS project of React native
I do not know what is left to do. I have had all the errors outlined in the above links. the main one that I am having trouble with at the moment is that config.h does exist and cfbundleidentifier", does not exist.
After following the instructions layed out in all the links provided, all I needed to do was run npm audit fix and it started working.

React Native Built Failed

The following build commands failed:
PhaseScriptExecution Install\ Third\ Party /Users/iChep/Documents/Coding/React\ Native\ Apps/albums/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/albums.app
No devices are booted.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/albums.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
I get this issues when trying to built my react native application. I know that this issue is a common one, but I'm trying to solve since 10 hours and I tryed nearly every solution on the Facebook Trubleshooting page and on the github issue page. I'm really frustrated and would appreciate the help.
I'm using Node: 8.1.2,
XCode: 8.3.3,
npm: 5.0.3,
react-native-cli: 2.0.1,
react-native: 0.45.1
When nothing fixes, try on Xcode
Go to File -> Project settings
Click the Advanced button
Select "Custom" and select "Relative to Workspace" in the pull down
click done, done
The reference is this issue on GitHub.

React-native-fbsdk causes CFBundleIdentifier DNE Error

Every time I install & link the react-native-fbsdk in any react-native project, I get this following error from running react-native run-ios:
** BUILD SUCCEEDED **
The following commands produced analyzer issues:
Analyze {project-dir}/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c
Analyze {project-dir}/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c
(2 commands with analyzer issues)
Installing build/Build/Products/Debug-iphonesimulator/{App-Name}.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/{App-Name}/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
I have followed instructions at the react-native-fbsdk README
and I have followed instructions at the IOS Getting Started Guide
Any Project I create works perfectly fine when running react-native run-ios before installing & linking the react-native-fbsdk.
Here are the following package versions I am using:
npm - 4.6.1
react-native - 0.45.1
react-native-fbsdk - 0.6.0
I was originally using react-native-fbsdk#0.6.1, but it appears that 0.6.1 may have been causing the issue so I changed it to 0.6.0.
I have attempted to create many brand new/fresh 'Hello World' projects and completely install react-native-fbsdk many times, but to no avail and I tried almost ALL of the solutions you can find by googling:
react-native CFBundleIdentifier doesn't exist,
react-native-fbsdk CFBundleIdentifier doesn't exist,
or some other variation of those 2.
Edit: I can run the app on ios via building it in xcode; however, I would like to get rid of the above error in case it might cause any future bugs during release, or with installing any new packages.

Command /bin/sh failed with exit code 1 and Embedded pods framework

Not able to identified actual issue, During updating coco pod getting a message "Re-creating CocoaPods due to major version update."
(that was come only once) and pod updation is successful. After on build i am getting the error. Command /bin/sh failed with exit code 1.
Below is some detail also which i am getting
Code Signing /Users/Gaurav/Library/Developer/Xcode/DerivedData/Appname-******/Build/Products/Debug-iphoneos/Appname.app/Frameworks/Alamofire.framework with Identity iPhone Developer: Account Name (Account Id)
/usr/bin/codesign --force --sign ***************** --preserve-metadata=identifier,entitlements "/Users/UserName/Library/Developer/Xcode/DerivedData/Appname-***************/Build/Products/Debug-iphoneos/Appname.app/Frameworks/Alamofire.framework"
/Users/Username/Library/Developer/Xcode/DerivedData/Appname-************/Build/Products/Debug-iphoneos/Appname.app/Frameworks/Alamofire.framework: bundle format unrecognized, invalid, or unsuitable
I'm using iOS 8 as deployment target and Xcode 7.3.1
I have checked code signing identity that doesn't have any issue. I have reinstall again all pod and Alamofire also but not abel to identified issue.
Clean the project, and deleting the derived data (~/Library/Developer/Xcode/DerivedData/) fixed it for me
If it was complaining about a particular Pod and being unable to codesign it.
Below things work for me:
Select the Pods Project In the main editor window, select the Pod in
the targets dropdown
Under the general tab, and under the identity header, click choose
Info.plist file
Select the plist file for the Pod
The project should now build. For some reason, it seems to lose this setting, or not be able to reference it's own plist file.
Not 100% sure but I hope it helps someone.
I have the same issue. It happen after updating cocoaPods, so I just downgrading it and all works fine. I think we just need to wait for a new version of cocoaPods and for now you can use old version.
How to downgrade cocoaPods

Resources