Hi all,
I am starting a project with one of my team members. Our goal is to create a React Native app with Expo. This isn't the first time I've used Expo or React Native.
The problem:
I use Ubuntu 18.04 and my friend uses Windows 10. As usual Windows is screwing something up. When my friend runs expo start in the same project as me he won't be able to connect to the project from his phone, not am I. But when I start the Expo project with expo start everything works just fine for both him and me.
After testing everything we came to the conclusion that it is not his/my phone or internet. It is his machine that is blocking something and we don't know how to resolve it.
We've tried old projects that run fine on my machine with both phones.
We've tried multiple devices and internet connections.
We've tried turning of all firewalls on his machine.
I posted the original help request on Expo Forums.
I hope someone is able to help!
I found out what the problem was. It seems to be VMware/Virtualbox.
Here is a quoted solution which I found here.
Solution for windows 10.
Go to cmd and write ipconfig. Look what is
the first Ethernet adapter. It should be Ethernet adapter Ethernet. If
it is not and it is something like Ethernet adapter Virtualbox... Then
this is the problem voalaa. Expo is taking the ip adress of the
virtualbox. So go to "Network connections" right click on the adapter
you want disable and change the status to disable. Connect you
computer to ethernet and you phone to the same wifi network. Restart
Expo, then the default url should be changed. Select host->lan, start
the app and then -> run on android. That's it.
I hope that this will help other people!
Related
So I'm starting to learn react-native and wanted to test some graphql queries within it, but I can't quite get the hang of it.
I'm hosting a localserver on a notebook running ubuntu 20.04 and I'm trying to do the requests via an Iphone through Expo GO. I should say I can query my graphql server directly via the iphone browser, it's just inside the app that it doesn't work.
I've tried a lot of things I saw on similar questions, like disabling the firewall and putting the machines local ip at the graphql client, but none worked.
I've set up my apollo-client with the IP like this:
The query I'm trying to run just returns a string and this is how I'm calling it:
I can see the query is working through the web view for the app on the same pc the server's running, but just cant get it to render at the Expo GO thing.
I am writing an app in React in order to make a beautiful UI for my API. When I run it in Arch Linux's Firefox it works well. However, when I run it in my Android device, it seems like the initial API call (inside the useEffect of the App.js) is not done, not in Firefox neither in Chrome.
I am serving the app in the computer and then opening it with my local IP address (not localhost, obviously) with my phone.
Does anyone know why isn't that working in the phone even though it is working in my Linux machine?
The source code (of the UI and of the API) is in my Github (https://github.com/ToniIvars/Localdrive).
Thank you in advance.
I suffer a similar problem recently, may relate to unreachable IP address or some security problem.
I recommend using the chrome remote debug tool to make everything clear, in short that's how to do that:
First, open your phone debug mode, connect it to the PC with adb debug enable
Open chrome on your phone
Open chrome on your PC, go to 'chrome://inspect#devices'
Wait for a second and you should see your device, click inspect on it
Soon you can find out what cause the problem
Here's a full tutorial: https://developer.chrome.com/docs/devtools/remote-debugging/
[Blockquote][1]
uncaught error java.net.sockettimeoutexception failed to connect 192.168.10.4(port 19000) from/ 192.168.10.3 (port 48682) after 10000ms)
can not run in mobile I can run in the same wifi
it can run web base please tell me what should I do
Please be a little specific with code so that correct answer can be suggested.
Based on your question I am figuring out that you're stuck with react-native expo using mobile hotspot.
You'll need to connect the laptop first to the mobile hotspot and then run
expo start
so that the correct IP address is taken. Thereafter scanning from mobile expo app will run fine.
However if you are asking further deeper question about integration with social auth then you may check my question and answer here.
I installed the new XAMPP 7.4 in macOS Catalina and the window is very different than before. I press Mount and it runs. But I have Angularjs projects that calls API Rest Laravel projects in htdocs, but doesn't work because it calls to localhost or to the local IP of the computer, but I don't know how XAMPP works now.
XAMPP creates a new ip where is htdocs and I access to the folder throw the IP but my Angularjs projects can't access because they don't know the IP, only call to 127.0.0.1.
How can I configure XAMPP to work with localhost or how can I configure Angularjs to call to that IP without affect my production server?
Thank you!
Disclaimer: I have not done this before, my answer is based on my angularjs experience and a brief search.
Trying a brand new project
In this article (which you have probably already seen and tried): https://kode-blog.io/angularjs-install-and-configure there is a very relevant segment, namely Step 1: "You can directly create the folder angular-js in drive C:\xampp\htdocs". I understand your issues is just vaguely related, though you could try following this article step-by-step with a brand new project
XAMPP to local/virtual host
If I understood correctly you are looking for a way to modify the XAMPP/AngularJS serving to the same IP. Let's try setting XAMPP to localhost first:
Setting up a virtual host on XAMPP on Mac or How to set xampp open localhost:8080 instead of just localhost and also more detailed, step-by-step ones: https://jonathannicol.com/blog/2012/03/11/configuring-virtualhosts-in-xampp-on-mac/
Serving AngularJS to a specific host
AngularJS is a lot less flexible than Angular 2+ (Set default host and port for ng serve in config file) when it comes to serving a host. You could try using http-server and node.js (first answer here: How to create a localhost server to run an AngularJS project but also check out other answers, there is some extra useful info there)
Extra bits
What you are trying seems to be absolutely feasible and done by others (Setup AngularJS and NodeJS on Xampp Web server or https://www.quora.com/Can-we-use-AngularJS-in-XAMPP) but it's not the most common thing.
I know that this answer does not directly give you an easy-to-implement-one-single-line-of-wondercode, but I hope it will start discussion at least and result in something more useful.
To use a Status IP like localhost:8080, you have to go to the Network tab in XAMPP and press Enable on the localhost:8080 option. I feel ashamed for taking too long to find this. Thank you.
Not sure where to go with this one as I am not sure if it is code related or something else. I have a working React Native app that works great on the simulator and also on the device when connected to the wifi or plugged into the Mac.
Now I have noticed that when I remove the device and place it on 4G/3G the app does not load and hangs on the loading screen. It may take a number of re-opens of the app before I can get it to run once. Funny thing is that at the minute the app only has the UI built so there are no calls to remote servers etc that may be causing it to hang.
Any ideas?
For iOs, in Xcode you can go Product > Scheme > Edit Scheme... > Run & set the Build Configuration to Release. Then run it on your device & it will be a release build that won't try to connect to your packager, but won't have the sometimes useful developer options at your disposal.