library not found for -lReact - react-native

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.

Related

Error: Cannot find entry file ./node_modules/react-native-scripts/build/bin/crna-entry.js in any of the roots:

I keep receiving this error when running my App.js for React Native that was working perfectly well before I attempted installing Victory charts. Somehow something broke and after over three hours of work I am unable to figure out a solution. I have tried everything I could find on the web including uninstalling watchman, reinstalling watchman, reverting to React Native 0.55.4, some other recommended commands. Nothing is working.I am so confused.
$ yarn add react-native-scripts
This helped.
I think the other library may hurt the installation part of your package. To solve this issue on IOS you need to add its library like below:
First do 'yarn add react-native-scripts'. In the case that it dose't work continue other steps.
1-Go to the node module of your project and find the package folder and find the ios file inside it.
2- Then drag it into ‘library’ section of your xcode. (It is the subset of your project folders)
3- Then go to ‘build phase’ and in the ‘Link binary with libraries’ add it there by clicking on the plus sign
4- Then in some cases you need to add the correct path of the ios file inside your node module in the xcode. To do that you should go to ‘build setting’ section in the xcode and search header there. Then you need to add the path there below other paths.
5- Then clear everything (cmd+shift+k) and then finally compile it.
I hope it works for you.
In my case the "crna-entry.js" file does exist in the roots and my project should work (nothing have been modified from last time when it does work).
After hours searching, finally I figured out the reason:
the packager's directory checking is case-sensitive and in windows terminal the drive "c:/" will not be auto-corrected to "C:/" which will lead to error.
Hope this will help someone who gets the same error.
Below is the full error message:
The development server returned response error code:404 Cannot find
entry file node_modules/react-native-scripts/build/bin/crna-entry.js
in any of the roots:

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

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.

CocoaFob - linker command failed with exit code 1

This is a weird error! I'm getting:
ld: framework not found CocoaFob
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've checked all my build settings - and they appear correct. CocoaFob.framework is in my Linked Frameworks and Libraries - showing healthy and black. For some reason though, the damned framework isn't found when I try to link. Does anyone have any ideas?
Once possible clue is that when I try to the cocoafob application ( from here: https://github.com/glebd/cocoafob ) I get exactly the same error. I'm using Xcode 8.2.1
Okay. So the solution for me (and hopefully this will help anyone else who's experiencing a similar problem) was to:
build CocoaFob as release (I'd already done this, but in the interests of completeness) copy the resultant built framework to /Library/Frameworks and use it from there.
Do not attempt to use it in the location where it was built! Neither should you create a symlink in /Library/Frameworks to the location where it was built.
This done, all works well. Phew!

facing this error while building a project in xcode

facing this error while building a project in xcode
warning: unable to merge a subprocess's serialized diagnostics
error: unable to open output file '/Users/s-09/Library/Developer/Xcode/DerivedData/ls-cujvtldtpxrezhdhbujnmfcrntjl/Build/Intermediates/CordovaLib.build/Debug-iphoneos/CordovaLib.build/Objects-normal/armv7/CDVPluginResult.o': 'Error opening output file '/Users/s-09/Library/Developer/Xcode/DerivedData/ls-cujvtldtpxrezhdhbujnmfcrntjl/Build/Intermediates/CordovaLib.build/Debug-iphoneos/CordovaLib.build/Objects-normal/armv7/CDVPluginResult.o': Input/output error'
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
Cleaning the /DerivedData made it work
Can I safely delete contents of Xcode Derived data folder?
I have also faced that problem. I have closed, restarted Xcode; deleted the application from device and reinstalled it again, then the problem has gone.
Make sure the library and project files is truly included if it is not include it shows in red color in this type of case some time it is in original folder and not in project so delete it and add it again.

How to handle "linker command failed with exit code 1 (use -v to see invocation)"

I had an error like
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have searched, did all provided solution. but still same error. I have attached the screen shot of error page. Can anybody help me how to resolve this issue.
Thanks in Advance.
Does this link help?
http://discuss.cocos2d-x.org/t/library-not-found-for-lcurl/12035
In summary:
Caused by adding AdMob or Flurry to the project.
Check Build Settings > Library Search Paths and ensure that they are correctly rooted so they point to the correct libraries. Others had some success in removing the $(SRCROOT) bit and turning them into absolute paths.