mapbox-unity-sdk icon indicating copy to clipboard operation
mapbox-unity-sdk copied to clipboard

SQLite

Open Marc-Paul opened this issue 8 years ago • 8 comments

I tried to use the neweset aswell as the default Mapbox sdk, installed the dependencies, but i am not getting further. I cleaned up the vector-tile-cs (a lot of unusable dereferenced strings, which i replaced with string.format, and some more errors in the test subfolder, which i straight out threw out after it showed up 40 errors, compiling to 0 errors afterwards) and put in my token. Upon pressing play the following errors occure :

Failed to load 'Assets/Mapbox/Core/Plugins/sqlite/x64/sqlite3.dll' with error 'A dynamic link library (DLL) initialization routine failed.

  • SQLite4Unity3d.SQLiteConnection:Dispose(Boolean) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/SQLite/SQLite.cs:1561)
  • SQLite4Unity3d.SQLiteConnection:Dispose(Boolean) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/SQLite/SQLite.cs:1560)
  • SQLite4Unity3d.SQLiteConnection:Finalize() (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/SQLite/SQLite.cs:1549)

DllNotFoundException: sqlite3

  • SQLite4Unity3d.SQLiteConnection..ctor (System.String databasePath, SQLiteOpenFlags openFlags, Boolean storeDateTimeAsTicks) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/SQLite/SQLite.cs:200)
  • Mapbox.Platform.MbTiles.MbTilesDb.openOrCreateDb (System.String dbName) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/MbTiles/MbTiles.cs:132)
  • Mapbox.Platform.MbTiles.MbTilesDb..ctor (System.String tileset, Nullable`1 maxTileCount) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/MbTiles/MbTiles.cs:32)
  • Mapbox.Platform.Cache.MbTilesCache.initializeMbTiles (System.String mapId) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/MbTilesCache.cs:101)
  • Mapbox.Platform.Cache.MbTilesCache.Get (System.String mapId, CanonicalTileId tileId) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/MbTilesCache.cs:124)
  • Mapbox.Platform.Cache.CachingWebFileSource.Request (System.String uri, System.Action`1 callback, Int32 timeout, CanonicalTileId tileId, System.String mapId) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/CachingWebFileSource.cs:112)
  • Mapbox.Unity.MapboxAccess.Request (System.String url, System.Action`1 callback, Int32 timeout, CanonicalTileId tileId, System.String mapId) (at Assets/Mapbox/Unity/MapboxAccess.cs:173)
  • Mapbox.Map.Tile.Initialize (IFileSource fileSource, CanonicalTileId canonicalTileId, System.String mapId, System.Action p) (at Assets/Mapbox/Core/mapbox-sdk-cs/Map/Tile.cs:137)
  • Mapbox.Unity.MeshGeneration.Factories.TerrainFactory.CreateTerrainHeight (Mapbox.Unity.MeshGeneration.Data.UnityTile tile) (at Assets/Mapbox/Unity/MeshGeneration/Factories/TerrainFactory.cs:203)
  • Mapbox.Unity.MeshGeneration.Factories.TerrainFactory.OnRegistered (Mapbox.Unity.MeshGeneration.Data.UnityTile tile) (at Assets/Mapbox/Unity/MeshGeneration/Factories/TerrainFactory.cs:128)
  • Mapbox.Unity.MeshGeneration.Factories.AbstractTileFactory.Register (Mapbox.Unity.MeshGeneration.Data.UnityTile tile) (at Assets/Mapbox/Unity/MeshGeneration/Factories/AbstractTileFactory.cs:86)
  • Mapbox.Unity.Map.AbstractMapVisualizer.LoadTile (UnwrappedTileId tileId) (at Assets/Mapbox/Unity/Map/AbstractMapVisualizer.cs:193)
  • Mapbox.Unity.Map.AbstractMap.TileProvider_OnTileAdded (UnwrappedTileId tileId) (at Assets/Mapbox/Unity/Map/AbstractMap.cs:207)
  • Mapbox.Unity.Map.AbstractTileProvider.AddTile (UnwrappedTileId tile) (at Assets/Mapbox/Unity/Map/AbstractTileProvider.cs:34)
  • Mapbox.Unity.Map.QuadTreeTileProvider.Update () (at Assets/Mapbox/Unity/Map/QuadTreeTileProvider.cs:146)
  • Unity version: 2017.2.0f3
  • Mapbox SDK version: dev branch aswell as 1.3.0
  • The platform you're building to: First of all Windows, but will later switch to iOS, want to test the possibilitys first of all

Marc-Paul avatar Jan 12 '18 10:01 Marc-Paul

@Eskazar hm, I totally have no idea why you would face all those problems/errors ❓ ❓ ❓

Just to make sure we are on the same page:

  • Below are the two ways to get mapbox-unity-sdk into your project.
  • And you get the errors listed above with both of them?

mapbox-unity-sdk_v1.3.0.unitypackage

If you download the unitypackage from https://www.mapbox.com/install/unity/ it should be as easy as doing those two steps from within your project:

  • Assets -> Import Package -> Custom Package ...
  • Mapbox -> Setup -> Access Token

latest develop from source

git clone [email protected]:mapbox/mapbox-unity-sdk.git
cd mapbox-unity-sdk
update-mapbox-unity-sdk-core.bat

Copy the Mapbox folder from <YOUR-PATH-TO-CLONED>/mapbox-unity-sdk/sdkproject/Assets/ into your project's Assets folder.

Mapbox -> Setup -> Access Token

wilhelmberg avatar Jan 12 '18 11:01 wilhelmberg

@BergWerkGIS yes. I was kinda confused too. First of all, thanks for the fast answer! I tried both methods and both showed the same problem. I just tried the unitypackage 1.3.0 in a new project and it ended up the same as both before. It seems like the sqlite3.dll is corrupted or something similar, without it, im just stuck in an infinite map loading. I just redownloaded the package, so the package is fresh and not currupted.

Hope you can help me. If you need any more informations, just tell me. Best Regards

Marc-Paul avatar Jan 12 '18 12:01 Marc-Paul

@Eskazar do you have .Net Framework 3.5 installed? Totally forgot but we just had a similar issue recently: https://github.com/mapbox/mapbox-unity-sdk/issues/361

The user solved it by installing .Net Framework 3.5. Download: https://www.microsoft.com/en-us/download/details.aspx?id=21

Could you try that and let me know if it works for you too?

wilhelmberg avatar Jan 14 '18 10:01 wilhelmberg

Wow, yea that really was the problem. I had a earlier problem, which stopped me from installing 3.5, but i resettet my machine and reinstalled it and it works now. Thank you!

Marc-Paul avatar Jan 19 '18 09:01 Marc-Paul

@Eskazar great that is works now. Thanks for getting back.

wilhelmberg avatar Jan 19 '18 12:01 wilhelmberg

The same error is happening to me with the lastest version of the Mapbox sdk (2.0) every time i want to play one of the samples or my own. There are normally two of these errors in my console log, but sometimes there are 3, like in the AstronautGame . The following is an example trying to play the AstronautGame Sample.

Plugins: Failed to load 'Assets/Mapbox/Core/Plugins/sqlite/x64/sqlite3.dll' with error 'A dynamic link library (DLL) initialization routine failed '.

  • Mapbox.Platform.Cache.SQLiteCache:openOrCreateDb(String) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs:176)
  • Mapbox.Platform.Cache.SQLiteCache:init() (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs:94)
  • Mapbox.Platform.Cache.SQLiteCache:.ctor(Nullable`1, String) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs:48)
  • Mapbox.Unity.MapboxAccess:ConfigureFileSource() (at Assets/Mapbox/Unity/MapboxAccess.cs:167)
  • Mapbox.Unity.MapboxAccess:SetConfiguration(MapboxConfiguration, Boolean) (at Assets/Mapbox/Unity/MapboxAccess.cs:105)
  • Mapbox.Unity.MapboxAccess:LoadAccessToken() (at Assets/Mapbox/Unity/MapboxAccess.cs:158)
  • Mapbox.Unity.MapboxAccess:.ctor() (at Assets/Mapbox/Unity/MapboxAccess.cs:64)
  • Mapbox.Unity.MapboxAccess:get_Instance() (at Assets/Mapbox/Unity/MapboxAccess.cs:39)
  • Mapbox.Examples.AstronautDirections:Awake() (at Assets/Mapbox/Examples/2_AstronautGame/AstronautGame/Astronaut/AstronautDirections.cs:21)

