godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.75k stars 21.12k forks source link

Calling has_method on an Android plugin does not return plugin methods #46673

Open andy-noisyduck opened 3 years ago

andy-noisyduck commented 3 years ago

Godot version: 3.2.3

OS/device including version: Android 11 on Galaxy S10e

Issue description: Calling has_method in script on an Android plugin singleton will not return valid plugin methods, even if they are defined though a GodotPlugin.getPluginMethods override.

Steps to reproduce:

  1. Implement an GodotPlugin Android plugin that has methods returned via getPluginMethods.
  2. Access the plugin singleton through script and call "has_method" for one of the plugin methods. It will return false for valid methods (where it should return true).

Minimal reproduction project: Testing-HasMethodPlugin.zip

To save size, the example project doesn't include the Android custom build template. You will need to regenerate the template after opening the project. To avoid you needing to build and compile a new Android plugin, the example is using the Android IAR plugin from https://github.com/pschw/InAppReview. Min API level is 21 for IARs (higher than Godots 18). You will need to change this in config.gradle.

Calinou commented 3 years ago

Related to #22838.