Firebase Google causes java.lang.StackOverflowError

前端 未结 4 861
温柔的废话
温柔的废话 2020-11-30 15:11

I am trying to use google firebase realtime database. My users can create events which I want to have on the database as a separate table as well as in the user class as a l

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-30 15:35

    Got this error when saving the Uri of an Image I was saving on Firebase Storage to Firebase Database.

    Like @Mwakima mentioned, you cannot save a Uri to Firebase Database.

    Solution: Change the type of your uri in the model class to String, get the String from

    String uri = taskSnapshot.getDownloadUrl().toString()

    When you get the String back from Firebase, pass it to a Uri using

    Uri imageUri = Uri.Parse();

提交回复
热议问题