litesuits / android-lite-orm

LiteOrm is a fast, small, powerful ORM framework for Android. LiteOrm makes you do CRUD operarions on SQLite database with a sigle line of code efficiently.
http://litesuits.com?form=gorm
Apache License 2.0
1.49k stars 362 forks source link

Android 6.0 不支持,直接报错结束。 #20

Closed leveychen closed 8 years ago

leveychen commented 8 years ago

在6.0上报错。5.1和4.4上面正常。 输出日志

03-05 08:12:55.621 8980-8980/? E/SQLiteLog: (14) cannot open file at line 31278 of [2ef4f3a5b1]
03-05 08:12:55.621 8980-8980/? E/SQLiteLog: (14) os_unix.c:31278: (2) open(/storage/emulated/0/xxxx/database/xxxx.db) - 
03-05 08:12:55.622 8980-8980/? E/SQLiteDatabase: Failed to open database '/storage/emulated/0/xxxx/database/xxxx.db'.
android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
twiceyuan commented 8 years ago

应该是没处理动态权限的问题。library 的 target 貌似是21,所以应该在自己应用所在的 Module 把这个处理一下

litesuits commented 8 years ago

感谢楼上@twiceyuan 帮解答 ,无法打开数据库文件,先检查下权限相关

leveychen commented 8 years ago

感谢两位回复,已经解决。 原先在application 里面初始化,没有动态判授权,所以炸裂了。 动态授权回调之后初始化数据库就正常了。