I am trying to connect to my Firebase functions emulators from my test Android device.
When I run the emulators the output is:
┌─────────────────────────────────────────────────────────────┐
│ ✔ All emulators ready! It is now safe to connect your app. │
│ i View Emulator UI at http://localhost:4000 │
└─────────────────────────────────────────────────────────────┘
┌───────────┬────────────────┬─────────────────────────────────┐
│ Emulator │ Host:Port │ View in Emulator UI │
├───────────┼────────────────┼─────────────────────────────────┤
│ Functions │ localhost:5001 │ http://localhost:4000/functions │
└───────────┴────────────────┴─────────────────────────────────┘
Emulator Hub running at localhost:4400
Other reserved ports: 4500
Issues? Report them at https://github.com/firebase/firebase-tools/issues and attach the *-debug.log files.
From my Flutter app, I do the following to connect:
FirebaseFunctions.instance.useFunctionsEmulator(origin: 'http://192.168.1.158:5001');
I have added android:usesCleartextTraffic="true"
to my AndroidManifest and a network_security_config.xml
as stated here and here.
I am getting all the time the following error:
PlatformException(firebase_functions, com.google.firebase.functions.FirebaseFunctionsException: INTERNAL, {code: unavailable, message: com.google.firebase.functions.FirebaseFunctionsException: INTERNAL}
What am I doing wrong?