Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Using SQLite3 with IL2CPP for iOS10 using XCode 8.3

Discussion in 'iOS and tvOS' started by Extrakun, Jun 7, 2017.

  1. Extrakun

    Extrakun

    Joined:
    Apr 2, 2009
    Posts:
    69
    Hi all,

    I am trying to get SQLite to works on my IOS app, using the DLLs from SQLite4Unity and have been running into the following error:

    Code (csharp):
    1.  
    2. DllNotFoundException: Unable to load DLL 'sqlite3' : The specified module cannot be found
    3.  
    The strange thing is if I change the Scripting Backend (in Player Settings) to Mono, it will work. I only get the error if I am using IL2CPP.

    I am using:
    Unity 2017.1.0b7 Personal
    XCode 8.3.2
    IOS 10.3
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,778
    Can you let us know what the code which loading the DLL (probably a DllImport attribute on a method) looks like?
     
  3. Extrakun

    Extrakun

    Joined:
    Apr 2, 2009
    Posts:
    69
    Hi, here the code that loads in the DLL

    Code (csharp):
    1.  
    2. [DllImport("sqlite3", EntryPoint = "sqlite3_open", CallingConvention=CallingConvention.Cdecl)]
    3.        public static extern Result Open ([MarshalAs(UnmanagedType.LPStr)] string filename, out IntPtr db);
    4.  
    5.        [DllImport("sqlite3", EntryPoint = "sqlite3_open_v2", CallingConvention=CallingConvention.Cdecl)]
    6.        public static extern Result Open ([MarshalAs(UnmanagedType.LPStr)] string filename, out IntPtr db, int flags, IntPtr zvfs);
    7.  
    I have filed a bug report here too: https://fogbugz.unity3d.com/default.asp?918693_nodh06f5mdpue077
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,778
    Oh, thanks! I actually looked at this bug report earlier today. We have a fix ready for it that should be landing in a 2017.1 beta release soon.
     
  5. Extrakun

    Extrakun

    Joined:
    Apr 2, 2009
    Posts:
    69
    Hi,

    Just want to check if this has been fixed in the beta that was released on June 9th?
     
  6. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,778
    No, it did not make that beta, unfortunately. I'm hoping the change will make it into the next one though.
     
  7. Extrakun

    Extrakun

    Joined:
    Apr 2, 2009
    Posts:
    69
    Thank you for your reply.

    May I ask if there's a timeline for the next release?
     
  8. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,778
    I'm unsure about the timeline for beta releases. It often depends on the number of bug fixes available and the stability of the code based on results from QA testing. So I don't know the release date.