"could not connect to development server" error running React Native tutorial with Expo, suspecting Watchman - react-native

New to react native and mobile dev, running into this problem:
I am running the React Native hello world from the Facebook Website using Expo CLI as the build tool. What I did was to install Expo, run expo init test, install cocoapods, and cd into the test directory and run expo start.
When I open the app on iOS simulator or my iPhone, I get "Could not connect to development server" after about 3-5 minutes in white screen (see screenshot).
In the Expo logs. It is notable that upon every startup I get the following error logs:
2019-08-25T21:49:21,474: [cli] Failed to open /Users/nsadeh/Library/LaunchAgents/com.github.facebook.watchman.plist for write: Not a directory
ERROR
21:49
Watchman: watchman --no-pretty get-sockname returned with exit code=null, signal=SIGABRT, stderr= 2019-08-25T21:49:21,474: [cli] Failed to open /Users/nsadeh/Library/LaunchAgents/com.github.facebook.watchman.plist for write: Not a directory
I have already tried un- and reinstalling Watchman as well as Expo. Not sure what else to do.
To reproduce:
macOS Mojave 10.14.6
node v10.16.3
expo 3.0.10
Watchman 4.9.0
react-native 0.59.10
Run expo init and from the top directory expo start.

Solution: turns out that postgreSQL left an unrelated LaunchAgents.plist file in my Library that was confusing Watchman. Renaming it resolved the issue.

Related

react native expo run web is showing some permission issue

I am trying to run react native project using expo package on web browser.
but I am getting error message.
Commands executed
yarn install - installed all packages.
expo start - executed very well no issue
npm install react-native-web - no issue
npm install react-dom packages - no issue
expo start - no issue
pressed w - no issue
Browser opened up but in console it says something like.
The issue
Uncaught Error: react-native-permissions: NativeModule.RNPermissions is null. To fix this issue try these steps:
installed npm packages

React Native: AwesomeProject not starting in emulator

I’m attempting to start up up the AwesomeProject basic project in react native, which is hanging when attempting to hit http://localhost:8081. 

Currently, the iOS emulator is starting up properly by running
yarn ios

After a short period of time, I’m met with the red error screen everyone loves stating “Could not connect to development server.

Here are the current tool versions.
Mac OS: 10.15.4 (macOS Catalina)
NodeJS: v10.19.0
yarn: 1.22.4
npm: 6.13.4
react-native cli: 3.2.1
react-native npm bundle: 0.61.4
expo: 3.15.5
expo npm bundle: 36.0.0
watchman: 4.9.0
xcode: 11.4 (11E146)

I’ve tried numerous ideas such as:
Trying to hit the 8081 url through the browser upon the emulator. I was able to hit the http url just fine
Tried to clear all caches, remove node_modules folder, etc
Ensured the OS firewall is disabled
Upgraded to the latest version of Node
As this point, I'm completely stuck lol and need to get this silly app working.
Can anyone here recommend some ideas?

Getting Building iOS bundle error when trying to build an android app - expo -react-native

I was able to build app using expo build:android previously. However, after upgrading to latest expo version I get following error:
connect ECONNREFUSED 127.0.0.1:19001
Set EXPO_DEBUG=true in your env to view the stack trace.
I also see the following lines in the log:
Publishing to channel 'default'...
Building iOS bundle
I don't added ios to my app.json, I only need to build an android apk. To do that I use expo build:android -t app-bundle
I also removed package-lock.json and node_modules and run npm install, but I get the same error.
I run expo start on another cmd and then run expo build:android -t app-bundle still get same error
Also when I clear expo cache, see the following log:
Restarting Metro Bundler...
Starting Metro Bundler on port 19001.
Couldn't adb reverse: adb.exe: error: Invalid source port: 'undefined'
I had faced same issue myself and found the solution. Expo is looking for localhost:19001 which is not running. Just follow following steps and it should work as expected:
Run expo start no terminal and once it opens up the
browser where you will find this line written Starting Metro
Bundler on port 19001.
Now open another terminal instance and run expo build:android.

react-native run-android not working on ubuntu 16.04

i have a problem with react native in ubuntu, i have installed,
java jdk 8 (both javac --version) as well as echo $JAVA_HOME gives the proper output.
I have also installed android studio and set the android environment variables as well as the tools and echo $ANDROID_HOME gives output of the sdk location.
I have also installed gradle version 4.4.
I am unable to start the android app using react-native run-android. can any one let me know if i have missed something during installation.
And react-native as well as android studio works fine as I am currently using react-native start to start the metro builder as well as the other react-native cli commands. also android studio and gradle is also able to generate debug as well as release apks with no problems.
The error i get,
Scanning folders for symlinks in /home/igate-naveed/Documents/ReactNative/mobile-app-android/node_modules (16ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
First of all you need to create a project like this:
react-native init myProjectName
Then, start an emulator from Android Studio... Afterwards:
npm install && npm start
in your project directory, and from another terminal, inside your project directory, run :
react-native run-android
Is this working?
Instead of using the npm install manager, I used yarn and it worked for me. In your project directory, just do:
(project-directory)$ yarn
Update the gradle version.
Create new project:
react-native init projectname
Uninstall the npm pack.
Reinstall the npm pack again.
npm start
react-native start
react-native run-android

ReactNative fails to deploy build to iOS simulator but does deploy it to Android emulator

ReactNative fails to deploy build to iOS simulator but does deploy it to Android emulator
Attached are screenshots showing this on both.
Steps:
Created react native app
react-native init proto
Run app on Android emulator after I started emulator
react-native run-android
this is running fine on Android emulator
Run app on iOS simmulator
react-native run-ios
This produces error as per screenshot
Error
** BUILD FAILED **
The following build commands failed:
CompileC /Users/dinob/reactnativework/proto/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTShadowView+Internal.o Views/RCTShadowView+Internal.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/proto.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/proto.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Versions
MacBookPro OSX El Capitain
react-native 0.55.3
react-native-cli 2.0.1
npm 5.5.1
node v8.9.1
watchman 4.9.0
Please have a look here for help with troubleshooting
I would suggest you try all the solutions described in that thread to try and fix this issue. Good Luck!