poingstudios / godot-admob-plugin

This repository is for Godot's Addons to integrate natively AdMob to your Game Project without much configurations and directly inside Godot Editor!
https://poingstudios.github.io/godot-admob-plugin/
MIT License
276 stars 22 forks source link

Parse Error: Function "get_plugin_version()" not found in base self #116

Closed code-with-max closed 7 months ago

code-with-max commented 7 months ago

Godot version

v4.1.3.stable.official

Plugin version

v3.0.2

System information

Ubuntu 23.10

Phone information, if applicable

No response

Issue description

Plugins versions 3.0.2 and 3.0.1 crashes with same errors: Parse Error: Function "get_plugin_version()" not found in base self

3.0.2 installed from Godot asset lib, 3.0.1 downloaded from GitHub and installed manually. Version 3.0.0 work done.

Steps to reproduce

  1. Update plugin to version 3.0.2 or 3.0.1 and see output on start Godot:
Godot Engine v4.1.3.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
  modules/gltf/register_types.cpp:73 - Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
--- Debug adapter server started ---
--- GDScript language server started ---
  res://addons/admob/admob.gd:34 - Parse Error: Function "get_plugin_version()" not found in base self.
  res://addons/admob/admob.gd:34 - Parse Error: Cannot infer the type of "plugin_version" variable because the value doesn't have a set type.
  res://addons/admob/admob.gd:105 - Parse Error: Function "get_plugin_version()" not found in base self.
  res://addons/admob/admob.gd:182 - Parse Error: Function "get_plugin_version()" not found in base self.

Additional context

I don`t see way for extends PoingAdMobVersionHelper class in admob.gd (for use in line 34)

gumaciel commented 7 months ago

Hi please try to download it again, it must be fixed on v3.0.2:

https://github.com/Poing-Studios/godot-admob-plugin/archive/refs/tags/v3.0.2.zip

After updating the plugin reload the Godot Engine

code-with-max commented 7 months ago

The problem partially remained. The addon is now running, but still does not use the PoingAdMobVersionHelper class

Godot Engine v4.1.3.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
  modules/gltf/register_types.cpp:73 - Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
--- Debug adapter server started ---
--- GDScript language server started ---
  res://addons/admob/admob.gd:34 - Parse Error: Identifier "PoingAdMobVersionHelper" not declared in the current scope.
  res://addons/admob/admob.gd:34 - Parse Error: Cannot infer the type of "plugin_version" variable because the value doesn't have a set type.

As a temporary solution I made in admob.gd string:

var PoingAdMobVersionHelper = preload("res://addons/admob/version_helper.gd")

To explicitly load this script. In this case, everything works and downloading plugins becomes possible.

gumaciel commented 7 months ago

Try to delete everything and then install, try to do it on an empty project

code-with-max commented 7 months ago

I need more time for it.

code-with-max commented 7 months ago

@gumaciel with new project its working done. Thanks.

I really hope I can get back to work on this using the new version of Godot https://docs.godotengine.org/en/latest/tutorials/platform/android/android_plugin.html#introduction