Firebase DatabaseException: Failed to convert value of type java.lang.Long to String

前端 未结 7 1160
挽巷
挽巷 2020-12-01 14:50

com.google.firebase.database.DatabaseException: Failed to convert value of type java.lang.Long to String

is the error I keep getting w

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-01 15:28

    Problems

    1. If you are adding values in firebase database manually, the values will be in long data type; for example:


    1. If you are adding values by commands, the values will be saved in the database as string.

    Solution:

    When you are getting the values from database, save the values in default data type. Then, when you want to reuse the value change it into the string by using the toString() method.

提交回复
热议问题