'React/RCTBridgeDelegate.h' file not found in xcode - javascript

I have made a react native app for android but i need to run that app on mac so what are the files to transfer. I have transfer ios folder on mac but its not running. Its showing the error 'React/RCTBridgeDelegate.h' file not found
my Reactnative code is
But how can i run it on mac using xcode.

Here are steps that worked for me today:
Removed the following inside ios directory:
Podfile.lock
Pods
Re-installed the pod files:
pod install
I still had the same issue, then I have run the app using Xcode instead of
running from the terminal.
If none of the above fixes it, you might also try removing node_modules and run npm install or yarn install and do the same steps above again.

If anyone else has had this problem and none of the solutions worked, make sure you opened "projectName".xcworkspace and not "projectName".xcodeproj with XCode.

Related

No such file or directory react-native/scripts/libraries

I'm trying to fix this error on github - https://github.com/callstack/react-native-fbads/issues/286 . I cloned the existing repo and ran it and the error was still there. I am currently updating packages to see why this crash keeps happening, but when I try to upgrade to react-native 0.64 from 0.63.4 i get this error in xcode while trying to run on device or simulator:
Projects/ReactNative-FBAds-AdChoicesView-Issue/node_modules/react-native/scripts/../Libraries: No such file or directory
seems like when upgrading to 0.64, the libraries folder is no longer in the scripts folder... Any help would be appreciated. I'm using the same repo as in the link above and then i run npm install -g npm-check-updates
and then ncu -u and then npm install and then cd ios & pod install
(update - 0.63.4 also does not have the libraries folder in there.)
This happened also to me upgrading from 0.63 to 0.64. After trying all solutions I followed a solution moving the folder to a directory where the path contain no spaces and it works and build the app successfully.
Solution to React Native 0.64 build fail
In order for this to work properly follow these steps:
If you previously installed a global react-native-cli package, please
remove it as it may cause unexpected issues (i.e. npm uninstall -g
react-native-cli)
Move the project folder in a path with no spaces (i.e. ~/sub folder
name/ReactNativeApp won't work till you have spaces in the path, so
move in a path like ~/folder/ReactNativeApp)
Then cd into the project folder and upgrade react native to the
latest version with npx react-native upgrade and resolve conflicts if
any
After upgrading remove the node_modules folder and the yarn.lock from
the root and the podfile.lock and Pods folder from ios subfolder
Then cd back to the root and run yarn install && npx pod-install
Now run again your app in Xcode or your IDE and it works
Crazy and absurd that a space in the path-name could cause this issue

Stuck on info starting JS server

I have initiated successfully a new react-native project. Then, every time I try to run my newly built project using the command react-native run-android, it gets stucks on info Starting JS server....
Here is the output:
$ react-native run-android
info Running jetifier to migrate libraries to AndroidX".
You can disable it using "--no-jetifier" flag.
Jetifier found 855 file(s) to forward-jetify. Using 4 workers...
info Starting JS server..."
I tried restarting the laptop and switching emulators. I don't know what else to do anymore.
How do I solve the problem?
Kill the automatically popped up metro bundler command prompt
Kill the command terminal which is running react-native run-android
Now Run react-native start This will start your js server
In new command prompt window run react-native run-android
The app came up in 5 mins in an emulator.
Linux:
Go to the terminal and type:
react-native start
and then in OTHER terminal, inside your project folder:
yarn android
or
npm run android
Temporary fix:
REACT_TERMINAL= react-native run-android
in my case with manjaro + xfce4:
REACT_TERMINAL=xfce4-terminal react-native run-android
or puts in your .bashrc:
export REACT_TERMINAL=xfce4-terminal
font: https://github.com/facebook/react-native/issues/26097
I had the same problem. I started a project yesterday and it worked, started a new one today and it didn't work. The problem seems to be "#react-native-community/cli-platform-android". The version that showed up today is 2.8.2 as opposed to 2.7.0 for yesterday's project.
I used:
npm install #react-native-community/cli-platform-android#2.7.0
This is not a optimal solution, but it will get you going.
I had the exact same frustrating issue for a very different reason than mentioned in other answers.
As explained in this SO answer Android adb binds to port 5037 and I installed some program which took this port so adb was hanging silently (why adb! .. say something!)
Commands to test if this your issue cause:
test any adb command and see if it hangs, eg:
adb devices
If it does, then check who is using the port:
sudo lsof -i :5037
In my case(Manjaro OS)
First:
npm start
Then in a separate terminal:
npm run android
The best solution that I constantly find myself using, is going to the application manager on android, then clearing the data of the app. Running the app afterwards goes smoothly without lagging.
Reinstalling android studio with a new emulator or changing the app name in app.json , build.gradle and android manifest.xml solved the issue.

