supabase / supabase-flutter

Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.
https://supabase.com/
MIT License
708 stars 167 forks source link

Auth Methods not working on Android Emulator #984

Closed arrrrny closed 2 months ago

arrrrny commented 2 months ago

Describe the bug Auth methods are not working on Android emulators. When I run the same code on an IOS simulator everything works fine.

To Reproduce Steps to reproduce the behavior: Initialize supabase and call auth method on Android Emulator

Expected behavior It should work as it does on IOS

I/flutter ( 7605): AuthException(message: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = 127.0.0.1, port = 51586, uri=http://127.0.0.1:54321/auth/v1/signup?, statusCode: null)

Screenshots If applicable, add screenshots to help explain your problem.

Version (please complete the following information): On Linux/macOS Please run dart pub deps | grep -E "supabase|gotrue|postgrest|storage_client|realtime_client|functions_client" in your project directory and paste the output here.

├── supabase_flutter 2.5.8
│   ├── supabase 2.2.4
│   │   ├── functions_client 2.2.0
│   │   ├── gotrue 2.8.3
│   │   ├── postgrest 2.1.2
│   │   ├── realtime_client 2.2.0
│   │   ├── storage_client 2.0.2

Additional context my Android emulator is connected to the internet and can signin and auth on firebase.

Vinzent03 commented 2 months ago

Seems like your app can't access the supabase instance. Please check if you can access other http websites with the http package. On Android you have to add extra permission to the manifest for example.

arrrrny commented 2 months ago

Additional context my Android emulator is connected to the internet and can signin and auth on firebase.

Vinzent03 commented 2 months ago

Oh I've missed that, sorry. But I see now that the URL contains the localhost IP, so I guess you are running the supabase instance locally. You can't access that instance with that IP, since it is basically another device. Try the IP from here

arrrrny commented 2 months ago

it worked. thankss bro