React-native firebase Error: The bundle identifier of the application could not be determined - react-native

I'm trying to install https://rnfirebase.io/. when I init a new react-native file, it runs fine in ios.
The problem starts when I install RN Firebase, according to these docs:
https://rnfirebase.io/docs/v4.2.x/installation/ios
I get the following error (and when I try to run in xcode, I get the error in the screenshot below):
Installing build/Build/Products/Debug-iphonesimulator/test2.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/test2.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
I've tried all the suggestions for similar problems and I can't seem to figure it out. Any help would be much appreciated.
Thank You.

1.In docs it is recommended to put your Googleservice-info.plist file under ios/[YOUR APP NAME]/GoogleService-Info.plist. But it worked for me when i put it under ios/GoogleService-Info.plist.
2.Make sure that BUNDLE ID key in GoogleService-Info.plist file has your project's bundle id.

1st of all, after running pod install, use yourapp.xcworkspace, not yourapp.xcodeproject top open your project.
Once you open your project, add a Bundle identifier. Use that bundle identifier to create a firebase app as per the official tutorial.

Related

How do I customize the location of index.js with Sentry in React Native?

Our bundle entry point is at src/index.tsx, which appears not to match the Sentry default of ./index.js.
Sentry is failing on sentry-cli react-native-xcode with the error EOF while parsing a value at line 1 column 0.
Using debug log level, I see:
+ ENTRY_FILE=index.js
...
Error: The resource `/Users/lukecwilliams/Projects/mobile2mr/index.js` was not found.
And in the actual CLI command, this is being run: --entry-file index.js
We need instead --entry-file src/index.tsx. How can we customize this? I can't find an answer in the docs or source code.
I've found this solution (custom build script) but it's still not working.
I have a script in the project root:
sentry-cli-xcode-build.sh:
./node_modules/react-native/packager/react-native-xcode.sh ./src/index.tsx
And in the build command in project.pbxproj:
shellScript = "export SENTRY_PROPERTIES=sentry.properties\nexport EXTRA_PACKAGER_ARGS=\"--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map\"\nexport NODE_BINARY=node\n../node_modules/#sentry/cli/bin/sentry-cli react-native xcode ../sentry-cli-xcode-build.sh";
But the result is a fairly ambiguous: error: Permission denied (os error 13)
Do I need to change the directory setup somehow? I don't see a concrete example in Sentry docs or the GH answer above regarding where to put the script and how to reference it exactly.
It turns out that this build step should simply be disabled in iOS projects using Bitcode (which is the default). So, we have no more need to run a custom build script.
We'll use Fastlane afterward to upload debug symbols.
Docs for reference:: https://docs.sentry.io/platforms/react-native/#ios-specifics
The answer is
export ENTRY_FILE=index.ios.js
in the script

expo error installing or running app

when I try to run my app on the iOS simulator I get the error :
Error running xcrun simctl openurl booted exp://localhost:19000: An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=60):
The operation couldn’t be completed. Operation timed out
Operation timed out
Error installing or running app. Error: Process exited with non-zero code: 60
any idea how to solve this error ?
This usually is an error with the Simulator. If you remove expo (delete the app) from the simulator and run the command again, it should build fine.
However, if it still fails, Erasing all content and settings on the simulator does the trick too.
FOUNT IT!
you must have a .watchmanconfig file (like below)
File example
When you initialize a project with expo init "projectname", there is no .watchmanconfig file.
So, create one and in this file, just initialize an empty object like this : {}
Then you can start with expo start or yarn/npm start
It solved all my problem.
Hope it does for you too.
For anyone like me also searching this issue, it is possible to un-eject your app and run again like normal. From the docs, Delete the ios and android directories from your project. Delete the isDetached and detach keys from your project's app.json. You can now use your project like a normal Expo project (with no ExpoKit). Read more at https://docs.expo.io/versions/latest/expokit/advanced-expokit-topics/
It may be an issue with some outdated simulators in your simulator cache. On MacOS remove the sub-directories in the following directory:
~/Library/Developer/CoreSimulator/Caches/
check if you have .watchmanconfig file present in root, if not create one .watchmanconfig and initialize empty object and run command npm start again

Libraries installed but didn't work in react-native environment