Plugins: Failed to load 'Assets/Mapbox/Core/Plugins/sqlite/x64/sqlite3.dll' with error 'A dynamic link library (DLL) initialization routine failed. '.

  • SQLite4Unity3d.SQLiteConnection:.ctor(String, SQLiteOpenFlags, Boolean) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/SQLite/SQLite.cs:200)
  • Mapbox.Platform.Cache.SQLiteCache:openOrCreateDb(String) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs:176)
  • Mapbox.Platform.Cache.SQLiteCache:init() (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs:94)
  • Mapbox.Platform.Cache.SQLiteCache:.ctor(Nullable`1, String) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs:48)
  • Mapbox.Unity.MapboxAccess:ConfigureFileSource() (at Assets/Mapbox/Unity/MapboxAccess.cs:167)
  • Mapbox.Unity.MapboxAccess:SetConfiguration(MapboxConfiguration, Boolean) (at Assets/Mapbox/Unity/MapboxAccess.cs:105)
  • Mapbox.Unity.MapboxAccess:LoadAccessToken() (at Assets/Mapbox/Unity/MapboxAccess.cs:158)
  • Mapbox.Unity.MapboxAccess:.ctor() (at Assets/Mapbox/Unity/MapboxAccess.cs:64)
  • Mapbox.Unity.MapboxAccess:get_Instance() (at Assets/Mapbox/Unity/MapboxAccess.cs:39)
  • Mapbox.Examples.AstronautDirections:Awake() (at Assets/Mapbox/Examples/2_AstronautGame/AstronautGame/Astronaut/AstronautDirections.cs:21)

DllNotFoundException: sqlite3

  • SQLite4Unity3d.SQLiteConnection..ctor (System.String databasePath, SQLite4Unity3d.SQLiteOpenFlags openFlags, System.Boolean storeDateTimeAsTicks) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/SQLite/SQLite.cs:200)
  • Mapbox.Platform.Cache.SQLiteCache.openOrCreateDb (System.String dbName) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs:176)
  • Mapbox.Platform.Cache.SQLiteCache.init () (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs:94)
  • Mapbox.Platform.Cache.SQLiteCache..ctor (System.Nullable`1[T] maxTileCount, System.String dbName) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs:48)
  • Mapbox.Unity.MapboxAccess.ConfigureFileSource () (at Assets/Mapbox/Unity/MapboxAccess.cs:167)
  • Mapbox.Unity.MapboxAccess.SetConfiguration (Mapbox.Unity.MapboxConfiguration configuration, System.Boolean throwExecptions) (at Assets/Mapbox/Unity/MapboxAccess.cs:105)
  • Mapbox.Unity.MapboxAccess.LoadAccessToken () (at Assets/Mapbox/Unity/MapboxAccess.cs:158)
  • Mapbox.Unity.MapboxAccess..ctor () (at Assets/Mapbox/Unity/MapboxAccess.cs:64)
  • Mapbox.Unity.MapboxAccess.get_Instance () (at Assets/Mapbox/Unity/MapboxAccess.cs:39)
  • Mapbox.Examples.AstronautDirections.Awake () (at Assets/Mapbox/Examples/2_AstronautGame/AstronautGame/Astronaut/AstronautDirections.cs:21)

