-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Can't get Android modules with Engine.get_singleton() anymore #22859
Comments
Definitly the same issue as mine #22932 |
It's not just me then! Thanks all. |
I don't know if this error related to this bug.
version: godot-b05efd98ffe3036b05e501b26ed2ee811161ee11 |
Same for me, added PR #23021 to fix this |
Fixed by #23021. |
I think it again not working. |
Please report this bug to https://github.com/FrogSquare/GodotAds, the issue is in their documentation. You should use |
@akien-mga what did you mean by ProjectSettings? I tried to use Engine.get_singleton and added classes to the project file, but this did not change anything. |
I don't use that module myself, but from my experience, you would need to add the following to your project.godot file (or add it in "Project Settings -> Android -> Modules" in the UI). The readme for your module doesn't mention this.
|
@wombatwingdings it does not work. @akien-mga why Godot has no methods for working with advertising? All engines can do it. |
hey guys. i still have the bug. issnt it fixed jet? |
Yeah im having the exact same problems and have also tried all the various tips above |
@DDru [android] is this correct? - https://screenpresso.com/=010vc |
@ANeller
|
Godot version:
3.1 Alpha commit 0063ba9
OS/device including version:
Android 8 and 7 / Xiaomi MI5 and Galaxy Tab A8 (2016)
Issue description:
I used to call
Engine.has_singleton("SomeModule")
andEngine.get_singleton("SomeModule")
to use Android modules in my game, but a few days ago I pulled the master branch and these two functions stopped behaving as before. I always getFalse
when callingEngine.has_singleton("SomeModule")
and[Object:null]
when callingEngine.get_singleton("SomeModule")
.I don't know too much about Godot's internals or Android, but after debugging a bit I found that this two lines were removed from
platform/android/java_glue.cpp
at the end of the_initialize_java_modules
function:For some reason if I get back the first line (
env->CallStaticObjectMethod(singletonClass, initialize, _godot_instance);
) it gets fixed, but I'm not sure if this is the right solution.Steps to reproduce:
I used the example of this module https://github.com/Shin-NiL/Godot-Share/ as a minimal reproduction project. After moving the module to the
modules
folder and compiling the templates, I rewrote the code in_on_share_btn_pressed
like this:And I get:
False
[Object:null]
I think this would happen with any Android module.
The text was updated successfully, but these errors were encountered: