【问题标题】:Fatal Exception : unknown error (code 14) could not open database致命异常:未知错误(代码 14)无法打开数据库
【发布时间】:2014-04-28 13:00:37
【问题描述】:

我的应用程序正在抛出这个

Fatal Exception : unknown error (code 14) could not open database

在 Android Kitkat 4.4 上运行时, 该应用程序在所有以前的版本上运行良好。

在这一行抛出异常。

            myDataBase = SQLiteDatabase.openDatabase("path", null, SQLiteDatabase.OPEN_READWRITE);

我已经尝试了一切 SQLiteDatabase.create(); SQLiteDatabase.opendatabase(); SQLiteDatabase.openorcreatedatabase(null); .但是在这一行中仍然抛出异常。

【问题讨论】:

标签: android android-sqlite android-4.4-kitkat sqliteopenhelper


【解决方案1】:

如果您的变量path 是作为sdcard 的辅助外部存储,那么您无法写入数据,如何创建db 文件sqlite 。 Android 4.4 阻止了在此位置写入数据,三星也遵循相同的制造商。错误消息无助于了解实际发生的情况。见:

https://source.android.com/devices/storage/index.html#multiple-external-storage-devices

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-03-10
    • 1970-01-01
    • 2015-02-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多