我正在尝试使用 Cloud Firestore 来保存用户数据。我正在尝试https://firebase.google.com/docs/firestore/quickstart中显示的示例你能告诉我缺少什么吗?构建文件中的依赖项dependencies { api files('libs/AudienceNetwork.jar') api files('libs/FacebookAdapter.jar') implementation 'com.android.support:multidex:1.0.3' implementation 'com.google.android.exoplayer:exoplayer:r2.4.2' implementation 'com.android.support:support-v13:28.0.0' implementation 'com.facebook.android:facebook-android-sdk:[4,5)' implementation 'com.google.android.gms:play-services-auth:16.0.1' implementation 'com.google.android.gms:play-services-drive:16.0.0' implementation 'com.google.android.gms:play-services-tasks:16.0.1' implementation 'com.google.firebase:firebase-core:16.0.6' implementation 'com.google.firebase:firebase-ads:17.1.2' implementation 'com.google.firebase:firebase-appindexing:17.1.0' implementation 'com.google.firebase:firebase-firestore:17.1.5'}进口import com.google.firebase.analytics.FirebaseAnalytics;import com.google.firebase.firestore.DocumentReference;import com.google.firebase.firestore.FirebaseFirestore;import com.google.firebase.firestore.CollectionReference;import com.google.android.gms.tasks.OnSuccessListener; import android.app.Activity;import android.app.AlertDialog;import android.app.DatePickerDialog;import android.content.ActivityNotFoundException;import android.content.Context;import android.content.Intent;import android.content.SharedPreferences;import android.content.pm.PackageInfo;import android.content.pm.PackageManager;import android.content.pm.ResolveInfo;import android.content.pm.Signature;import android.graphics.Bitmap;import android.graphics.Color;import android.graphics.Point;import android.graphics.Rect;import android.net.ConnectivityManager;import android.net.NetworkInfo;import android.net.Uri;import android.os.AsyncTask;import android.os.Build;import android.os.Bundle;import android.os.Environment;import android.support.annotation.NonNull;
1 回答
犯罪嫌疑人X
TA贡献2080条经验 获得超4个赞
为了解决这个问题,您需要再导入一个类和一个接口,以便调用addOnSuccessListener()
对象CollectionReference
并将OnSuccessListener
对象作为参数传递。
import com.google.firebase.firestore.CollectionReference; import com.google.android.gms.tasks.OnSuccessListener;
添加回答
举报
0/150
提交
取消