Firebase:数据库“/google_app_measurement_local.db”未打开

CJe*_*CJe 6 sqlite android firebase firebase-analytics

在我的 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)
Run Code Online (Sandbox Code Playgroud)

这是我的 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')
}
Run Code Online (Sandbox Code Playgroud)

我所做的就是打电话

_firebaseAnalytics = FirebaseAnalytics.getInstance(context);
Run Code Online (Sandbox Code Playgroud)

进而

_firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SHARE, payload);
Run Code Online (Sandbox Code Playgroud)

我一直无法在网上找到任何解决方案,现在希望在这里得到帮助...

dea*_*ish 0

我刚刚在启用严格模式、添加时遇到了这个问题

compile 'com.google.firebase:firebase-core:9.8.0'
Run Code Online (Sandbox Code Playgroud)

我不得不使用早期版本:

compile 'com.google.firebase:firebase-core:9.6.0'
Run Code Online (Sandbox Code Playgroud)

我从Firebase Android SDK 发行说明中找到了最新版本