@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
- Flutter Android oAuth is no more working
I currently don't get the oAuth login to work in flutter android. it works on ios and on web. but when try to use it on Android, i get to the point where the ca...
- I'm experiencing a critical bug on Appwr...
Hey <@870607367597850624> team / support 👋 I'm experiencing a critical bug on Appwrite Cloud that's blocking my production Flutter app. I've already filed GitH...
- Database listRows method call failing in...
I'm getting an error when trying to use listRows in a flutter app on a database. It seems something in the backend has changed because the production version of...