I try to use Firebase Cloud Functions from my Flutter application by using the Firebase Emulator. In production, the call is working fine, but not in the Emulator, I always get the following error.
Error after calling the function
[VERBOSE-2:ui_dart_state.cc(166)] Unhandled Exception: PlatformException(-5, The operation couldn’t be completed. (com.google.GTMSessionFetcher error -5.), null)
Flutter code
CloudFunctions(region: "europe-west3")
.useFunctionsEmulator(origin: "127.0.0.1:8080")
.getHttpsCallable(
functionName: "addUser",
)
.call(
{"name": "oui", "email": "oui@oui.fr"},
).then(
(value) {
print('OK');
print(value);
},
);
firebase.json
{
"emulators": {
"functions": {
"port": 5001
},
"firestore": {
"host": "0.0.0.0",
"port": 8080
},
"ui": {
"enabled": true
}
}
}