com.google.firebase.database.DatabaseException 播放控制台错误
Posted
技术标签:
【中文标题】com.google.firebase.database.DatabaseException 播放控制台错误【英文标题】:com.google.firebase.database.DatabaseException Play Console Error 【发布时间】:2021-06-19 19:38:18 【问题描述】:我在 Play 管理中心收到以下崩溃日志,但我找不到导致它的行。 我得到的错误如下
com.google.firebase.database.DatabaseException
com.firebase.ui.database.ClassSnapshotParser.parseSnapshot
类型:
com.google.firebase.database.DatabaseException
日志:
com.google.firebase.database.DatabaseException:
at com.google.firebase.database.core.utilities.encoding.CustomClassMapper.convertBean (CustomClassMapper.java:56)
at com.google.firebase.database.core.utilities.encoding.CustomClassMapper.deserializeToClass (CustomClassMapper.java:81)
at com.google.firebase.database.core.utilities.encoding.CustomClassMapper.convertToCustomClass (CustomClassMapper.java)
at com.google.firebase.database.DataSnapshot.getValue (DataSnapshot.java:10)
at com.firebase.ui.database.ClassSnapshotParser.parseSnapshot (ClassSnapshotParser.java:2)
at com.firebase.ui.database.ClassSnapshotParser.parseSnapshot (ClassSnapshotParser.java:2)
at com.firebase.ui.common.BaseCachingSnapshotParser.parseSnapshot (BaseCachingSnapshotParser.java:14)
at com.firebase.ui.common.BaseObservableSnapshotArray.get (BaseObservableSnapshotArray.java:6)
at com.firebase.ui.database.FirebaseRecyclerAdapter.getItem (FirebaseRecyclerAdapter.java:2)
at com.firebase.ui.database.FirebaseRecyclerAdapter.onBindViewHolder (FirebaseRecyclerAdapter.java)
at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder (RecyclerView.java)
at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder (RecyclerView.java:29)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline (RecyclerView.java:39)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline (RecyclerView.java:498)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition (RecyclerView.java:5)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition (RecyclerView.java:1)
at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next (LinearLayoutManager.java:11)
at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk (LinearLayoutManager.java)
at androidx.recyclerview.widget.LinearLayoutManager.fill (LinearLayoutManager.java:38)
at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren (LinearLayoutManager.java:356)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2 (RecyclerView.java:38)
at androidx.recyclerview.widget.RecyclerView.onMeasure (RecyclerView.java:65)
at android.view.View.measure (View.java:26415)
at android.view.ViewGroup.measureChildWithMargins (ViewGroup.java:7845)
at android.widget.LinearLayout.measureChildBeforeLayout (LinearLayout.java:1552)
at android.widget.LinearLayout.measureVertical (LinearLayout.java:842)
at android.widget.LinearLayout.onMeasure (LinearLayout.java:721)
at android.view.View.measure (View.java:26415)
at android.widget.RelativeLayout.measureChildHorizontal (RelativeLayout.java:735)
at android.widget.RelativeLayout.onMeasure (RelativeLayout.java:481)
at android.view.View.measure (View.java:26415)
at android.widget.RelativeLayout.measureChildHorizontal (RelativeLayout.java:735)
at android.widget.RelativeLayout.onMeasure (RelativeLayout.java:481)
at android.view.View.measure (View.java:26415)
at android.widget.RelativeLayout.measureChildHorizontal (RelativeLayout.java:735)
at android.widget.RelativeLayout.onMeasure (RelativeLayout.java:481)
at android.view.View.measure (View.java:26415)
at android.view.ViewGroup.measureChildWithMargins (ViewGroup.java:7845)
at android.widget.FrameLayout.onMeasure (FrameLayout.java:194)
at androidx.appcompat.widget.ContentFrameLayout.onMeasure (ContentFrameLayout.java:154)
at android.view.View.measure (View.java:26415)
at android.view.ViewGroup.measureChildWithMargins (ViewGroup.java:7845)
at android.widget.LinearLayout.measureChildBeforeLayout (LinearLayout.java:1552)
at android.widget.LinearLayout.measureVertical (LinearLayout.java:842)
at android.widget.LinearLayout.onMeasure (LinearLayout.java:721)
at android.view.View.measure (View.java:26415)
at android.view.ViewGroup.measureChildWithMargins (ViewGroup.java:7845)
at android.widget.FrameLayout.onMeasure (FrameLayout.java:194)
at android.view.View.measure (View.java:26415)
at android.view.ViewGroup.measureChildWithMargins (ViewGroup.java:7845)
at android.widget.LinearLayout.measureChildBeforeLayout (LinearLayout.java:1552)
at android.widget.LinearLayout.measureVertical (LinearLayout.java:842)
at android.widget.LinearLayout.onMeasure (LinearLayout.java:721)
at android.view.View.measure (View.java:26415)
at android.view.ViewGroup.measureChildWithMargins (ViewGroup.java:7845)
at android.widget.FrameLayout.onMeasure (FrameLayout.java:194)
at com.android.internal.policy.DecorView.onMeasure (DecorView.java:1013)
at android.view.View.measure (View.java:26415)
at android.view.ViewRootImpl.performMeasure (ViewRootImpl.java:3609)
at android.view.ViewRootImpl.measureHierarchy (ViewRootImpl.java:2352)
at android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:2644)
at android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:2204)
at android.view.ViewRootImpl$TraversalRunnable.run (ViewRootImpl.java:9003)
at android.view.Choreographer$CallbackRecord.run (Choreographer.java:996)
at android.view.Choreographer.doCallbacks (Choreographer.java:794)
at android.view.Choreographer.doFrame (Choreographer.java:729)
at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:981)
at android.os.Handler.handleCallback (Handler.java:883)
at android.os.Handler.dispatchMessage (Handler.java:100)
at android.os.Looper.loop (Looper.java:237)
at android.app.ActivityThread.main (ActivityThread.java:7948)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1075)
有人可以帮我了解导致此错误的原因以及如何解决此问题吗?
这是我正在使用的模型类
@JsonIgnoreProperties(ignoreUnknown=true)
@Keep
public class Messenger_Model
String sentTime;
public Messenger_Model()
public Messenger_Model(
String sentTime
)
this.sentTime = sentTime;
public String getSentTime()
return sentTime;
public void setSentTime(String sentTime)
this.sentTime = sentTime;
这是数据库结构
【问题讨论】:
【参考方案1】:看起来问题在于您在 firebase db 中的模型类和数据存储代码不匹配。 要得出更多结论,需要更多有关您的数据结构的信息。
【讨论】:
我添加了模型类和数据库结构 我在不同的活动中有很多模态类。我怎么知道是哪一个导致了这个错误? 你能展示你初始化 FirebaseRecyclerAdapter 的代码吗?请展开 firebase db 树以查看子结构以上是关于com.google.firebase.database.DatabaseException 播放控制台错误的主要内容,如果未能解决你的问题,请参考以下文章