Expo doesn't show Logs - react-native

When I run my react-native app I can't see my logs.
The device where I started it doesn't even show up in the list. I tested it with iOS, android and an simulator. Any suggestions?
I use the following expo versions:
"expo": "^40.0.0",
"expo-cli": "3.28.6",

You can override console functions like console.log and that can completely change the way they work, it can also intend to do nothing and just disable the log in these cases just remove the libraries you installed recently or restore your project to the point the console worked then find the problem and fix it.

In my case I was running the app on an emulator on my local machine.
What solved it for me was changing the connection setting from LAN to LOCAL.
Either change it through the expo developer tools or just run expo start --localhost instead of expo start

Change a device name to English!

Related

Failed to intall the app in react native, how can I fix this?

I was trying execute myapp to android but an error occurred.
To clarify what happened, first time I install nodejs and Android Studio.
Later I used the following commands:
npx react-native init 'app'
cd app
npx react-native run-android
Its my fisrt time messing with react native, I was following this page:
https://learn.microsoft.com/pt-br/windows/dev-environment/javascript/react-native-for-android
And the error is:
The error
I want coding in real time for android app.
How can I fix this?
Looks like the terminal output gives you several steps to do/check.
Make sure you have properly set up your android environment. Use this link to do so. You can use Expo-Cli or React-Native-Cli.
SDK location not found. This could be an off-shoot error of not properly doing step 1. However, to cover all of your bases, ensure you have properly set up your Android Emulator. This doc is a great walkthrough.
Once your Android studio and AVD Manager is properly set up, and your development environment is properly set, you should have no issues!
Please let me know if doing the above to steps did or did not solve your errors.
If you follow the steps, https://reactnative.dev/docs/environment-setup and https://developer.android.com/studio/run/emulator there will be no problem.
As a React Native fan on Windows 10, I'd like to mention just few points you need to check.
First, please check following user variables in Environment Variables ( You can see it from System Properties).
adb="C:\Users{username}\AppData\Local\Android\Sdk\platform-tools"
ANDROID_HOME="C:\Users{username}\AppData\Local\Android\Sdk"
JAVA_HOME="C:\Program Files\OpenJDK\openjdk-11.0.15_10"
Path: check if contains {ANDROID_HOME}\platform-tools
Eg:"C:\Users{username}\AppData\Local\Android\Sdk\platform-tools"
Second, if you are using Android Sdk emulator, please make sure that it configured correctly in emulator list in Android Studio.
For an instance, I created a android emulator using android sdk-29 and you can check the followings.
Third, I recommend you, deploy first app on emulator in Android Studio.
Because we need to download gradle zip file and others, it's essential to run your first android app in Android Studio.
When you confirmed your first android app(Deploy empty project app is also okay), you can run your React Native App by Expo-cli or react-native-cli.

Android simulator is not loading on react-native application (Expo)

After the npm start, when the android simulator is open and running with Pixel3, if I 'click' a (for Android emulator), this error appears and the app does not open on the emulator
Trying to open the project on Android...
Installing Expo on device
-Couldn't start project on Android: Error running adb: Failed to install C:\Users\Atif\.expo\android-apk-cache\Exponent-2.16.1.apk:
Expo Press ? to show a list of all available commands.
|
This download is taking longer than expected. You can also try downloading the clients from the website at https://expo.io/tools
I also tried uninstalling and install again. Also I Tried Opening the emulator then run npm start.
Hope Someone Help me. But for whoever helped me i will appreciate their help. Thanks in Advance !!!
first, turn off AVD , then restart start the system, and open AVD and expo project. it will work mostly. If not delete the previous Pixel3 device , restart the system and take a new device and try.
This is because of access issue to open the emulator. Can you manually start a emulator device open, and check react-native run- android. Hopefully if the app is happy, it will install on the emulator.

getting error when i reload emulator in react native

yesterday my application was running very well I closed it when I open my project in vs code and run npm start and open an android studio and open emulator I connected it again but this error comes on emulator.
It looks like your app was made with expo. Instead of npm start, use expo start. I've had a similar problem where the JavaScript bundle keeps building over and over. I solved it by restarting the app.
If this doesn't work, try restarting your pc.
Hope this helps :)
I think it's because of require() or try restarting your pc.

how to connect app to development server and makes it sensitive to changes?

I'm working on an app that was developed by someone else and referred to me for debugging. I downloaded the project from git and now when I install it on my android device using the react-native run-android command and change the codes and save it, nothing happens in the app and I have to reinstall using "react-native run-android" to see the changes. what should I do to see the changes online?
The solution was quite simple. The only thing I had to do was to shake the device and click on "enable hot reloading" in the opened menu.
Try to clean the Gradle and run again. and also check are you able to get developer menu by clicking ctrl/command + m.

`expo start` in development stuck at "Tunnel Connected", QR code is unusable

I'm currently running a detached expo project in development mode. Whenever I run expo start or npm start in the terminal I get the following logs:
$ expo start
Starting project at /Users/johncd/workspace
Expo DevTools is running at http://localhost:19002
Starting Metro Bundler on port 19001.
Tunnel ready.
Your native app is running at expb675c828acbb437095bc6218883f56bb://192.168.1.12:19000
Logs for your project will appear below. Press Ctrl+C to exit.
The expected results would include a QR code after these logs, but there is none.
When I visit the DevTools at localhost:90002 I see the metro bundler is running on LAN and a QR code is available. However, when I scan this QR code, it results in an error reading "No usable data found".
I've tried checking for a Firewall (System preferences > Privacy > Firewall) but it appears to be turned off.
I have also tried uninstalling and re-installing expo-cli as well as the project and running expo start again but to no avail.
I've tried using npm start and yarn start. I have also tried running the project on a tunnel.
I created a test project using expo init test-project and successfully ran it using expo start, so it seems this issue is only occurring on this project.
I also tried running expo start --clear to clear the cache.
None of these have worked.
Any help is appreciated!
Versions:
"expo": "^33.0.0",
"expo-constants": "^5.0.1",
"expokit": "^33.0.4",
"react": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
"react-native-unimodules": "^0.4.2",]
Running on OSX
You need to install expo client app first from the appstore, then the qr will be readable.
You need to install Expo Go application from app store.
I didn't see anywhere a mention of what platform you're trying to use (iOS or Android) but at least with iOS I can tell you that QR codes in Expo don't really work correctly anymore. I believe Apple prevented the Expo team from being allowed to serve the bundle through the Expo app anymore. What this means for you is that the workflow you should expect is to connect your phone to the device physically using a cable and serve the bundle through USB. You can also use an emulator and move to the device when it's convenient.