我的应用程序需要100%将数据同步到Firebase数据库,即使它处于脱机状态也必须正常工作,因此我启用了离线功能,如official document所述。
问题是在使用应用程序一段时间后应用程序崩溃了,甚至重新安装了应用程序
我按照堆栈跟踪中的说明浏览了文档,我的应用程序上没有读取只写入Firebase数据库
Fatal Exception: java.lang.RuntimeException: Firebase Database encountered an OutOfMemoryError. You may need to reduce the amount of data you are syncing to the client (e.g. by using queries or syncing a deeper path). See https://firebase.google.com/docs/database/ios/structure-data#best_practices_for_data_structure and https://firebase.google.com/docs/database/android/retrieve-data#filtering_data
at com.google.android.gms.internal.zzdok.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5728)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:749) Caused by java.lang.OutOfMemoryError: Failed to allocate a 48 byte allocation with 1280 free bytes and 1280B until OOM
at bjf.a(:com.google.android.gms.DynamiteModulesC@11951440:37)
at bjf.b(:com.google.android.gms.DynamiteModulesC@11951440:45)
at bjf.a(:com.google.android.gms.DynamiteModulesC@11951440:41)
at bjf.b(:com.google.android.gms.DynamiteModulesC@11951440:45)
at bjf.a(:com.google.android.gms.DynamiteModulesC@11951440:41)
at bjf.b(:com.google.android.gms.DynamiteModulesC@11951440:45)
at bjf.a(:com.google.android.gms.DynamiteModulesC@11951440:41)
at bjf.b(:com.google.android.gms.DynamiteModulesC@11951440:45)
at bjf.a(:com.google.android.gms.DynamiteModulesC@11951440:41)
at bjf.b(:com.google.android.gms.DynamiteModulesC@11951440:45)
at bjf.a(:com.google.android.gms.DynamiteModulesC@11951440:41)
at bjf.b(:com.google.android.gms.DynamiteModulesC@11951440:45)
at bjf.a(:com.google.android.gms.DynamiteModulesC@11951440:41)
at bjf.b(:com.google.android.gms.DynamiteModulesC@11951440:45)
at bjf.a(:com.google.android.gms.DynamiteModulesC@11951440:41)
at bjf.b(:com.google.android.gms.DynamiteModulesC@11951440:45)
at bjf.a(:com.google.android.gms.DynamiteModulesC@11951440:41)
at bjf.a(:com.google.android.gms.DynamiteModulesC@11951440:34)
at bgz.a(:com.google.android.gms.DynamiteModulesC@11951440:82)
at bhe.run(:com.google.android.gms.DynamiteModulesC@11951440:9)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)