Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Discussion System.DllNotFoundException: Unable to load DLL 'sqlite3'

Discussion in 'Windows' started by Arunraj, Jan 4, 2023.

  1. Arunraj

    Arunraj

    Joined:
    Jul 4, 2012
    Posts:
    21
    Our application environment
    Uwp, hololens2, arm architucture
    I have a scenario, where I am using sqlite3 for my local DB. In the recent update of SQLite, we have only dll for x86 & x64. Uwp-arm support is not found. Instead, it had arm64-v8a & armeabi-v7a. While using that .so files inside unity and have changed the import settings below upload_2023-1-4_19-26-44.png

    after this when i tried to build for Hololens2, i was not able to do any operation w.r.to DB. it shows exceptions as


    System.DllNotFoundException: Unable to load DLL 'sqlite3': The specified module could not be found.
    at Trimble.SQLite.NativeMethods.sqlite3_open_v2 (System.Byte[] filename, System.IntPtr& db, System.Int32 flags, System.IntPtr zvfs) [0x00000] in <00000000000000000000000000000000>:0


    And have tried the approach of using the target include

    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

    <PropertyGroup>
    <DisableTrimleSql3Deploy Condition="'$(DisableTrimleSql3Deploy)' == ''">true</DisableTrimleSql3Deploy>
    </PropertyGroup>

    <Target Name="CopySqlite3Binaries" BeforeTargets="AfterBuild">
    <ItemGroup>
    <arm Include="$(MSBuildThisFileDirectory)libs\WSA\arm\libtc_sqlite3.so" />
    </ItemGroup>

    <Message Text="Copying sqlite3 binaries to output folder" />
    <Copy SourceFiles="@(arm)" DestinationFolder="$(TargetDir)ARM\" SkipUnchangedFiles="true" />
    </Target>
    </Project>



    after this, I couldn't proceed further. any help would be appreciated. thanks
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    You cannot run .so files on Windows. Those are probably meant for Android. Your only option is to recompile sqlite3.dll for UWP from source code yourself.
     
    Arunraj likes this.