Snowplow unity-tracker 0.6.1 error

Hello everyone,

Since I’ve updated the tracker to version 0.6.1, I get this error every time I launch my project:

TypeLoadException: Could not resolve type with token 0100001e from typeref (expected class ‘LiteDB.ConnectionType’ in assembly ‘LiteDB, Version=5.0.13.0, Culture=neutral, PublicKeyToken=’)

I’m working with Unity 2021.3.0f1.
I used tracker version 0.5.1 and 0.6.0 before and I never had problem.
So, is it normal ? What can I do to avoid this ?

Thanks you

Hi @Mouchhe,

Sorry for the late reply. I have checked the published package and I think the problem is that it contains the wrong version of the LiteDB dependency dll. The release has upgraded the depedency to the version 5.0.13 but it was published with the old version.

I have replaced the published SnowplowTracker.unitypackage file on the Github release. Could you please try with this and check if it helps the problem?

Thanks for reporting the issue!

Hi @matus,

Thank you for your answer. I have updated the package and now I have another error related to the LiteDB when I play the project in Unity. I’ve try to remove/reinstall the package and I have the same:

LiteException: File is not a valid LiteDB database format or contains a invalid password.
LiteDB.Engine.HeaderPage.LoadPage () (at <b4072b183f33479184164e010ad10e74>:0)
LiteDB.Engine.HeaderPage..ctor (LiteDB.Engine.PageBuffer buffer) (at <b4072b183f33479184164e010ad10e74>:0)
LiteDB.Engine.LiteEngine..ctor (LiteDB.Engine.EngineSettings settings) (at <b4072b183f33479184164e010ad10e74>:0)
LiteDB.SharedEngine.OpenDatabase () (at <b4072b183f33479184164e010ad10e74>:0)
LiteDB.SharedEngine.EnsureIndex (System.String collection, System.String name, LiteDB.BsonExpression expression, System.Boolean unique) (at <b4072b183f33479184164e010ad10e74>:0)
LiteDB.LiteCollection`1[T].EnsureIndex (System.String name, LiteDB.BsonExpression expression, System.Boolean unique) (at <b4072b183f33479184164e010ad10e74>:0)
LiteDB.LiteCollection`1[T].EnsureIndex (LiteDB.BsonExpression expression, System.Boolean unique) (at <b4072b183f33479184164e010ad10e74>:0)
SnowplowTracker.Storage.EventStore..ctor (System.String filename, System.Boolean saveUnityInPersistentDataPath) (at <5d44cd38e9c54dcba2225b27d16e231b>:0)
SnowplowTracker.Emitters.AsyncEmitter..ctor (System.String endpoint, SnowplowTracker.Enums.HttpProtocol protocol, SnowplowTracker.Enums.HttpMethod method, System.Int32 sendLimit, System.Int64 byteLimitGet, System.Int64 byteLimitPost, SnowplowTracker.Storage.IStore eventStore) (at <5d44cd38e9c54dcba2225b27d16e231b>:0)

I let you check this error.

Thanks again for the help

Thanks for the report @Mouchhe. That appears like a problem upgrading the event storage database for the new version of the LiteDB package that the 0.6.1 release adopts.

We will work on getting a patch release of the tracker that fixes the problem out very soon.

1 Like

Hi @Mouchhe,

We have published a new patch release of the Unity tracker, 0.6.2, that addresses the problem that you encountered.

It configures the LiteDB dependency used for event storage to upgrade the database from previous versions when it is opened. That should take care of the exception that you encountered.

Hope that fixes the problem!

2 Likes

Hi,

It seems to work correctly now :slight_smile:
Well done!

Thank you for your reactivity and good luck for the continuation

2 Likes

Hi @matus,

I come back to you again because I have tested on android and I have an error when excuting. I removed totally the app and install it again but I have this error:

NotSupportedException: Specified method is not supported.
at System.Threading.Mutex..ctor (System.Boolean initiallyOwned, System.String name) [0x00000] in <00000000000000000000000000000000>:0 
at LiteDB.SharedEngine..ctor (LiteDB.Engine.EngineSettings settings) [0x00000] in <00000000000000000000000000000000>:0 
at LiteDB.ConnectionString.CreateEngine () [0x00000] in <00000000000000000000000000000000>:0 
at LiteDB.LiteDatabase..ctor (LiteDB.ConnectionString connectionString, LiteDB.BsonMapper mapper) [0x00000] in <00000000000000000000000000000000>:0 
at SnowplowTracker.Storage.EventStore..ctor (System.String filename, System.Boolean saveUnityInPersistentDataPath) [0x00000] in <00000000000000000000000000000000>:0 

More info:

System.PlatformNotSupportedException: Shared mode is not supported in platforms that do not implement named mutex. ---> System.NotSupportedException: Specified method is not supported.

It’s when I initialize the tracker. It seems good on iOS target.

Do you think there is still a problem on the tracker ?

Thanks again for reporting the problem @Mouchhe!

I was able to reproduce the problem and found out that it’s caused by the fact that the tracker tries to estabilish a shared connection type to the LiteDB database for event storage which requires support for named mutexes in the system. However, it appears that this causes problems on Android.

We will publish a quick patch release that avoids creating the shared connection and instead uses direct database connection (as we already do on iOS).

1 Like

@Mouchhe we have just released a new patch version of the Unity tracker, 0.6.3, that fixes the problem with the shared database connection on Android. You can download it here.

I hope that takes care of the problems with using the tracker, but please let us know if you come across any other issues!

2 Likes

Thank you, no more errors on Android with this new version :+1:

2 Likes