null is not an object (evaluating '_RNGestureHandlerModule.default.Direction')

I followed the instructions for installing react-navigation 3.x from their website. I re-built the app and even created new project and followed the instructions again.
but still getting the same above error. any idea?
edit: I am running the app react-native cli using react-native run-ios. I am not using Xcode
error screenshot
Looks like this is to do with the new autolinking feature in RN 0.60.
To fix for now just add the following podspec for RNGesureHandler to ios/Podfile
pod 'RNGestureHandler', :podspec => '../node_modules/react-native-gesture-handler/RNGestureHandler.podspec'
Then in the ios directory run pod install to install it.
As mentioned here do the following:
Right Click Libraries "Add Files to Project"
/node_modules/react-native-gesture-handlers/ios/RNGestureHandler.xcodeproj
Go to build phases and add libRNGestureHandler.a
Run
I had this and solved by updating the pod spec and then rebuilding in Xcode.
# from project root
cd ios
pod update
Then re-run from Xcode

How to build react-native app for iOS properly?

I developed a react native app (version 57.4) on windows for android and it works fine.
Now I'm trying to build for iOS with no luck (as I don't have any experience with Xcode).
What I tried so far:
I knew that it requires a Mac and Xcode so I downloaded a VM, install Xcode.
Git clone myApp
react-native run-ios
But I got a lot of errors and build failures so after some search, I make these more steps:
react-native link
link some fonts manually
add a pod file and pod install
make some Xcode changes which I can't remember
react-native run-ios
And it works :)
BUT I had an issue with axios so I tried to fix it but I ruined the app so I removed the folder and re-cloned it again.
This time, I can't build successfully again!! and if it builds it crashes instantly!
My Question is what the exact steps do I need to make to build successfully on Mac (especially steps for Xcode)? including how to link all native dependencies correctly? and Is the pod file is necessary?

Cordova for iOS loads white page with Gap://ready iframe

After updating to Cordova iOS v3.8.0 (included with the latest Cordova 5.1 release), I noticed that my application would start up with a white screen. I also did not receive the usual javascript console output. I wasn't sure why until I looked at the DOM tree. There was only one iFrame, and it was a 'gap://ready' iframe. I did a little searching and it appears that at least one bug somewhat related to this has appeared before.
This may help provide more clues to diagnose this problem.
https://issues.apache.org/jira/browse/CB-8002.
I attempted to update to version 3.9.0 as well, but no luck. Still the same error.
hello if you have to load cordova earlier version then i also help you
1. Try this for windows
npm uninstall -g cordova
2. Try this for MAC
sudo npm uninstall -g cordova
And You Can Also Added Cordova Previous Versions Like This
3. Install Cordova Previous Versions As bellow command.
Cordova is installed using the Node Package Manager (npm). Type the following in the command window to install:
npm install -g cordova#3.6.3-0.2.13
4. Install Cordova LATEST VERSION Then Fire As bellow command.
npm install cordova without the -g
Enjoy ...!!!
In situations like that I've found its easiest to try
cordova platforms rm ios
Then
cordova platform add ios
You can replace iOS with different os name
If that doesn't work you might try making a test app with all the same plugins.

Categories

Resources