sohaibnomanahmed / pensum

A Flutter + Firebase project for buying and selling books, mainly campus curriculum, socially. It uses a MVVM architecture and Trunk based development as well as CodeMagic for CI/CD
MIT License
1 stars 0 forks source link

OS Error: Connection refused, errno = 111, address = localhost, port = 48648 #4

Closed sohaibnoman closed 3 years ago

sohaibnoman commented 3 years ago

Error loading images on android emulator when using the firebase emulator for i.g commercial data. When trying to access a image following error message appears:

OS Error: Connection refused, errno = 111, address = localhost, port = 48648

sohaibnoman commented 3 years ago

The reason this is happening is that even though we change the host for firestore from "localhost:9080" to "10.0.2.2:9080", the images stored in the storage has a url containing "https:localhost..." which does not work for the android emulator. A solution to this is appending following code at the end of the string sent into the image provider .replaceAll('localhost', '10.0.2.2')