Android sqlitecantopendatabaseexception code 14

android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database #258

Comments

xiaoyunfei commented Aug 30, 2017

Non-fatal Exception: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
at android.database.sqlite.SQLiteConnection.nativeOpen(SQLiteConnection.java)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:212)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:196)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:836)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:821)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:714)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:576)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:269)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:223)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163)
at com.evernote.android.job.JobStorage.getDatabase(JobStorage.java:288)
at com.evernote.android.job.JobStorage.store(JobStorage.java:244)
at com.evernote.android.job.JobStorage.put(JobStorage.java:127)
at com.evernote.android.job.JobManager.schedule(JobManager.java:231)
at com.evernote.android.job.JobRequest.schedule(JobRequest.java:354)
at xxx.xxx.xxx.notification.MenstruationStartRemindJop.scheduleJob(MenstruationStartRemindJop.java:92)
at xxx.xxx.xxx.notification.NotificationJobCreator.scheduleAllJop(NotificationJobCreator.java:52)
at xxx.xxx.xxx.data.helper.HttpHelper$3.success(HttpHelper.java:129)
at xxx.xxx.xxx.data.helper.HttpHelper$3.success(HttpHelper.java:124)
at xxx.xxx.xxx.data.ResponseSubscriber.onNext(ResponseSubscriber.java:28)
at xxx.xxx.xxx.data.ResponseSubscriber.onNext(ResponseSubscriber.java:20)
at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:134)
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.call(OperatorObserveOn.java:224)
at rx.android.schedulers.LooperScheduler$ScheduledAction.run(LooperScheduler.java:107)
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:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)

The text was updated successfully, but these errors were encountered:

vRallev commented Aug 30, 2017

Please provide more information: which version were you using? A sample application to reproduce the issue, .

henrichg commented Aug 31, 2017

I have the same report from Crashlytics.

  • android-job version: 1.1.11
  • device: Sony XPeria Z1, Android 5.1.1, rooted

Fatal Exception: java.lang.RuntimeException: Unable to create service sk.henrichg.phoneprofilesplus.PhoneProfilesService: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2835)
at android.app.ActivityThread.access$1800(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1434)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:211)
at android.app.ActivityThread.main(ActivityThread.java:5389)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
Caused by android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
at android.database.sqlite.SQLiteConnection.nativeOpen(SQLiteConnection.java)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:215)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:199)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:806)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:791)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:1167)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:268)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:223)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163)
at com.evernote.android.job.JobStorage.getDatabase(JobStorage.java:297)
at com.evernote.android.job.JobStorage.store(JobStorage.java:239)
at com.evernote.android.job.JobStorage.put(JobStorage.java:122)
at com.evernote.android.job.JobManager.schedule(JobManager.java:237)
at com.evernote.android.job.JobRequest.schedule(JobRequest.java:366)
at sk.henrichg.phoneprofilesplus.WifiScanJob.scheduleJob(WifiScanJob.java:109)
at sk.henrichg.phoneprofilesplus.PhoneProfilesService.onCreate(PhoneProfilesService.java:470)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2825)
at android.app.ActivityThread.access$1800(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1434)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:211)
at android.app.ActivityThread.main(ActivityThread.java:5389)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)

Читайте также:  Верность драконов для андроид

My code:

vRallev commented Aug 31, 2017

There’s nothing I can do. The library stores jobs in a database and if a database can’t be created then scheduling the job fails. What else should happen in this case?

vRallev commented Sep 10, 2017

Closing because of inactivity.

aanandshekharroy commented Mar 27, 2018

Hey I am getting the exact same error. Running on API 19 without Google services. RAM 2 GB, ANdroid-Job version 1.2.5

iNoles commented Mar 27, 2018

It may need android.permission.WRITE_EXTERNAL_STORAGE

ygbingo commented Feb 27, 2019

maybe you could try to active to get the storage permission

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

SQLiteCantOpenDatabaseException: unknown error (code 14 SQLITE_CANTOPEN): Could not open database #113

Comments

