Skip to content

Unity Support Three Players

Pre-release
Pre-release
Compare
Choose a tag to compare
@borrrden borrrden released this 17 Mar 03:19

This release of Unity support overcomes the multitude of AOT compiler mistakes that I encountered while compiling Couchbase Lite for Unity iOS (though I assume any AOT platform would have had the same problem, so I'm not picking on iOS in particular) and brings support to the following platforms:

Unity Standalone
Unity iOS
Unity Android

To build this project from source you must do the following:

Build the Couchbase.Lite.Unity project, it will contain 8 DLLs that you can use to target the standalone player. 7 of these DLLs are platform independent, but SQLitePCL.raw is platform dependent due to its native bindings. The one you find in the Unity project output will be the desktop version, so in Unity you must set it to only be imported for standalone. The iOS and Android versions are located in the vendor folder of Couchbase.Lite.Net35 (under SQLitePCL). Set those up to be imported only for iOS and Android respectively.

Furthermore, Windows doesn't come preinstalled with SQLite, so the native DLLs need to be deployed. The native sqlite3.dll files are also located in the above mentioned folder (sqlitex86 and sqlitex64 for x86/x64). Make sure those are imported in Unity only for their appropriate architecture.

Things to note: You must build with the Unity .NET 2.0 API compatibility level (subset will not compile, and will throw typeinitializationexceptions and such). You can find this setting under the player settings of each player (it is a shared setting so if you change it once, it changes everywhere). You must also add this string to the AOT compilation options under the iOS player settings: nimt-trampolines=8096

If you encounter any issues please use the issue tracker on GitHub to report them. I have attached a build of this release.