无法直接从react-native Android应用调用firebase云功能

时间:2018-06-01 13:41:53

标签: android firebase react-native google-cloud-functions

我已将我的react-native应用程序配置为直接通过httpsCallable调用firebase云功能。它在iOS上运行良好,但在Android上,当调用一个函数时,它会抛出:

Error: Object cannot be encoded in JSON: { NativeMap: {"projectId":"L2dJbApIzhoFq2gUgJ5T","action":"pending"} }
at new HttpsError (HttpsError.js:4)
at errorOrResult (index.js:22)
at tryCallOne (core.js:37)
at core.js:123
at JSTimers.js:297
at _callTimer (JSTimers.js:154)
at _callImmediatesPass (JSTimers.js:202)
at Object.callImmediates (JSTimers.js:466)
at MessageQueue.__callImmediates (MessageQueue.js:329)
at MessageQueue.js:147

我的app / build.gradle依赖项:

dependencies {
implementation project(':react-native-firebase')

implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.firebase:firebase-core:16.0.0"

implementation project(':react-native-fbsdk')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.google.firebase:firebase-database:15.0.0"
implementation "com.google.firebase:firebase-analytics:15.0.0"
implementation "com.google.firebase:firebase-auth:15.0.0"
implementation "com.google.firebase:firebase-firestore:16.0.0"
implementation "com.google.firebase:firebase-functions:16.0.1"
implementation "com.google.firebase:firebase-messaging:15.0.2"
implementation "com.google.firebase:firebase-perf:15.1.0"

implementation "com.android.support:multidex:1.0.1"
implementation "com.android.support:appcompat-v7:25.0.1"
implementation "com.facebook.react:react-native:+" }

尝试了几个版本的com.google.firebase:firebase-functions,到目前为止没有运气。有什么想法吗?

0 个答案:

没有答案