Firebase可调用函数出错

时间:2018-04-07 23:07:09

标签: java android firebase google-cloud-functions

我正在尝试在我的Android应用中设置可调用的Firebase云功能。为此,我需要使用以下代码初始化SDK:

 $dql = "SELECT id, name  FROM App\Entity\Blog:Blog";

然而,当我这样做时,应用程序崩溃时出现此错误:

FirebaseFunctions f = FirebaseFunctions.getInstance();

似乎Firebase代码中使用的projectId字段为null,这会导致错误。我不确定如何解决这个问题。

修改:这是我的E/AndroidRuntime: FATAL EXCEPTION: main Process: mhealth.mvax.qa, PID: 5390 java.lang.NullPointerException at com.google.firebase.functions.internal.Preconditions.checkNotNull(Preconditions.java:876) at com.google.firebase.functions.FirebaseFunctions.<init>(FirebaseFunctions.java:77) at com.google.firebase.functions.FirebaseFunctions.getInstance(FirebaseFunctions.java:141) at com.google.firebase.functions.FirebaseFunctions.getInstance(FirebaseFunctions.java:159) at mhealth.mvax.auth.modals.ApproveUserModal.approveRequest(ApproveUserModal.java:143) at mhealth.mvax.auth.modals.ApproveUserModal.lambda$null$0$ApproveUserModal(ApproveUserModal.java:92)

build.gradle

1 个答案:

答案 0 :(得分:0)

我通过改变

解决了这个问题

'com.google.gms:google-services:3.0.0'

'com.google.gms:google-services:3.1.0'

在我的项目级别build.gradle