Error: Network Error - Expo (React Native) - react-native

I've been struggling for the past few days trying to resolve the issue with all my axios requests. No matter what I change, I keep getting the error:
[Error: Network Error]
When this error happens, it closes the application into the background of the phone but doesn't crash. There is not other error logs or warnings so it's I'm finding it hard to debug the issue.
This is not being sent to localhost, this is sent a public domain as I know there are people having issues with localhost and having to switch to use IP address. However it's happening when I'm using public domain.
Has anyone come across this with their expo build on android before?
Update:
The APIs work in postman, so it's only an issue when sending requests via the expo application.
Update Fixed:
Finally found the issue flagging:
canceled due to java.lang.NoSuchMethodError: No virtual method toString(Z)Ljava/lang/String; in class Lokhttp3/Cookie;
I had to had the following to build.gradle
implementation 'com.squareup.okhttp3:okhttp:4.7.2'
implementation 'com.squareup.okhttp3:logging-interceptor:4.4.1'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:4.4.1'

Android dont accept HTTP protocol Api so keep sure you are using a HTTPS protocol Api

Related

Expo/React Native: Stange local network behavior when making remote calls

When testing my React Native locally, I witnessed some strange behavior I am hoping to get clarification on
Context
I am building and testing a simple form that lets a user update their account info. If their new username is taken, the server responds with a 304 (otherwise, 200).
I am testing on my physical iOS device, and pointing my API against the local IP address that my expo cli is running from that is on the same wifi network (e.g. http://192.111.11.111:8080/)
Strange behavior
In every case where my local webserver does return a 304, my local expo app receives a 200. I have confirmed that my server is in fact returning a 304 with logging + breakpoints. Furthermore, when I point my API against my production server, which has the same backend code deployed, the app correctly receives a 304.
This leads me to believe that the only logical explanation is that there is some magic that expo does when doing local remote calls, but I have been unable to find anyone online that has had similar issues. Does anybody have any thoughts on what could be causing this?

Vue.js localhost giving a permission error

I have a Vue app that works on one (Windows) machine, but not on another (Mac) machine. The non-working one just gives a message "You do not have permission to access this app" in the browser.
The only error in the console is
DevTools failed to load source map: Could not load content for https://unpkg.com/#popperjs/popper.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
Any ideas? All my other Vue apps work fine
You didn't provide much information about what exactly you're doing that you're getting that error and where. That being said, this is likely not a Vue.js issue, rather a Mac OS issue with permissions. See if this question is related.
Additionally, the URL from the console https://unpkg.com/#popperjs/popper.min.js.map returns Cannot find package message, so it is indeed incorrect, the correct URL would probably be https://unpkg.com/#popperjs/core#2/dist/umd/popper.min.js.map

Reactnative Signalwire application unable to establish Ice server peer connection

I am trying to implement Signalwire calling in a react-native app. I am facing issue in connecting ice servers. Sometimes it connects and calling between two persons get successful. But most of the time it throws error
"Cannot set properties of undefined (setting 'onicecandidate')"
I have tried to search a lot but could not succeed. Can you please guide me how this issue can be resolved? I am using following iceservers:
iceServers = [
{urls: ['stun:stun.l.google.com:19302','stun:stun1.l.google.com:19302','stun:stun2.l.google.com:19302']}
];
I have tried to find iceserver associated with my signalwire account but could not find, Please guide me how to get ice/turn/stun server urls and credentials. I am using Relay SDK for reactnative
It's not possible from this post to tell if you're using the SignalWire SDKs exclusively, if you're working from third party tools, or if you're doing your own setup. There are also a few variables in terms of how you've set up your app, what errors you're seeing from the SignalWire side, and the config of your ice servers.
With all that in mind, if you could reach out to SignalWire support (from your SignalWire space, select 'Help and Support' at the top right and then Submit a New Support Request) we can take a look at your setup and work through this with you.

react-native/expo app crash once logged on build

So i recently made a build (.apk) for my app and the authentication works fine. But once I login the app crashes with error:
appName[65858]: assertion failed: 20C69 18C61: libxpc.dylib + 50260 [056A9371-1C2C-385B-BB06-F099DE20E73A]: 0x7d
My app runs fine on the simulator, and I can't make anything out of this error log.
Thank you very much for your help and please let me know if you need more information.
As you said, it is difficult to figure out what's happening just from that error. You should definitely try to debug more. You can always run a release build on your simulator using:
npx react-native run-android --variant=release
Maybe this way you will get more insights.
Because you mentioned something about authentication I assume you are making some HTTP calls. Possible issues:
The API URL. Maybe you forgot to change some localhost endpoint. Make sure the server is accessible and double-check everything related to that.
You are making API calls over HTTPS. Depending on your config, you may be allowed to make a network request over HTTP in Development, but on a Production build, you definitely need HTTPS.

PubBub WebRTC Android Demo is Not Connecting from Android to Android

When I tried the demo app https://kevingleason.me/AndroidRTC/, it was working as expected.
But when I tried with two android devices, I can make a call and receive call, but they don't get connected. In both devices, its own camera feed is displayed with a text "Connecting...". I tried on both my home Wifi and mobile data 3G. There is no error that I can find in log.
Could anyone help me to resolve the issue please. What is that I am missing here?
I am using the latest code from https://github.com/GleasonK/AndroidRTC which already has the Xirsys ICE servers configured. But I noticed that the Xirsys ICE servers is not added in the below line from VideoChatActivity.java, so I also tried adding that servers into the PnSignalingParams' constructor, but still facing the same Connecting message only.
List<PeerConnection.IceServer> servers = getXirSysIceServers();
if (!servers.isEmpty()) {
this.pnRTCClient.setSignalParams(new PnSignalingParams(servers));
}
I have fixed the issue. It was little tricky. If you see the log, it will show you that the application always execute createOffer method. So both client A and client B will send an offer in same time. You can fix that issue by giving some condition so if the client A give an offer, and the client B will response by give an answer.
To see if any error occurs you can use method onCreateFailure(String s) and onSetFailure(String s) in PnPeer.java.
Hope this will help.