Anytime I install Library, whether it is, native base or react-native text-input effects.it gives the same error every time..
I don't know what's causing an issue here.
error: bundling failed: Error: While trying to resolve module
native-base` from file `/home/jas/Hopper/screen/Home.js`, the package `
/home/jas/Hopper /node_modules/native-base/package.json` was successfully
found. However, this package itself specifies a `main` module field that
could not be resolved (`/home/jas/Hopper/node_modules/native-base/dist
/src/index.js`. Indeed, none of these files exist:
Delete the build folder in /node_modules/native-base/android/app

library not found for -lReact

I'm getting this error in all my app builds now and I can't seem to figure it out.
I am using the .xcworkspace file
I had to rename the app. Used: react-native-app-id ...
This morning I was able to build/run on emulator. I tried to setup xcode to run on an actual device and now the universe hates me.
I can't even react-native start and react-native run-ios without getting these errors:
ld: warning: directory not found for option '-L/Users/gmike/Projects/promiscue/tribeoffive/TribeOfFive/ios/build/Build/Products/Debug-iphonesimulator/React'
ld: library not found for -lReact
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/tribe-of-five.app/tribe-of-five normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/tribe-of-five.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/tribe-of-five.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
I've checked out a bunch of other stackoverflow articles.
I think this is telling:
Thoughts on how to un-mess up my env?
The error goes away when you remove libReact.a from the Xcode file tree (for me, it was under the Frameworks folder).
I also removed other files (they all had a transparent/white overlay on them which probably mean they were missing, actually couldn't open them in the finder neither)
Ok let's resolve this:
What to look for:
Here's a list of all the sub projects (or their products) that will cause XCode to throw that error when building a react-native project w/ cocoapods:
[
RCTActionSheet,
ART,
RCTBlob,
RCTCameraRoll,
RCTGeolocation,
RCTImage,
RCTLinking,
RCTAnimation,
RCTNetwork,
RCTPushNotification,
RCTTest,
RCTSettings,
RCTText,
RCTVibration,
RCTWebSocket,
]
Where to look for those weird project names:
First of all you'll look in the actual error message.
Here's a typical library not found error
Notice the ... /libART.a part?
That fellow is causing that error on my end.
In your case it can be any of the strings in the array above.
Found the troublemaker, what to do now?
Step 1: Remove the troublemaker project.
Let's try the lucky shot first:
Open the Project Navigator, and check if you can see the linked project that corresponds to the troublemaker string. In my case it was an XCode project called ART.
If you find it there, just remove it's reference, and you should be fine.
If that didn't work:
Open {Project Target} > Build Phases > Link binary with libraries and check wether you can see the troublemaker string in there. (It could be something like libArt.a depending on what's causing the issue on your end)
If that worked, forget the next step, otherwise move on:
Step 2: Delete the derived data directory, clean and rebuild
In my case (as seen in the raw error above) the derived data directory was /Users/sudoplz/Library/Developer/Xcode/DerivedData/MySuperApp-haxjchilyksewvdfcnnxwrulvyvy/Build/Products/Debug-iphonesimulator/
find yours in the error log, and delete it.
You can then clean XCode, shut it down, launch it again, and re-build.
Hopefully that should either fix the issue, or help you move on with fixing other stuff that may have gone wrong.
That's all folks.
Try to add that file to the libraries by finding libReact.a from the project, then clean and run Xcode.
or
Try to add libReact.a to your project "Build Phases" > Link binary with libraries, then clean and run Xcode.

An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2)

I'm getting such error, while building IOS app in React Native project:
was encountered processing the command (domain=NSPOSIXErrorDomain,
code=2) Print: Entry, ":CFBundleIdentifier", Does Not Exist
I read threads in GitHub regarding that issues, however didn't find solutions there which could solve my problem. Any ideas how to fix it?
The cause might be that you have some build files from the previous build which are causing the problem.
Clear the ios/build/your_project to trigger a fresh build
In my case the Xcode build folder needed to be cleaned. To fix, in Xcode go to Product | Clean Build Folder
In my case, the cause was - The build file name was MyMob.app but the app it tries to install to the simulator was mymob.app.
I solved it by changing the line in mymob.xcscheme:46
BuildableName = "MyMob.app"
BuildableName = "mymob.app"
Log was
iinfo Installing "build/mymob/Build/Products/Debug-iphonesimulator/mymob.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.
info Launching "com.mymob.app"
error Failed to launch the app on simulator, An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=4):
The request to open "com.mymob.app" failed.
Underlying error (domain=FBSOpenApplicationErrorDomain, code=4):
The operation couldn't be completed. Application info provider (FBSApplicationLibrary) returned nil for "com.mymob.app"
Application info provider (FBSApplicationLibrary) returned nil for "com.mymob.app"