Engine.has_singleton() can't find plugin

Godot Version

4.4.1

Question

I am trying to get this template plugin to work GitHub - m4gr3d/Godot-Android-Plugin-Template: This repository serves as a quickstart template for building a Godot Android plugin for Godot 4.2+. , with the goal of modifying it to my purpose later.
I’ve managed to compile it after changing some version numbers in the code, and I’ve added the content of the addons folder to my addons folder in my Godot project. I’ve also enabled the plugin in the settings.
But when I try to access the plugin, Engine.has_singleton(_plugin_name) returns false.
Any idea why that would be. I tried it with GitHub - leparlon/ToastPlugin: Toast Plugin for Godot too, to the same result.

I have this code in my root Node2D:

## Interface used to access the functionality provided by this plugin

var _plugin_name = "GodotAndroidPluginFitSteps"
var _plugin_singleton

func _init():
	if Engine.has_singleton(_plugin_name):
		_plugin_singleton = Engine.get_singleton(_plugin_name)
		$Label.text = "It works"
	else:
		printerr("Initialization error: unable to access the java logic")
	

## Shows a 'Hello World' toast.
func helloWorld():
	if _plugin_singleton:
		_plugin_singleton.helloWorld()
	else:
		printerr("Initialization error")`

I’ve found the issue! I misunderstood the line

Make sure subdirectories under plugin/src/main/java match the updated package name

in the instructions, resulting in a plugin that didn’t have the correct file architecture.