Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find type "SQLite" in the current scope. #174

Open
danieldantedev opened this issue Apr 11, 2024 · 14 comments
Open

Could not find type "SQLite" in the current scope. #174

danieldantedev opened this issue Apr 11, 2024 · 14 comments
Labels
bug Something isn't working

Comments

@danieldantedev
Copy link

Environment:

  • OS:
  • Godot version: <4.2>
  • godot-sqlite version: <4.3>

Issue description:
when you put the plugin on Godot, create a node, put a script and simply put-> var db : SQLite, it says that "Could not find type "SQLite" in the current scope." i thought that i was doing something wrong, but when i open up the demo from this github, it happens the exact same, so i thought, oh i must have forgotten to click the plugin switch to "on", so i did that, and it changes nothing, i dont know what is going on, can someone help?

Steps to reproduce:
put the plugin on Godot, create a node, put a script and simply put-> var db : SQLite, or var db : SQLite = null or something else similar, you can also just open the demo with a new version of Godot4.2 (gdscript)

thanks

@danieldantedev danieldantedev added the bug Something isn't working label Apr 11, 2024
@2shady4u
Copy link
Owner

Hello, @danieldantedev,

What OS are you using? Are you using the normal version of Godot or the mono C# version?

@danieldantedev
Copy link
Author

Windows 10, i'm using the normal version, i even thought that maybe my Godot was a little bit outdated and did the download again, but it wasn't, i literally open the demo project and i wasnt working just like my project, very very weird.

@jgestiot
Copy link

jgestiot commented Apr 11, 2024 via email

@danieldantedev
Copy link
Author

Don't know if this gonna help but here it is some screenshots of the error using the demo.

@BC-Laboratories
Copy link

@danieldantedev
Experienced same thing for a bit:

Turns out godot-sqlite <4.3> requires Godot 4.2.1, not 4.2, I was using 4.2

Maybe this is the issue for you as well.

image

Although this should fix it, this is probably due to the way the AssetLib is pulling plugin versions, as it let me pull in an unsupported version into Godot.

@danieldantedev
Copy link
Author

unfortunately i'm using 4.2.1 stable, tested with other computer and it works fine, its something to do with my pc i think....

@thefenriswolf
Copy link

thefenriswolf commented Jul 8, 2024

I have the same issue, reinstalling made no difference.
Edit: After reinstalling Godot it suddenly works 🤷‍♂️

@Iscalej
Copy link

Iscalej commented Jul 8, 2024

I had that error when exporting to android, but I disabled armeabi-v7a and x86 as mentioned here and it worked for me with Godot 4.2.2.

@Seradir
Copy link

Seradir commented Oct 5, 2024

Problem also exists with Godot 4.4.dev3, but not with Godot 4.4.dev2 (Win 11, i9-14900HX, RTX 4060 Laptop, godot-sqlite 4.4).

Did some digging:
Both at startup as well as on exit of Godot, Godot seems to remove the extension from .godot/extension_list.cfg. However, if at startup no .godot folder was found or if you just undo the deletion while Godot is running, plugin works perfectly fine, no matter how often you launch the program (tested with demo project).

Here is Git Diff of .godot/extension_list.cfg after starting Godot with existing .godot folder, resp. after exit of Godot:

diff --git a/.godot/extension_list.cfg b/.godot/extension_list.cfg
deleted file mode 100644
index a90dbb9..0000000
--- a/.godot/extension_list.cfg
+++ /dev/null
@@ -1 +0,0 @@
-res://addons/godot-sqlite/gdsqlite.gdextension

Of course, as expected, for Godot 4.4.dev2, .godot/extension_list.cfg stays untouched. So maybe Godot has some problems at (de)initializing the plugin and tries to remove the trouble maker at startup/shutdown?

@htmiel
Copy link

htmiel commented Oct 9, 2024

I just ran into this issue today, and a temporary fix I found is to mark the extension_list.cfg file as read-only while in a correct state.

@austin226
Copy link

Could this be related to godotengine/godot#97900?

@git2013vb
Copy link

I just ran into this issue today, and a temporary fix I found is to mark the extension_list.cfg file as read-only while in a correct state.

It will not work in linux.
My workaround is this one - just because I have a plugin of mine:

    #HACK: workaround 4.4 issue
    var config_file = "res://.godot/extension_list.cfg"
    var content:String = "res://addons/godot-sqlite/gdsqlite.gdextension"
    var file = FileAccess.open(config_file, FileAccess.WRITE)
    file.store_string(content)
    print("Sqlite plugin configuration file created")

When godot start and it will delete the file my plugin will recreate it.
It work

@dueddel
Copy link

dueddel commented Nov 9, 2024

Having the same issue in Godot 4.3 after upgrading the plugin to the latest 4.4 release (Update to Godot 4.3, Add optional FTS5 Extension support). I also tried with Godot's recent dev build 4.4 dev4 (in the hope that mentioned extension_list.cfg bug and therefore this bug will be fixed), but got the same error. Also after disabling the plugin, closing the project, deleting the .godot folder, starting up the project in the editor again, activating the plugin and even reloading the whole project again. Unfortunately no fix or workaround for me.

I just downgraded again to v4.3 which works fine.

EDIT:
💡 Alright, after uninstalling the plugin completely and reinstalling it via the AssetLib (which I didn't do before because I manually downloaded the release from GitHub) it worked. Maybe that's something that others want to try as well.

@Ptkstefano
Copy link

Yea running into this problem as well in Godot 4.3 dev 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests