在我的Android应用中开始使用Firebase进行事件记录后,当我启动应用时,我不断收到这些错误消息:
E/System: java.lang.IllegalStateException: The database '/...folder here.../google_app_measurement_local.db' is not open.
at android.database.sqlite.SQLiteDatabase.throwIfNotOpenLocked(SQLiteDatabase.java:2169)
at android.database.sqlite.SQLiteDatabase.createSession(SQLiteDatabase.java:365)
at android.database.sqlite.SQLiteDatabase$1.initialValue(SQLiteDatabase.java:84)
at android.database.sqlite.SQLiteDatabase$1.initialValue(SQLiteDatabase.java:83)
at java.lang.ThreadLocal$Values.getAfterMiss(ThreadLocal.java:430)
at java.lang.ThreadLocal.get(ThreadLocal.java:65)
at android.database.sqlite.SQLiteDatabase.getThreadSession(SQLiteDatabase.java:359)
at android.database.sqlite.SQLiteProgram.getSession(SQLiteProgram.java:101)
at android.database.sqlite.SQLiteQuery.setLastStmt(SQLiteQuery.java:96)
at android.database.sqlite.SQLiteQuery.close(SQLiteQuery.java:111)
at android.database.sqlite.SQLiteCursor.close(SQLiteCursor.java:300)
at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:366)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:202)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:185)
at java.lang.Thread.run(Thread.java:818)
这是我build.gradle的一个片段:
dependencies {
compile 'com.android.support:support-v4:25.0.0'
compile 'com.google.firebase:firebase-analytics:9.8.0'
compile 'com.google.firebase:firebase-crash:9.8.0'
compile files('src/main/resources/simple-xml-2.7.jar')
compile files('src/main/resources/date4j.jar')
compile 'com.android.support:appcompat-v7:25.0.0'
compile files('src/main/resources/picasso-2.5.2.jar')
}
我所做的只是致电
_firebaseAnalytics = FirebaseAnalytics.getInstance(context);
然后
_firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SHARE, payload);
我无法在网上找到任何解决方案,现在我希望在这里寻求帮助......
答案 0 :(得分:1)
请转到最新版本的firebase SDK。 Firebase在更新的sdk中解决了这个内存泄漏问题。删除旧SDK并在gradle文件中添加以下行。
compile 'com.google.firebase:firebase-core:11.0.1'
答案 1 :(得分:0)
在添加
时启用strictmode时我刚刚面对这个问题compile 'com.google.firebase:firebase-core:9.8.0'
我不得不使用早期版本:
compile 'com.google.firebase:firebase-core:9.6.0'
找到了最新版本