
@Meldiron@Steven @joeyouss Hey, I am new to Appwrite & try to build a simple project on android(kotlin) by using appwrite as a backend server for database. But i am unable connect my project with appwrite on a local machine as my emulator and server runs on same machine. I got the Exceptions like: Caused by: java.net.ConnectException: failed to connect to /192.168.18.98 (port 443) from /10.0.2.16 (port 51364) after 10000ms: isConnected failed: ECONNREFUSED (Connection refused) I tried Postman software to hit its api, read its official docs, tried to resolve it by adding : android:usesCleartextTraffic="true" into AndroidManifest. xml in the Android studio, changed IP address by getting it from network (Settings), also added .setSelfSigned(status = true) in client, in endpoint i changed http to https, I cleaned and rebuild my project so many times….But nothing helped me. Could you guys please suggest me something that will sort my problem.

Is your appwrite running?

yes, Appwrite console is running in my browser

Default ports?

To access from the emulator you need to use your computer ip address to acesss it

Could you share your client initialisation code

object Client { lateinit var client: Client fun create(context: Context) { client = Client(context) .setEndpoint(Config.ENDPOINT) .setProject(Config.PROJECT) .setSelfSigned(status = true) }}

const val ENDPOINT = "https://192.168.18.98/v1"

How to connect with Appwrite server on local machine

@Maniac_Fighter


Hey @Maniac_Fighter, when I tried by adding http://192.168.1.98/v1, I got the exception: java.net.SocketTimeoutException: failed to connect to /192.168.1.98 (port 80) from /10.0.2.16 (port 52474) after 10000ms

if you use this url and visit in the browser (without v1 endpoint) are you able to access the appwrite console??

@Maniac_Fighter we have tried (http://192.168.18.98/ (Its my ip address from network in settings) and http://192.168.1.98/) with and without v1 , its not working
We are able to see the console in browser with http://localhost/console/organization-org_id only
tried changing the localhost with ip address too, didn't work

so the ip address is incorrect then.
could you share the result of ipconfig


@Maniac_Fighter Please check the screen shots

FYI: I'm using mac mini late 2012 (macOS Catalina 10.15.7)

so I tested on my system, and it works fine on mine
What's the error when you try to access console using the ip address (http://192.168.18.98)

@Maniac_Fighter

could you try it with different browser

If it's the same could you restart appwrite and try again. I can't seem to think any other solution for this then

It could be a docker network conflict...in your emulator, does 10.0.2.2 work?

No, Its not working in Postman and also in browser gives the same error as above : Safari Can't connect to the server

Did you try with 10.0.2.2 in your emulator?
The IP could be failing due to a network conflict. Would you try running this:
docker inspect --format '{{.Name}}:{{range $k, $v := .IPAM.Config}}{{printf "\n %s" $v.Subnet}}{{end}}{{printf "\n"}}' `docker network ls --filter 'driver=bridge' -q`
Recommended threads
- FATAL EXCEPTION NullPointerException: nu...
Hi I'm using your SDK in my Android app... i upgraded to io.appwrite:sdk-for-android:8.1.0 and now i'm getting the following errors on Appwrite servers with ol...
- React Native (Expo) Google OAuth not red...
Recently, I tested my app and found that the previous hack for the google auth is now not working anymore. After searching and reading docs, I was able to set i...
- Does Appwrite work in China / Great Fire...
Quick question - does AppWrite servers work well in Mainland China? We are building a project for predominantly China users so its a make or break! 🙂
