更新firebase数据库时使用setValue时出错。我不确定是什么问题。
错误日志输出。
val database = FirebaseDatabase.getInstance()
val ref = database.getReference("users").child(firebaseUser.uid)
val map = HashMap<String, Any>()
map.put("username", username.toLowerCase())
map.put("email", email)
map.put("rank", 0)
map.put("message_count", 0)
map.put("date_joined", "N/A")
map.put("purchase", false)
map.put("initial_payment_option", "N/A")
map.put("current_payment_option", "N/A")
map.put("subscription", "N/A")
map.put("family_discount", "N/A")
ref.setValue(map)
Gradle App模块:
implementation 'com.google.firebase:firebase-auth:15.1.0'
implementation 'com.google.firebase:firebase-database:15.0.0'