Plugins: Failed to load 'Assets/Mapbox/Core/Plugins/sqlite/x64/sqlite3.dll' with error 'A dynamic link library (DLL) initialization routine failed. '.

  • SQLite4Unity3d.SQLiteConnection:Dispose(Boolean) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/SQLite/SQLite.cs:1567)
  • SQLite4Unity3d.SQLiteConnection:Finalize() (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/SQLite/SQLite.cs:1556)

DllNotFoundException: sqlite3

  • SQLite4Unity3d.SQLiteConnection..ctor (System.String databasePath, SQLite4Unity3d.SQLiteOpenFlags openFlags, System.Boolean storeDateTimeAsTicks) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/SQLite/SQLite.cs:200)
  • Mapbox.Platform.Cache.SQLiteCache.openOrCreateDb (System.String dbName) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs:176)
  • Mapbox.Platform.Cache.SQLiteCache.init () (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs:94)
  • Mapbox.Platform.Cache.SQLiteCache..ctor (System.Nullable`1[T] maxTileCount, System.String dbName) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs:48)
  • Mapbox.Unity.MapboxAccess.ConfigureFileSource () (at Assets/Mapbox/Unity/MapboxAccess.cs:167)
  • Mapbox.Unity.MapboxAccess.SetConfiguration (Mapbox.Unity.MapboxConfiguration configuration, System.Boolean throwExecptions) (at Assets/Mapbox/Unity/MapboxAccess.cs:105)
  • Mapbox.Unity.MapboxAccess.LoadAccessToken () (at Assets/Mapbox/Unity/MapboxAccess.cs:158)
  • Mapbox.Unity.MapboxAccess..ctor () (at Assets/Mapbox/Unity/MapboxAccess.cs:64)
  • Mapbox.Unity.MapboxAccess.get_Instance () (at Assets/Mapbox/Unity/MapboxAccess.cs:39)
  • Mapbox.Unity.Map.AbstractMap+d__69.MoveNext () (at Assets/Mapbox/Unity/Map/AbstractMap.cs:421)
  • UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
  • UnityEngine.MonoBehaviour:StartCoroutine(String)
  • Mapbox.Unity.Map.AbstractMap:Start() (at Assets/Mapbox/Unity/Map/AbstractMap.cs:412)

DllNotFoundException: sqlite3

  • SQLite4Unity3d.SQLiteConnection..ctor (System.String databasePath, SQLite4Unity3d.SQLiteOpenFlags openFlags, System.Boolean storeDateTimeAsTicks) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/SQLite/SQLite.cs:200)
  • Mapbox.Platform.Cache.SQLiteCache.openOrCreateDb (System.String dbName) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs:176)
  • Mapbox.Platform.Cache.SQLiteCache.init () (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs:94)
  • Mapbox.Platform.Cache.SQLiteCache..ctor (System.Nullable`1[T] maxTileCount, System.String dbName) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs:48)
  • Mapbox.Unity.MapboxAccess.ConfigureFileSource () (at Assets/Mapbox/Unity/MapboxAccess.cs:167)
  • Mapbox.Unity.MapboxAccess.SetConfiguration (Mapbox.Unity.MapboxConfiguration configuration, System.Boolean throwExecptions) (at Assets/Mapbox/Unity/MapboxAccess.cs:105)
  • Mapbox.Unity.MapboxAccess.LoadAccessToken () (at Assets/Mapbox/Unity/MapboxAccess.cs:158)
  • Mapbox.Unity.MapboxAccess..ctor () (at Assets/Mapbox/Unity/MapboxAccess.cs:64)
  • Mapbox.Unity.MapboxAccess.get_Instance () (at Assets/Mapbox/Unity/MapboxAccess.cs:39)
  • Mapbox.Unity.Map.AbstractMap.InitializeMap (Mapbox.Unity.Map.MapOptions options) (at Assets/Mapbox/Unity/Map/AbstractMap.cs:534)
  • Mapbox.Unity.Map.AbstractMap.SetUpMap () (at Assets/Mapbox/Unity/Map/AbstractMap.cs:463)
  • Mapbox.Unity.Map.AbstractMap.Initialize (Mapbox.Utils.Vector2d latLon, System.Int32 zoom) (at Assets/Mapbox/Unity/Map/AbstractMap.cs:293)
  • Mapbox.Unity.Map.InitializeMapWithLocationProvider.LocationProvider_OnLocationUpdated (Mapbox.Unity.Location.Location location) (at Assets/Mapbox/Unity/Map/InitializeMapWithLocationProvider.cs:30)
  • Mapbox.Unity.Location.AbstractLocationProvider.SendLocation (Mapbox.Unity.Location.Location location) (at Assets/Mapbox/Unity/Location/AbstractLocationProvider.cs:26)
  • Mapbox.Unity.Location.AbstractEditorLocationProvider+d__6.MoveNext () (at Assets/Mapbox/Unity/Location/AbstractEditorLocationProvider.cs:40)
  • UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)

And before you ask: Unity version: 2018.3.9 Scripting Runtume Version: .NET 4.x Equivalent Scripting Backend: Mono API compatibility level: .NET 4.X The platform you're building to: Android

What's odd is that i installed the same sdk with the same steps (Assets -> Import Package -> Custom Package) and (Mapbox -> Setup -> Access Token), with little to no variation with another computer i have and there was no problem in there. Please let me know if there is a fix for that.

PD: Yes, i tried changing the network i'm connecting on and the tokens. So far, no success. Edit: typo fixed

Alvarden15 avatar Mar 22 '19 18:03 Alvarden15

By the way, i forgot to ask: When will be available the newest version of MapBox?

Alvarden15 avatar Apr 08 '19 20:04 Alvarden15

What's the preferred fix for this? Some of our end users have had this issue because .NET 3.5 framework is not installed on Windows 10 by default. We do not want to instruct our users to install .NET 3.5.

Naphier avatar May 15 '19 15:05 Naphier