network request failed when running expo app on android device - javascript

I am using a localhost server for my app development on expo. I get this error on my android device.
My server and api works fine as I have tested it on postman. It works well in the browser too. I am already using my ip address in the fetch function instead of localhost.
The fetch also works fine on genymotion android emulator. The issue is only on my actual android device.
Thanks

Solved the issue finally. The issue was my firewall(ufw) which was not allowing access for public ports.
sudo ufw allow from 192.xxx.x.xxx to any port 80 helped me as it allows acces to publicly open ports.
Thanks

Related

CISCO Jabber Web: "HostDisconnect" by initialisation

I am trying to run the sample code for cisco jabber/web communication and get the following console outputs:
[cwic.ext] 12:23:32.632 loaded with origin: http://localhost cwic_plugin.js:1
[cwic.ext] 12:23:32.642 append_iframe onload cwic_plugin.js:1
[cwic.ext] 12:23:32.645 initializing extension channel Object contentscript.js:1
[cwic.ext] 12:23:32.645 Content script connected to Cisco extension: mbhnoblcplfcookpoennihpndjobapeo contentscript.js:1
[cwic.ext] 12:23:32.645 forward ciscoSDKClientMessage 'init' to background script contentscript.js:1
[cwic.ext] 12:23:32.791 send ciscoChannelServerMessage 'HostDisconnect' to client contentscript.js:1
[cwic][ERROR][12:23:32.792] Connection with add-on has been lost e here Logger.js:110
It tried to run an own application that only initialize the cwic and get the same problem. I tried it with two other devices, with firefox and edge. Same issue. Is there something i forgot?!
Many Thanks for help!
I am using:
Cisco Framework Version 11.8.3
Cisco Web Communicator
Chrome Add-On Version 11.8.2.1
Google Chrome Version 103.0.5060.134 (64-Bit)
Apache Version 2.4.53
OpenSSL Version 1.1.1n
PHP Version 8.1.6

Getting ERR_CONNECTION_REFUSED on my node api called from angular app on remote device access

I have an Node App and an Angular App running on my System (LG Gram- Windows), and the node server is my API server and the angular App is consuming those APIs. The Angular server is served with --host 0.0.0.0 so that I can access the app through out my Local Network (WiFi). I tried to access the Angular app with my phone and other laptop (HP - Ubuntu), both the devices was able to access angular app, but the login call(Through the Angular APP) to node API from my phone is giving me an error, but the Ubuntu system is fine. I tried calling the Node API directly from both devices and was able to access it and got a response. The Ubuntu system had the same issue with login but it was somehow fixed. What could be the issue.
I have fixed the issue, Since both the Node and Angular server was running on the same machine, i have set the API url as http://localhost:4000/api which worked on the same laptop but not on my android device, which in fact is calling http://localhost:4000/api for the api calls, hence connection error (no server on port 4000 on my android device). When i changed the url to http://192.168.31.82:4000/api, my local network IP, it worked.

phonegap doesn't connect with xampp server on localhost

I have a PhoneGap project on my windows 7 PC. I have installed the PhoneGap developer app on my PC which connects through server address: http://192.168.1.16:3000.
When I load the project on the PhoneGap developer app, everything works fine. The problem is that I have a database which is saved locally on my PC (localhost) and I access it through XAMPP. When I setup the XAMPP server I can not access the database and when I run the project it's showing me an error.
If I connect an online database on a server it works. I mean it's working with an online database but not working on localhost.
Can anyone help me how to access my database on localhost server.
var url = "http://localhost:81/myapp/auth.php";
And if i run open this link on above image result here:
enter image description here
Your app is running on the Phone and interprets localhost as its own host.
Try to use the IP you get from your Router of your PC smth. like 192.168.x.x or so.
Also be aware that direct connections to your PC-Database may be blocked because of the listen config of your MySQL Server

React native running on the device error

my react native app wont run when the device is connected on my laptop.. but the app will run successfully on genymotion. I dont know what the problem is. Can anyone suggest me some solutions to this problem. Thank you
This is problem i get on my device, but no problem when running on genymotion
check this out, probably you not set up your dev server
https://facebook.github.io/react-native/docs/running-on-device-android.html#configure-your-app-to-connect-to-the-local-dev-server-via-wi-fi
Make sure your laptop and your phone are on the same Wi-Fi network.
Open your React Native app on your device. You can do this the same way you'd open any other app.
You'll see a red screen with an error. This is OK. The following steps will fix that.
Open the Developer menu by shaking the device or running adb shell input keyevent 82 from the command line.
Go to Dev Settings.
Go to Debug server host for device.
Type in your machine's IP address and the port of the local dev server (e.g. 10.0.1.1:8081). On Mac, you can find the IP address in System Preferences / Network. On Windows, open the command prompt and type ipconfig to find your machine's IP address (more info).
Go back to the Developer menu and select Reload JS.
what your android version device ?
the first think should you do after your plugg in your device via usb, check that your device is properly connecting to ADB by running adb devices.
Open your cmd find your adb directory path example : C:\Users\your_name\AppData\Local\Android\sdk\platform-tools
Run $ adb devices and see list devices attached. U must have one devices only one device connected at a time.
After check devices are connected and then run your app $ react-native run-android.
If your android version 5.0 lollipop running the following in your cmd $ adb reverse tcp:8081 tcp:8081 and you can reload your aplication, but if still error you can run via wi-fi, you can use this tutorial if you run via wi-fi, but you'll first need to install the app on your device using a USB cable.

No targets shown in WEINRE (Cordova/PhoneGap)

I've been trying to connect my device to weinre, yet I cannot see any target device in it.
This are the steps I'm following:
Creating project in Cordova
Adding android platform to the project
Adding the weinre script to my project's index.html
Initiating weinre server in my computer
Pinging both devices IP from each other to ensure they can see each other over the network
Opening weinre server in my chrome browser
Running my App
No target ever appear
Please if I'm doing something wrong tell me, but can't see, to connect any target itno my weinre server.
Best regards.

Categories

Resources