React-Native project not opening in Expo go app - android

I m working on a react native project and now the project won't open on my android device.
I don't recall changing any settings or anything anywhere.
I tried opening projects from different systems on my Android device and its working.
So the problem is in my PC.
The error on the app while connecting is "Uncaught Error: java.net.Exception: Failed to connect to /127.0.0.1:19000". I tried changing the port (doesn't work).
I want to use LAN only and not tunnel as tunnel is slow and takes a lot of time, so help me fix this.
Feel free to ask for any other info. I really want this resolved.

Set the env var REACT_NATIVE_PACKAGER_HOSTNAME to your ip.

Make sure you're connected to the same Wi-Fi network as your mobile device.
Sign in to the same Expo account on your computer and this app.
Check you have the latest version of Expo CLI.
Hope it helps!

try to open tunnel mode:
instead of expo startuse :
expo start --tunnel

Related

How do I get an Expo project to open on my Android phone?

because Expo has been updated and won't open in a browser. I have no idea how to switch from lan to tunnel. I'm still using the Expo app to read the code from the terminal, but I keep getting an exception error. timeOut.
I therefore ask, "How can I open Expo Code in my Android device the same way we used to?"
to switch from lan to tunnel, use this cmd when you start expo:
expo start --tunnel

How to solve Error Code: 0, Message HTTP failure on android - IONIC API

When i accessed my app on the browser i have no problem accessing data from API. But when i launch it on emulator on android studio, i can´t. It pops-up a card with a ERROR CODE :0, Message Ht failure with the referent link API.
I tried to add the allow-intent, change the "localhost" on API GET request to "127.0.0.1"... and more that i don't remember.
Even the DATA received by the server side is not accessible. Right now i'm inclined to think that is a proxy related issue or a CORS problem.
Problem Solved: Basically you need to change the url on your project where you do service. Change it from localhost:3000 to 10.0.2.2:3000. The 3000is the port's number, it doesn't need to be 3000. Then you open android studio, open emulator and run it. On the litle tab right next to the android device, theres 3 dots at the end. Press those, then go to settings, and change proxy to 10.0.2.2 and the port number to the one you are using, in this case is 3000. After that it will work. Sorry for late update on the problem!
For more info:
why do we use 10.0.2.2 to connect to local web server instead of using computer ip address in android client
This can sometimes be caused by the emulated device looking at itself, not at your machine. Are you looking at it from the emulated device browser, the Ionic Devapp on emulated device, or built to native on the emulated device? Set any urls on the device to point to your host machine external IP, and allow open networking on the emulated device.
I had this error and searched for days. I have sorted out using capacitor and not cordova.
Launch this command from the project folder:
ionic build
ionic capacitor add
npx cap open andoid
If last command gives error, open the android folder with Android Studios 4

CommandInvokationFailure: : Unable to forward network traffic to device in Unity

I installed Unity and following tutorial from GoogleAR.
I faced some difficulties and managed till installation of app in mobile by lot of internet search.
Now, the app is installed in my Android mobile by unity, but not opening by itself due to the following error
CommandInvokationFailure: Unable to forward network traffic to device.
Please make sure the Android SDK is installed and is properly
configured in the Editor. See the Console for more details. /home/_____/Android/Sdk/platform-tools/adb -s "number" forward "tcp:34999" "localabstract:Unity-com.example.helloAR"
What causes this issue and how to overcome it?
Note that I did un-check Development Build, but still not working.
Looks like a bug in UnityEditor on Linux, where it opens port 34999, and adb fails to do the port forwarding because it's in use.
https://issuetracker.unity3d.com/issues/android-linux-unable-to-forward-network-traffic-to-device-when-trying-to-build-and-run-a-development-build
While it's being fixed, workarounds:
The app should be successfully installed to the device, so you can run it manually from the Apps menu.
Close Unity editor, run adb forward "tcp:34999" "localabstract:Unity-com.your.packagename" and open the editor again. This way you make the port used by adb so that later it works when building.
For Windows: just kill adb.exe and Build&Run again. Work for me every time :) You don't even need to restart the Editor.
Ctrl+Alt+Del -> Task Manager
kill this task
On Windows, I was able to fix the issue by simply restarting the Editor.

React Native demo project is failing due to gradle issue

Trying to setup the react native on Windows 7 as per instrcutions provided at https://facebook.github.io/react-native/docs/getting-started.html, after installing all the mandatory tools & dependencies, started getting below issue while running react-native run-android command.
Also looked at many options like setting up proxy for gradle etc but nothing seems to be worked till now.
Hope to get some quick help.
Are you sure it is not a temporary connection issue? Can you ping the server and get a response? Can you open the URL to the resource directly in your browser?

Meteor cordova app not doing hot code pushes

I built an app on Meteor, and deployed it to a Digitalocean server using mupx. On my local machine (where the android SDK is installed), I built the app for android with the following command:
meteor build --server=http://SERVER.IP /output/directory
I then signed the app and put it on my phone, and it runs fine, and is connected to the database. The problem is that, when I change code on the server, it doesn't automatically get pushed to the app. The only way I've been able to update the app is to build a new .apk and put it on my phone.
Some background info:
I don't have the android platform on the server, only on my local machine, and the hot code push works in the browser when I go to the IP.
Well, it seems I answered my own question in the question. You really do need to have android on the server, as well as the SDK. Just look up instruction to install the android sdk on a server (no gui). Now it works.
From 1.3-beta.12, added a --server-only option to meteor build that doesn't require the mobile SDKs to be installed on the build machine, but that will still build web.cordova whenios or android platforms have been added to the project.
Reference: meteor forum

Categories

Resources