Running a project with custom Android module

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By curious_orange
:warning: Old Version Published before Godot 3 was released.

I am a newbie Godot user and would like to use it for Android game development. I have to use a custom module so recompiled Android export templates accordingly. I replaced the original debug and release apk files (in “templates” folder) with my compiled versions. Not sure of the following:

When running such project inside Godot (before exporting), does it already have access to functions in Android export templates, or does one need to set Android related adb, jarsigner, keystore paths in the Editor Settings for this as well?

The thing is, I get Invalid call error to certain custom functions (not all) before I set these paths. After setting them though, the project freezes at the related function calls. No errors to see this time. If the compiled template was not ok, I think all custom functions would give errors. Confused about the source of such error.

Update: It turns out none of the custom module functions are recognized. The above changed to “Invalid call. Nonexistent function…” after restarting Godot, regardless of setting above path. The compiled export templates evidently work for demo projects (but no custom function calls there). Android exports are fine, but I can’t understand why the custom module is not recognized. Also tried including template apks via Export (Android), Custom Package in Godot. Same result.

:bust_in_silhouette: Reply From: volzhs

First of all, you can use custom android module only when running on android device.

To use android module on android device,
you should define what module to use at Scene > Project Settings.

To define android module,
type android at Category, modules at Property, set Type to String and Click Add button.
Then you can see Android section.
There will be empty at modules filed.
Here is you need to write what module to use like below.
org/godotengine/godot/GodotPaymentV3,com/name/ModuleName,anthoer/module/Name

Sorry for this late reply and thanks. Yes, I was doing as above but the problem turns out the module name has changed recently, which was not updated in the example script. Hence it’s resolved.

curious_orange | 2016-07-18 12:44