React-native-fbsdk causes CFBundleIdentifier DNE Error - ios

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.

Related

CircleCI + React Native + Xcode 10

I have an app running fine with React Native 0.57.7 on CircleCI on Xcode 9.
But we need to bump up Xcode version to 10.1.0.
But when I switch it, Ci stops to work, even with enabling legacy system (-UseNewBuildSystem=NO or -UseModernBuildSystem=0 being passed to Fastlane's build_ios_app), I get "Myapp.app/main.jsbundle does not exist" error.
▸ + echo 'error: File /Users/distiller/project/ios/build/Build/Intermediates.noindex/ArchiveIntermediates/Myapp/BuildProductsPath/Release-iphoneos/Myapp.app/main.jsbundle does not exist. This must be a bug with'
▸ error: File /Users/distiller/project/ios/build/Build/Intermediates.noindex/ArchiveIntermediates/Myapp/BuildProductsPath/Release-iphoneos/Myapp.app/main.jsbundle does not exist. This must be a bug with
▸ + echo 'React Native, please report it here: https://github.com/facebook/react-native/issues'
▸ React Native, please report it here: https://github.com/facebook/react-native/issues
After some hours spent just to figure out what was going on with it, I found out the issue: the build is failing silently because the docker image for Xcode 10.1.0 on CircleCI is missing some dependencies needed to build the app by React Native.
The error was just saying “main.jsbundle does not exist”. It happens when xcode runs react-native-cli bundle from react-native-xcode.sh file. And it doesn't tell the root cause for the error: watchman is missing in the docker image used by this Xcode version.
Why those images don’t have the same installed packages? I don’t know. I was only expecting the same installed packages between the images.
Adding brew install watchman makes the CI pass again:
- run:
name: "Install React Native dependencies"
command: |
brew update
brew install watchman
I wish react-native-xcode.sh could return the root error instead of just main.jsbundle does not exist

Can't build and run react-native project on Mac

Referring this issue, I've the same problem. I've MacOs El Captain on VMware.
Node v. 7.8.0
npm v.4.6.1
react-native-cli 2.0.1
react-native 0.46.4
Xcode v. 8.2.1
I've two issues:
- when trying to init a new react-native project, the packages fetching hangs on getting react-native 0.46.4 package from repo. Other packages were downloaded successfully. So I've execute npm install from Windows and then copied the node_modules folder on Mac.
- when trying to run the project on iOS simulator I recieve the following error:
** BUILD FAILED **
...
In file included from /Users/michelebombardi/Desktop/ReactNativeProjects/caliup/node_modules/react-native/React/../third-party/folly-2016.09.26.00/folly/Bits.h:70:
/Users/michelebombardi/Desktop/ReactNativeProjects/caliup/node_modules/react-native/React/../third-party/folly-2016.09.26.00/folly/detail/BitIteratorDetail.h:21:10: fatal error: 'boost/iterator/iterator_adaptor.hpp' file not found
#include <boost/iterator/iterator_adaptor.hpp>
The following build commands failed:
CompileC /Users/michelebombardi/Desktop/ReactNativeProjects/caliup/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/Conv.o /Users/michelebombardi/Desktop/ReactNativeProjects/caliup/node_modules/react-native/third-party/folly-2016.09.26.00/folly/Conv.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/CaliUp.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/CaliUp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist`
I really need to publish my app on the app store before the end of the week.
I've already try all suggested solutions but nothin works.
Could anyone help me?
First try this:
watchman watch-del-all && rm -rf node_modules
If you install node using Homebrew uninstall it and install node from here.(https://nodejs.org/en/)
Now if you used yarn to install node modules:
Try npm install
This error is caused by a failed third party library download in the build step. In your home folder there should be a ~/.rncache directory with a number of compressed C++ libraries. The error occurs when one or more of these files fails to download completely from the github amazon s3 servers. (likely in China)
The problem sticks around because the script in the react-native xcode build doesn't know how to resume the broken download. So you can fix this by deleting your ~/.rncache folder and because these folders are extracted into your modules you should also rm -rf node_modules and reinstall.
More info can be found here and here
May be this will work. Try these steps:
Backup your icons, images etc from ios folder.
Check that app name is set for key "name" in {project-root}\app.json file.
Delete ios/ and android/ directories
Run react-native eject
Replace the icons,images etc you copied earlier
Run react-native link
Launch you app from Xcode using short cut key command+r

Brand new react native app fails on run-ios xcode 8.3

I just created a new React Native app using their CLI interface and it fails without making any changes. I first noticed this when I tried to use version 0.45.1, it still seems to be happening in version 0.46.1
My current version that came with the CLI install.
"react": "16.0.0-alpha.12"
"react-native": "0.46.1"
The last time I was able to successfully run an app was back on version 0.44.3
I've tried running
watchman watch-del-all
rm -rf node_modules
rm -rf $TMPDIR/react-*
npm install
But it doesn't help. Full error message below.
CompileC /Users/brianclarke/Documents/development/ShitProject/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/Conv.o /Users/brianclarke/Documents/development/ShitProject/node_modules/react-native/third-party/folly-2016.09.26.00/folly/Conv.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/ShitProject.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/ShitProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
EDIT:
I couldn't figure it out, so I completely reinstalled my OS and everything works fine. Obviously that's not a fix, but felt it was worth sharing.

An application bundle was not found at the provided path... ":CFBundleIdentifier", Does Not Exist

I was working through this tutorial, however when I used the react native cli to generate a new project, it would not be able to launch ( with react-native run-ios). I kept getting the above error and I've tried troubleshooting for hours, I think it might be a problem with Xcode as I recently updated it but I'm not sure. Here is the full error message:
Installing build/Build/Products/Debug-iphonesimulator/auth.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/auth.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
If anyone has encountered this problem and fixed it please let me know what works for you! This has put me at a complete standstill and I would greatly appreciate any help. Could this be a versions issue that react native has not caught up with yet? Thanks!
There is something wrong with react-native init
Please do not initialize the project with react-native init ProjectName
You should append react-native version argument in the end.
For example:
react-native init ProjectName --version 0.44.2
If you are using XCode 10 try downgrading to XCode 9.4.1, by downloading and installing this version in official apple portal.
There might be a lot of possibilities of how to fix it, most of them are clearing npm cache, uninstalling node_modules, deleting ios and android folder and rebuilding, so you should try all of them. But downgrading XCode is what helped me after 5 hours at it
Good luck, don't be discouraged with this error, eventually you will find out the solution!

Facebook SDK causes React Native build to fail

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.

Resources