T tseyfarth Member Licensed User Longtime User Jan 5, 2023 #1 Hello all, I get an error when launching the app: Error occurred on line: 215 (DBUtils) Click to expand... android.database.sqlite.SQLiteCantOpenDatabaseException: Cannot open database '/storage/emulated/0/1.db' with flags 0x10000010: File /storage/emulated/0/1.db doesn't exist and CREATE_IF_NECESSARY is set, check directory permissions Click to expand... Is this a permissions issue? If so, what permission is missing and how to programatically change those permissions? I am using DBUtils library 2.11 Thank you, Tim
Hello all, I get an error when launching the app: Error occurred on line: 215 (DBUtils) Click to expand... android.database.sqlite.SQLiteCantOpenDatabaseException: Cannot open database '/storage/emulated/0/1.db' with flags 0x10000010: File /storage/emulated/0/1.db doesn't exist and CREATE_IF_NECESSARY is set, check directory permissions Click to expand... Is this a permissions issue? If so, what permission is missing and how to programatically change those permissions? I am using DBUtils library 2.11 Thank you, Tim
mcqueccu Expert Licensed User Longtime User Jan 5, 2023 #2 My best guess is you are loading the db from DirRootExternal which is not possible in latest android. Put your database in dirInternal that is (xui.DefaultFolder) Upvote 0
My best guess is you are loading the db from DirRootExternal which is not possible in latest android. Put your database in dirInternal that is (xui.DefaultFolder)
T tseyfarth Member Licensed User Longtime User Jan 5, 2023 #3 Hello mcqueccu, This is a sample from Erel. I cannot find any .db files included with the sample. However, you are correct about the folders - I think... I changed the code from this: B4X: File.Delete(File.DirRootExternal, "1.db") sql.Initialize(File.DirRootExternal, "1.db", True) To this: B4X: File.Delete(File.dirInternal, "1.db") sql.Initialize(File.dirInternal, "1.db", True) And now it does work - Thank you! Tim Upvote 0
Hello mcqueccu, This is a sample from Erel. I cannot find any .db files included with the sample. However, you are correct about the folders - I think... I changed the code from this: B4X: File.Delete(File.DirRootExternal, "1.db") sql.Initialize(File.DirRootExternal, "1.db", True) To this: B4X: File.Delete(File.dirInternal, "1.db") sql.Initialize(File.dirInternal, "1.db", True) And now it does work - Thank you! Tim