Troubleshooting
A guide to resolving common development problems.
Android
Emulator is not reaching the backend
Connection refused - errno 101
SocketException: Connection failed (OS Error: Network is unreachable, errno = 101)…
Fix
Turn the Wi-Fi off on emulator.
Connection refused - errno 111
SocketException: Connection refused (OS Error: Connection refused, errno = 111)…
This occurs because the Android emulator does not recognize localhost
as the host machine. Instead, you should use the IP address 10.0.2.2
.
SUPABASE_URL=http://10.0.2.2:5432
Flutter
Widget Testing
Pending timers
When running widget tests, you might encounter the following error:
The following assertion was thrown running a test: A Timer is still pending even after the widget tree was disposed.
…'!timersPending’
This typically occurs when an animation or asynchronous operation hasn't completed. Below are two approaches to resolve this using tester.runAsync
.
Run the pump and settle in that function.
await tester.runAsync(() async => tester.pumpAndSettle());
Run the whole widget pump in that function.
await tester.runAsync(() async => tester.pumpWidget(...));