Photo by Camera Upload Exception (Firebase Storage)

后端 未结 3 2039
时光说笑
时光说笑 2021-01-25 04:28

I\'m trying to upload an image taken by the camera in an android application to Firebase storage. The problem is that after I take the picture, in the confirmation activit

3条回答
  •  忘掉有多难
    2021-01-25 04:44

    The exception occurs because the Uri in onActivityResult() is null:

    Uri uri = data.getData();
    

    The documentation for capturing a camera image explains:

    The Android Camera application saves a full-size photo if you give it a file to save into. You must provide a fully qualified file name where the camera app should save the photo.

    Follow the example in the documentation to create a file Uri and add it to the intent for the camera app.

提交回复
热议问题