v7lin commented Oct 29, 2018

E/SQLiteDatabase( 2043): Failed to open database ‘/data/user/0/com.xxx.xxx/databases/1881_3c07bbc431e70f53929daa89c69e057e_im.db’.
E/SQLiteDatabase( 2043): android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14 SQLITE_CANTOPEN): Could not open database
E/SQLiteDatabase( 2043): at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
E/SQLiteDatabase( 2043): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:211)
E/SQLiteDatabase( 2043): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:195)
E/SQLiteDatabase( 2043): at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:503)
E/SQLiteDatabase( 2043): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:204)
E/SQLiteDatabase( 2043): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:196)
E/SQLiteDatabase( 2043): at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:880)
E/SQLiteDatabase( 2043): at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:865)
E/SQLiteDatabase( 2043): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:766)
E/SQLiteDatabase( 2043): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:714)
E/SQLiteDatabase( 2043): at com.tekartik.sqflite.SqflitePlugin$Database.openReadOnly(SqflitePlugin.java:775)
E/SQLiteDatabase( 2043): at com.tekartik.sqflite.SqflitePlugin$Database.access$800(SqflitePlugin.java:762)
E/SQLiteDatabase( 2043): at com.tekartik.sqflite.SqflitePlugin.onOpenDatabaseCall(SqflitePlugin.java:642)
E/SQLiteDatabase( 2043): at com.tekartik.sqflite.SqflitePlugin.onMethodCall(SqflitePlugin.java:741)
E/SQLiteDatabase( 2043): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:191)
E/SQLiteDatabase( 2043): at io.flutter.view.FlutterNativeView.handlePlatformMessage(FlutterNativeView.java:163)
E/SQLiteDatabase( 2043): at android.os.MessageQueue.nativePollOnce(Native Method)
E/SQLiteDatabase( 2043): at android.os.MessageQueue.next(MessageQueue.java:326)
E/SQLiteDatabase( 2043): at android.os.Looper.loop(Looper.java:160)
E/SQLiteDatabase( 2043): at android.app.ActivityThread.main(ActivityThread.java:6669)
E/SQLiteDatabase( 2043): at java.lang.reflect.Method.invoke(Native Method)
E/SQLiteDatabase( 2043): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/SQLiteDatabase( 2043): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E/flutter ( 2043): [ERROR:flutter/shell/common/shell.cc(181)] Dart Error: Unhandled exception:
E/flutter ( 2043): DatabaseException(open_failed /data/user/0/com.xxx.xxx/databases/1881_3c07bbc431e70f53929daa89c69e057e_im.db)
E/flutter ( 2043): #0 wrapDatabaseException (package:sqflite/src/exception.dart:125:7)
E/flutter ( 2043):
E/flutter ( 2043): #1 SqfliteDatabase._openDatabase (package:sqflite/src/database.dart:471:12)
E/flutter ( 2043): #2 SqfliteDatabase.doOpen (package:sqflite/src/database.dart:504:28)
E/flutter ( 2043):
E/flutter ( 2043): #3 SqfliteDatabaseOpenHelper.openDatabase. (package:sqflite/src/database.dart:166:26)
E/flutter ( 2043):
E/flutter ( 2043): #4 Lock._runTask (package:synchronized/src/synchronized_impl.dart:149:27)
E/flutter ( 2043): #5 LockBase._createAndRunTask.run (package:synchronized/src/synchronized_impl.dart:64:14)
E/flutter ( 2043): #6 LockBase._createAndRunTask (package:synchronized/src/synchronized_impl.dart:74:17)
E/flutter ( 2043): #7 Lock.synchronized (package:synchronized/src/synchronized_impl.dart:142:12)
E/flutter ( 2043): #8 SqfliteDatabaseOpenHelper.openDatabase (package:sqflite/src/database.dart:163:25)
E/flutter ( 2043):
E/flutter ( 2043): #9 SqfliteDatabaseFactory.openDatabase (package:sqflite/src/database_factory.dart:134:41)
E/flutter ( 2043):
E/flutter ( 2043): #10 openDatabase (package:sqflite/sqflite.dart:338:26)
E/flutter ( 2043): #11 SQLiteOpenHelper.getDatabase (package:fake_os/src/sqlite_open_helper.dart:23:18)
E/flutter ( 2043):
E/flutter ( 2043): #12 SQLiteOpenHelper.getReadableDatabase (package:fake_os/src/sqlite_open_helper.dart:44:12)
E/flutter ( 2043): #13 IMDBHelper.getMessages (package:star_repository/src/im/im_db_helper.dart:98:25)
E/flutter ( 2043):
E/flutter ( 2043): #14 IMRepository.getLocalMessageHistory (package:star_repository/src/im/im_repository.dart:43:29)
E/flutter ( 2043):
E/flutter ( 2043): #15 _MessagePresenterImpl.loadMixedMessageHistory (package:star_im/src/ui/message/message_contract.dart:62:10)
E/flutter ( 2043): #16 _MessageComponentState._initMessage (package:star_im/src/ui/message/message_component.dart:76:31)
E/flutter ( 2043):
E/flutter ( 2043): #17 _MessageComponentState.build (package:star_im/src/ui/message/message_component.dart:91:9)
E/flutter ( 2043): #18 StatefulElement.build (package:flutter/src/widgets/framework.dart:3766:27)
E/flutter ( 2043): #19 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3678:15)
E/flutter ( 2043): #20 Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
E/flutter ( 2043): #21 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3658:5)
E/flutter ( 2043): #22 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3805:11)
E/flutter ( 2043): #23 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3653:5)
E/flutter ( 2043): #24 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
E/flutter ( 2043): #25 Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
E/flutter ( 2043): #26 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
E/flutter ( 2043): #27 Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
E/flutter ( 2043): #28 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3658:5)
E/flutter ( 2043): #29 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3805:11)
E/flutter ( 2043): #30 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3653:5)
E/flutter ( 2043): #31 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
E/flutter ( 2043): #32 Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
E/flutter ( 2043): #33 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
E/flutter ( 2043): #34 Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
E/flutter ( 2043): #35 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3658:5)
E/flutter ( 2043): #36 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3805:11)
E/flutter ( 2043): #37 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3653:5)
E/flutter ( 2043): #38 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
E/flutter ( 2043): #39 Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
E/flutter ( 2043): #40 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
E/flutter ( 2043): #41 Element.rebuild (package:flutter/src/widg

