提问人:user14253444 提问时间:11/15/2023 更新时间:11/15/2023 访问量:12
我的 firebase RTDB android studio 应用项目不接受存储依赖项并显示错误
My firebase RTDB android studio app project not accepting Storage Dependency and showing Error
问:
我正在制作一个应用程序,我需要上传和使用一些图像。我正在使用 firebase raeltime 数据库,我将存储在 firebase 存储中的图像的 url 存储。为此,我有一个按钮可以从手机的外部存储中选择图像,并借助 java 代码的按钮上传。为此,我需要像Firebace(云)的存储一样访问手机的存储空间。我正在尝试添加 depandancy 以使其工作,但它显示错误。以下是依赖项实现:-
implementation 'com.google.firebase:firebase-core:22.2.0'
implementation 'com.google.firebase:firebase-auth:22.2.0'
implementation 'com.google.firebase:firebase-storage:22.0.0'
implementation 'com.google.firebase:firebase-database:22.0.0'
implementation 'com.google.firebase:firebase-messaging:23.3.1'```
**This is how I am initialising it in my activity**:-
```import com.google.firebase.storage.StorageReference;```
then
``` private ImageView imageView;
// Uri indicates, where the image will be picked from
private Uri filePath;
// request code
private final int PICK_IMAGE_REQUEST = 22;
// instance for firebase storage and StorageReference
FirebaseStorage storage;
StorageReference storageReference;```
then in onCreate :-
``` FirebaseApp.initializeApp(this);
storage = FirebaseStorage.getInstance();
storageReference = storage.getReference();```
**BUT THE STORAGE CODES HAVE ERROR** they are all in **RED** ink and the app is not working.Any help with practical guidance is welcome.
答: 暂无答案
评论