SQLite User Forum

Issues on ios 15
Login

Issues on ios 15

(1) By anonymous on 2022-03-01 15:41:47 [source]

Hello,

I have an issue when I try to connect to db (using "sqlite3_open_v2") on IOS 15+ I don't get an error code, only native stack trace (see below) Everything works perfect on IOS 14 and lower. Does anybody have the same issue?

Native stacktrace: 0x0 - Unknown 0x10a8a26ac - /Users/administrator/Library/Developer/CoreSimulator/Devices/F96EA4A8-4A2F-493B-8FF7-86EC96C77D2B/data/Containers/Bundle/Application/4E6AAB6E-C0B6-4BD5-ABC5-B0D9F19FFBC4/eDoc.iOS.app/eDoc.iOS : hookedSQLiteVFSOpen 0x7fff2204c7b0 - /Applications/Xcode_13.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libsqlite3.dylib : sqlite3BtreeOpen 0x7fff2202a2dc - /Applications/Xcode_13.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libsqlite3.dylib : openDatabase 0x1137440d1 - Unknown

(2) By Simon Slavin (slavin) on 2022-03-01 18:34:49 in reply to 1 [link] [source]

Place a text file in the same folder as the database file. Give the text file the same protection and permissions as the SQLite database file has. Use standard file commands in your program to try to open the text file. Does it work ?

Which API are you using to access the file ? Are you using the C API in your C code ? Are you using a library for another language ? Are you making CoreData calls ?

(3) By anonymous on 2022-03-02 10:22:54 in reply to 2 [link] [source]

Thank you for your reply. I've tried to create text file and read it in the DB folder - it works fine. I use c# and xamarin. Sqlite is built-in to IOS, I've checked version - 3.36. This is how import method 2from native library looks like:

public static class SQLite3 {

[DllImport(LibraryPath, EntryPoint = "sqlite3_open_v2", CallingConvention = CallingConvention.Cdecl)] public static extern Result Open(byte[] filename, out IntPtr db, int flags, [MarshalAs(UnmanagedType.LPStr)] string zvfs); ..... }

(4.1) By Simon Slavin (slavin) on 2022-03-02 18:40:41 edited from 4.0 in reply to 3 [link] [source]

Thank you for performing the test I suggested. It is often useful because the problem is caused by the OS, not SQLite. Unfortunately in your case it did not help.

I see you are using the iPhone simulator built into Xcode. I did not notice any information about changes related to SQLite in the recent iOS upgrade, and cannot think of anything which might help. However, I have not developed iPhone software for a long time and don't have much experience. I have two suggestions:

  1. Make sure you are using the current version of Xcode. No need to delete and download again, just check the version numbers, since Apple is careful to keep these accurate.
  2. Perhaps someone else on this forum can help. Otherwise you might ask your question in first the xamarin support forum, then Apple's iPhone developers forum. They know a lot more than I do.

Good luck with your project.