#Mobile app can't find my development server

22 messages · Page 1 of 1 (latest)

placid elk
#

Hello, using Tauri to build a mobile app for https://modeldiplomat.com. I managed to get the app running but it's showing a white screen and I've determined it's because it can't connect to my dev server. I am not using any framworks, just a makefile that when you run make dev it spins up a development server on port 8000. Any idea how to connect that dev server to the mobile simulator?

#

fwiw my browser app runs fine

pastel zephyr
#

You're running an android emulator?

#

can you try replacing localhost in the devUrl with 10.0.2.2?

#

run the android dev thing and let it build, then kill the dev process and change the localhost thing back while maintaining the app

#

ugh right that's not supposed to happen anyway

#

it's something wrong with the default android project i think

#

internal loopback is supposed to be 10.0.2.2 but the android app just takes the server from outside the emulator, which doesn't work

#

can you mark this problem as Android and Tauri relevant in the tags?

placid elk
#

This is for iOS actually, running XCode

#

But would probably want Android too

pastel zephyr
#

Oh it's broken for that too? Add that tag as well then. If both projects are broken I don't understand why we have them

placid elk
#

How would I know if it's broken vs I am using it wrong?

#

Are you saying that all of Tauri mobile is broken? Because that is what I am hearing

turbid night
#

I remember having this issue on iOS. I think the emulator creates a separate network interface and you have to modify the dev server url in tauri.config.json to it's address. but I don't have my mac with me so I can't check

placid elk
#

How do you find the emulator's network address?

turbid night
#

ok, I have my mac now and I checked my setup. I'm using vite and I start the dev server with vite --host 0.0.0.0 so it listenes on all addreses.
in tauri.conf.json I have devUrl: "http://localhost:1420"
so for me the solution was to tell the dev server to listen on 0.0.0.0 but basically those two have to match.

placid elk
#

What port does your vite setup serve at? Mine does 8000 (not vite though), but if I change the devUrl in the config the logs say Warn Waiting for your frontend dev server to start on http://localhost:1420/...

turbid night
#

looks like 1420 is default for vite, I don't have any settings for that. try setting dev server to http://localhost:8000

placid elk
#

I figured out what the problem was but not sure how to solve it. My app fails when it imports a library (supabase) that is installed in my setup. Again, it works in the web, but not iOS simulator. Not sure how to get it to recognize the library

rocky jackal
tidal cosmos
#

Sorry for the long silence here, this may have slipped our minds. Would one of you mind opening a github issue (if you already did, please ping me in it)? I'll add it to the 2.0 stabilization tracker then.