Search Unity

SimpleSQL - SQLite integration with Unity3D

Discussion in 'Assets and Asset Store' started by echo17, Jul 12, 2012.

  1. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,205
    Last edited: Dec 13, 2019
  2. honorlulu

    honorlulu

    Joined:
    Oct 27, 2012
    Posts:
    11
  3. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,535
    Can you sort your loose scripts out, and put them in a proper namespace.. shouldn't need to be said to every asset store developer but eventually one comes across two addons who want to use the same name for a script and then the end user gets the conflict...

    MainMenuButton.cs ...being the case in this instance.

    just noticed another called MainMenu.cs ..I mean common
     
  4. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,205
    Good idea. I'll try to get this in the next service release.
     
  5. unity_60gLK6FiHk2Krg

    unity_60gLK6FiHk2Krg

    Joined:
    Sep 16, 2019
    Posts:
    1
    Hello. I found a behavior that might need to be fixed.

    I found
    T SimpleSQL.SimpleSQLManager.Get< T >(object pk)
    throws InvalidOperationException when specified record is not found, but references saids
    The object with the given primary key. Throws a not found exception if the object is not found
    .

    error code is below. IEnumerable threw error.

    Code (CSharp):
    1. InvalidOperationException: Sequence contains no elements
    2. System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    3. SimpleSQL.SQLiteConnection.Get[T] (System.Object pk) (at <9d351781d88446ec91fb4a6de237d175>:0)
    4. SimpleSQL.SimpleSQLManager.Get[T] (System.Object pk) (at <9d351781d88446ec91fb4a6de237d175>:0)
    5.  
    6. //omit the rest (below is my code)
    I'm grad to you check this if you have time.
     
  6. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,205
    I don't officially support Linq with SimpleSQL, so I don't include reference to that library in my documentation or code examples. Instead, try using the built-in functions of the SimpleSQLManager like Query and QueryFirstRecord. These should be more robust and get you the data that you need.

    As to the error that you are getting, that would seem to be the expected behavior if you do not have a record. I cannot speak for how the .NET developers designed Linq, but it would seem you would want an exception thrown for missing data. You can probably handle this with a try catch or just use the QueryFirstRecord method in SimpleSQLManager (which does provide an out parameter that tells you if the record exists).

    Code (CSharp):
    1. var record = dbManager.QueryFirstRecord<MyORM>(out recordExists, sql);
     
  7. DavidLe360

    DavidLe360

    Joined:
    Dec 24, 2018
    Posts:
    38
    Hi, i have the follow error (it's a conflic with Runtime Editor Asset):
    Assets\Battlehub\UIControls\Menu\Scripts\UIStyle.cs(13,32): error CS1061: 'MainMenuButton' does not contain a definition for 'NormalColor' and no accessible extension method 'NormalColor' accepting a first argument of type 'MainMenuButton' could be found (are you missing a using directive or an assembly reference?)



    'MainMenuButton' does not contain a definition for 'FocusedColor' and no accessible extension method 'FocusedColor' accepting a first argument of type 'MainMenuButton' could be found (are you missing a using directive or an assembly reference?)


    Thanks in advance.
     
  8. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,205
    I plan on adding namespaces to my demo code in the next service release to avoid these conflicts. Until then, you can either add a namespace to the SimpleSQL MainMenuButton code or delete the code entirely. The only purpose it has is to allow you to navigate the demos without having to load each scene individually. You can still play each demo without it.
     
  9. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    Hi,

    My game works on Unity Editor, but when I build the game on Android. It's not working. I have installed the latest version from the Asset Store and I don't know how to fix this.

    Is there any way I can debug SimpleSQL when I run the game on my android device?
     
  10. jacente

    jacente

    Joined:
    Dec 5, 2019
    Posts:
    1
    I had the same problem. Try this:
    Tools > SimpleSQL > Options -> Android
    and then run build.
     
    Last edited: Jan 22, 2020
    Nadan likes this.
  11. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,205
    In addition to the above suggestion by jacente, I would also have a look at these links for advice on debugging on Android:

    https://support.unity3d.com/hc/en-us/articles/205485376-How-do-you-debug-on-Android-
    https://answers.unity.com/questions/1368808/how-to-see-debuglog-when-using-android.html
     
    Nadan likes this.
  12. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    Thank you so much, jacente and echo17! I got it working with a single click of a button. I wish I could always fix my games like this. :)
     
  13. TSI25

    TSI25

    Joined:
    Sep 22, 2013
    Posts:
    11
    After we go through the steps to notarize our build, and only on OSX versions older than Catalina we encounter the following error.

    Code (CSharp):
    1. Uploading Crash Report
    2. DllNotFoundException: Unable to load DLL 'sqlite3': The specified module could not be found.
    3.   at SimpleSQL.SQLiteConnection..ctor (System.String databasePath) [0x00000] in <00000000000000000000000000000000>:0
    We are using Unity 2019.2.21f1, and are using version 2.9.0 of SimpleSQL from the Asset Store. We have IL2CPP selected as our scripting backend and our Api Compatibility Level set to .NET 4.x.

    We aren't seeing anything like this on windows, and if we test prior to notarization everything works just fine. Its worth noting that everything else in the app seems to work just fine after notarization, but it will fail as soon as that call is made to the sqlite3.dll from SimpleSQL.SQLiteConnection. Its also worth noting that after notarization the app works perfectly on Catalina, for whatever reason this only seems to affect older version of OSX for us.

    Does anyone have any thoughts on this?
     
  14. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,205
    The first thing I would try is a different build setting in the Tools > SimpleSQL > Options menu. Try setting it to universal (Mac / PC) and then build again. The universal setting will extract the sqlite3.dll at runtime. The Mac setting does not extract a sqlite3.dll file at runtime since Mac OS has included this by default for a very long time. I'm not sure why you would be getting this error now, however.

    If you already had it on Universal, try the Mac setting instead, then rebuild. Hopefully one of those two settings will help out.
     
  15. Kingtem

    Kingtem

    Joined:
    Jun 19, 2011
    Posts:
    18
    I've got the similar problem on Mac App. I have tried 2019.2.17 and 2019.3.3 and using a runtime debug reporter. Following is the error:
     

    Attached Files:

  16. Kingtem

    Kingtem

    Joined:
    Jun 19, 2011
    Posts:
    18
    Have tried, but this solution doesn't work for me.
    My Mac verison is 10.13.6
     
  17. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,205
    It's possible that newer versions of the sqlite library are no longer compatible with older versions of Mac. You might try downloading an older version of the sqlite library from the sqlite website directly and putting it into your plugins folder of your project. sqlite website can be found here: https://sqlite.org/index.html
     
unityunity