expo react-native - disable timeout to metro in tunnel connection - javascript

My development environment is in ubuntu on wsl2 with vscode as editor running on windows using the remote wsl extension. I am running it on a physical android device using the Expo Go app using the tunnel connection on the same wifi network.
Everything works fine from scanning the QR Code to editing the code and it auto refreshes everytime I make changes on vscode. The problem is when I became idle(not making changes) for a short time, the connection somehow times out giving the error:
Cannot connect to Metro.
Cannot connect to Metro screenshot
What should be done here? How to disable the timeout if there's a way?

Related

I am unable to start up my React Native app on Windows using Android emulator from Android Studio

I am new to React Native and Mobile App Development. I am trying to start up my bare React Native project in my Emulator and it gives me issue to set up.
I get this error when I click on the button a to set to Android Emulator from my command terminal
Couldn't adb reverse: adb.exe: error: device offline
Couldn't start project on Android: Error running adb: device offline
please how do I fix it
here is my system variable
C:\Users\JUWONCALEB.DESKTOP-CMA289U\AppData\Local\Android\Sdk
running adb devices after running adb kill-server. Security question pops up after that. Worked for me.
1/ run npm start
2/ go to http://localhost:19002
3/ press on Lan and copy the URL under it eg. exp://192.168.1.3:19000
4/ download expo app in your device from your android studio.
5/ open expo and click Enter URL manually and paste the URL u copied in the previous step
6/ if needed: reload by clicking "r" button in your command line
Try to:
1 Launch the android emulator (any sdk is fine as any model)
2 open the settings IN the emulator
3 activate developer mode

React Native White Screen on iOS Simulator

Up until recently, my app was running on iOS. I am now running into a white screen issue when running npx run-ios.
When running npx run-ios, the simulator starts up and builds the application, but Metro bundler says warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB. on the terminal. Which is odd as the command itself opens the simulator and builds the application.
I am also unable to access the developer menu in both the terminal and on the simulator. So I can't access/edit bundler configs.
Things I've tried:
I've tried to delete the node_modules and run npm-install.
Deleting the Pods folder and Podfile.lock and then running pod install.
As I was working in a development branch, so I checked out to the main branch, which was working fine before, but the same issue persists, so I am doubtful that it's my code (I might be wrong however".
Doing Clear device and settingson the simulator.
Trying a different simulator.
I've seen on different similar posts that the simulator and my dev environment should be on the same network. However, this was never an issue before, and there is also no wifi edit function on the simulator.
Running the iOS application from Xcode instead

Why can't I get my android emulator to connect to my local server?

I am developing an app using React Native and made my server with node.js. For websocket connections I use socket.io
The thing is if I install the app to my android device and my android emulator, only my android device can connect to my local server. They both run the same code. I checked and the emulator has an active internet connection. Weird thing is I have an other app inside the emulator that connects to the same server without any problems using the same connection methods.
Do you guys have any idea why there is a problem like this?
Android emulators have a built in IP to use when connecting to something on your local machine.
If the socket is running on localhost, you want to connect to using the IP address 10.0.2.2 in the emulator.

Ionic run android not working

After pulling from the git repo after some time and few changes done by my colleagues, running app on my android device stopped working. I was able to run my app on my device before with usb debugging enabled, but now I get the following error after running the command ionic run android:
No target specified, deploying to emulator Error: No emulator images
(avds) found.
1. Download desired System Image by running: /Users/myUser/Library/Android/sdk/tools/android sdk
2. Create an AVD by running: /Users/myUser/Library/Android/sdk/tools/android avd HINT: For a
faster emulator, use an Intel System Image and install the HAXM device
driver
Go to the Android Studio open the AVD Manager then create AVD(if not yet created) and launch it in the emulator. Now execute the command ionic run android it will run correctly.
Possible duplicate of adb not finding my device / phone (MacOS X)
I had the same problem and can resolve this by restart my device and my Mac.

Running Meteor mobile app on physical Android device

I'm having an hard time trying to run my Meteor app on my Android device (LG G2).
I googled for answer and didn't find anything like what I encounter. I followed the instuction and everything went fine, added the Android platform to my project and ran it with meteor run android-device. The device LG G2 is plugged with a USB cable to the machine I'm building and running the app with, and the device has USB debugging enabled. Everything seem to be fine, my terminal indicates:
Started proxy.
Started app on Android Device.
I20150530-16:38:11.280(3)? - waiting for device -
Started MongoDB.
Started your app.
App running at: http://localhost:3000/
No error indication, nothing suspicous, but the app doesn't come up on the device. Nothing happens. Anyone has a clue? I tried to give my own IP and port to the command without a change.
You need to set the USB connexion on your android device as "camera". Whith my s4 mini I had the same symptoms and that was the solution.
I'll list what I've done to solve it, because it's a mix of all the solutions I got here.
I'm using Ubuntu, and LG G2 as device.
I created the /etc/udev/rules.d/51-android.rules. file with
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="1004", GROUP="plugdev" inside. (Detailed instructions here on step 3: http://developer.android.com/tools/device.html#setting-up, thank you #ChristianFritz). Pay attention that "1004" is the vendor
ID of LG.
I realised that for some reason I didn't have the ADB on my machine so I couldn't use adb devices and connect with my device. I followed this guide:
http://lifehacker.com/the-easiest-way-to-install-androids-adb-and-fastboot-to-1586992378 to install the missing ADB (linux section).
I got an error: adb server is out of date. killing... which terminated connection between the device to the machine, but after following #yoh advice, I changed my USB connection from MTP to PTP and tried again. This time worked.
Managed to run my app successfully on physical LG G2 after those steps using Ubuntu.

Categories