React Native: AwesomeProject not starting in emulator - react-native

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?

Related

Expo does not show the Tunnel ready message anymore

I was using expo for some days. And after startups it always shown the Tunnel ready message as it should. I use expo-cli globally.
Somehow from today on that message does not appear anymore. It's not only the message. The Metro tunnel is actually not available.
Here the expo diagnostics:
Expo CLI 3.21.3 environment info:
System:
OS: Windows 10 10.0.18363
Binaries:
Node: 12.16.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 4.0.0.0 AI-193.6911.18.40.6514223
npmPackages:
expo: ^37.0.12 => 37.0.12
react: 16.13.1 => 16.13.1
react-dom: 16.13.1 => 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz => 0.61.4
react-native-web: ~0.11.7 => 0.11.7
This is what Expo log tells me:
There is nothing else happening. Even when I wait for a long time. No error or warning.
Maybe I use a buggy version of Expo? I also tried the latest version of expo without any change. And I completely deleted the node_modules folder completely. But no change. Also I was thinking about Windows blocking the 19001 port, so I restarted the PC. Not no change as well.
What could be the reason?
Hint: there is another very similar issue: Expo Tunnel not starting but actually in my case I not even get the error message which is even more strange
Tunnel support has to be installed in the local machine.
Go to the Left-hand side of the metro bundler web UI, and click on Tunnel. This should install the tunnel.
just try disable windows firewall.
Actually deploying to web and to Android still works. It's really just the message that is not printed out anymore. So maybe the expo version has updated and now does not print the
Tunnel ready
message anymore.

Expo Publish on Android using Google App Signing broken

I have successfully published my app as a bundle (aab) on the PlayStore. I wanted to install a small update after a few days, because there are problems with the keyboard. I have executed "expo build:android -t app-bundle" as usual.
Afterwards I tried to upload directly via the cli (after it failed with the message that the fingerprint is invalid) also via the PlayStore. I got the same message that the fingerprint of the upload key does not match.
I have tried to download the upload key, but I get the following message:
expo fetch:android:upload-cert
There is no valid Keystore defined for this app Writing upload key to /my/path/to/xxxxx_upload_cert.pem
keytool exited with non-zero code: 1
I had "Google App Signing" enabled in PlayStore from the beginning, even before I knew anything about an "expo opt-in" command. There was already an upload certificate in my PlayStore. I let Expo manage the entire process and never generated anything myself.
Now I'm stuck here and don't know what to do. I can't download any hashes or upload certificates, nor can I update my app. This is absolute horror right now. I had extra Expo manage everything to avoid problems right here.
How can we fix the problem now?
Expo CLI 3.11.3 environment info:
System:
OS: macOS 10.14.6
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.3 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.13.2 - ~/Gitlab/xxxx/xxxx/xxxx-app/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.3/11C29 - /usr/bin/xcodebuild
npmPackages:
expo: ^36.0.0 => 36.0.0
react: 16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz => 0.61.4
react-navigation: ^4.0.10 => 4.0.10
I've solved the keytool exited with non-zero code: 1 just downloading and installing the last JDK from here.
This issue got addressed by the expo team and is resolved
https://forums.expo.io/t/can-update-app-in-playstore-problems-with-signing-and-fingerprint/31520/4

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

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.

react-native eject error Unrecognized command "eject"

I'm trying to eject my app to generate Android folder. I knew it worked before, but when I type react-native eject in my React Native project's root directory I'm getting:
can-mbp:MyApp can$ react-native eject
warn Your project is using deprecated "rnpm" config that will stop working from next release. Please use a "react-native.config.js" file to configure the React Native CLI. Migration guide: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
warn Package "bugsnag-react-native" is using deprecated "rnpm" config that will stop working from next release. Please notify its maintainers about it.
warn Package "react-native-onesignal" is using deprecated "rnpm" config that will stop working from next release. Please notify its maintainers about it.
warn Package react-native-onesignal has been ignored because it contains invalid configuration. Reason: Unknown option dependency.platforms.ios.sourceDir with value ""./ios"" was found. This is either a typing error or a user mistake. Fixing it will remove this message.
error Unrecognized command "eject".
info Run "react-native --help" to see a list of all available commands.
I've searched for it but every answer points out to that react-native eject is simply the correct form and I couldn't find anything regarding that it doesn't work.
Here is my system info from react-native info command:
System:
OS: macOS 10.14.5
CPU: (8) x64 Intel(R) Core(TM) i7-7920HQ CPU # 3.10GHz
Memory: 62.21 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.4.0 - /usr/local/bin/node
Yarn: 1.17.0 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 10.2/10E125 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.0-rc.2 => 0.60.0-rc.2
What am I doing wrong?
Since create-react-native-app is deprecated this functionality is no longer needed.
Due to this pr it's gone!
Personaly I don't like it but run npx react-native init YourProjectName and copy over what's necessary.
Update :
I copied to removed code and made a small package : https://www.npmjs.com/package/react-native-eject
Always working for me, first install in your project
yarn add react-native-eject
and then run
react-native eject
make sure you have install yarn in your pc
Type the following command
npx react-native eject

wrapItem(...).trimStart in Expo and React native

Today I create a new project with create-react-native-app and after installing dependencies CRNA says to start your project with expo start, after running this command all thing seems good and a chrome open page localhost:19002 but after a minute this page is stoped and in the console it says :
[12:26:47] Starting project at D:\Try\eleventh
[12:27:13] Warning: Problem validating app.json: Unable to perform cache
refresh for C:\Users\Mohammad\AppData\Local\Expo\schema-30.0.0.json:
Error: connect ETIMEDOUT 35.202.142.166:443.
[12:27:39] Starting Metro Bundler on port 19001.
[12:27:39] Metro Bundler ready.
[12:27:40] Opening on Android device
[12:27:40] Successfully ran `adb reverse`. Localhost URLs should work on
the connected Android device.
[12:27:44] Tunnel ready.
[12:27:44] Expo DevTools is running at http://localhost:19002
[12:27:44] Opening DevTools in the browser... (press shift-d to disable)
exp://192.168.89.2:19000
To run the app with live reloading, choose one of:
[12:27:44] wrapItem(...).trimStart is not a function
[12:27:44] Set EXPO_DEBUG=true in your env to view the stack trace.
as you see it says :
wrapItem(...).trimStart is not a function
and this is some information may be useful :
create-react-native-app version: 2.0.2
node version: v8.11.3
expo version: 2.2.0
npm version: 6.4.0
yarn version:1.10.1
Try using a later version of node. I ran into this issue as well using node version 8. Bumping it with nvm to node 12 worked.