【发布时间】:2020-10-15 12:56:54
【问题描述】:
我正在 flutter 中制作应用程序,并使用 firebase 中的云功能来更新 Firestone 中的数字,
index.js
// The Cloud Functions for Firebase SDK to create Cloud Functions and setup triggers.
const functions = require('firebase-functions');
// The Firebase Admin SDK to access Cloud Firestore.
const admin = require('firebase-admin');
admin.initializeApp();
exports.getRandomNumbers=functions.https.onCall((context)=>
{
const numbers=admin.firestore().collection('RandomNumbers').document('CurrentRandomNumber');
return numbers.add({
RandomNumber=5;
});
});
这就是函数
onPressed: () async{
final HttpsCallable callable = CloudFunctions.instance.getHttpsCallable(
functionName: 'getRandomNumbers',
);
await callable.call().catchError((error){
print('$error');
});
},
即将到来的错误是 PlatformException(functionsError, Cloud function failed with exception., {code: NOT_FOUND, details: null, message: NOT_FOUND})
我也在我的日志中发现了这些,我可能认为是这个原因
W/DynamiteModule(12544): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(12544): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(12544): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
注意
- 我已将我的 Google Play 服务更新到最新版本。
- 我已获得清单文件中 INTERNET 的许可。
- 重新下载.json文件并检查
【问题讨论】:
标签: javascript node.js firebase flutter google-cloud-functions