Читайте также:  Google android getting started

The text was updated successfully, but these errors were encountered:

alextekartik commented Oct 29, 2018

It seems to be an IO access issue. Are you able to read/write a file is the same folder? (might require permission or root access).

v7lin commented Oct 29, 2018 •

在项目里,仅打开一个数据库。还未进行读写等函数的调用。
— translate —
In the project, only one database is opened. No calls for functions such as read and write have yet been made.

`abstract class SQLiteOpenHelper <
@Protected
final String name;
@Protected
final int version;

SQLiteOpenHelper(
this.name,
this.version,
);

@Protected
Future getDatabase( <
bool readOnly: false,
>) async <
String path = join(await getDatabasesPath(), name);
return await openDatabase(
path,
version: version,
onConfigure: onConfigure,
onCreate: onCreate,
onUpgrade: onUpgrade,
onDowngrade: onDowngrade,
onOpen: onOpen,
readOnly: readOnly,
);
>

@Protected
Future getWritableDatabase() <
return getDatabase(
readOnly: false,
);
>

@Protected
Future getReadableDatabase() <
return getDatabase(
readOnly: true,
);
>

@Protected
Future onConfigure(Database db);

@Protected
Future onCreate(Database db, int version);

@Protected
Future onUpgrade(Database db, int oldVersion, int newVersion);

@Protected
Future onDowngrade(Database db, int oldVersion, int newVersion);

@Protected
Future onOpen(Database db);

@Protected
String selectionPlaceholder(List selectionArgs) <
StringBuffer buffer = new StringBuffer();
for (int i = 0; i

Источник

Оцените статью