amplitude / amplitude/Amplitude-Android

SQLITE_CANTOPEN_EMFILE

未关闭
#159 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Java
星标
169
派生
87
PR 合并指标
30 天内没有已合并 PR

描述

Hi guys! I've got an app crash after multiple app switches from recents screen.
I initialize Amplitude once in onCreate method of Application class.
Here is the stacktrace:

> E/SQLiteLog: (28) failed to open "/data/data/hk.moneon.debug/databases/com.amplitude.api-journal" with flag (131072) and mode_t (1b0) due to error (24)
E/SQLiteLog: (14) cannot open file at line 32557 of [b3bb660af9]
E/SQLiteLog: (14) os_unix.c:32557: (24) open(/data/data/hk.moneon.debug/databases/com.amplitude.api-journal) -
E/SQLiteLog: (28) failed to open "/data/data/hk.moneon.debug/databases/com.amplitude.api-journal" with flag (131074) and mode_t (1b0) due to error (24)
E/SQLiteLog: (28) failed to open "/data/data/hk.moneon.debug/databases/com.amplitude.api-journal" with flag (131072) and mode_t (1b0) due to error (24)
E/SQLiteLog: (14) cannot open file at line 32557 of [b3bb660af9]
E/SQLiteLog: (14) os_unix.c:32557: (24) open(/data/data/hk.moneon.debug/databases/com.amplitude.api-journal) -
E/SQLiteLog: (2062) statement aborts at 1: [PRAGMA user_version;] unable to open database file
E/REALM: could not create WeakRealmNotifier ALooper message pipe: Too many open files.
E/REALM: uncaught exception in notifier thread: St12system_error: Bad file number
E/com.amplitude.api.DatabaseHelper: insertOrReplaceKeyValue in long_store failed
android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 2062)

>Error Code : 2062 (SQLITE_CANTOPEN_EMFILE) Caused By : Application has opened two many files. Maximum of available file descriptors in one process is 1024 in default. (unable to open database file (code 2062)) #################################################################
at android.database.sqlite.SQLiteConnection.nativeExecuteForLong(Native Method)
at android.database.sqlite.SQLiteConnection.executeForLong(SQLiteConnection.java:768)
at android.database.sqlite.SQLiteSession.executeForLong(SQLiteSession.java:652)
at android.database.sqlite.SQLiteStatement.simpleQueryForLong(SQLiteStatement.java:107)
at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:825)
at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:813)
at android.database.sqlite.SQLiteDatabase.getVersion(SQLiteDatabase.java:1002)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:241)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163)
at com.amplitude.api.DatabaseHelper.insertOrReplaceKeyValueToTable(DatabaseHelper.java:147)
at com.amplitude.api.DatabaseHelper.insertOrReplaceKeyLongValue(DatabaseHelper.java:141)
at com.amplitude.api.AmplitudeClient.getNextSequenceNumber(AmplitudeClient.java:1000)
at com.amplitude.api.AmplitudeClient.logEvent(AmplitudeClient.java:902)
at com.amplitude.api.AmplitudeClient$5.run(AmplitudeClient.java:841)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.os.HandlerThread.run(HandlerThread.java:61)

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。