Shin-NiL / Godot-Android-Admob-Plugin

Android AdMob plugin for Godot Game Engine 3.2 or higher
MIT License
543 stars 66 forks source link

has problem with plugin develop #170

Closed 2439905184 closed 2 years ago

2439905184 commented 3 years ago

*Godot version:3.3.3*

Issue description:

I am a Chinese godot user, admob is may not be a good thing in China ,because the great firewall. So I want to develop an ad plugin in godot 3.3.3. This is called YomobPlugin. But log cat show this :Nonexistent function 'test' in base 'Nil'. when click button. But I got the Plugin. image image this method returned true. So godot 3.3.3 use new api to write plugin with @UsedByGodot instead of getPluginMethods() But I dont't know why it says this plugin object is Nil ."Nonexistent function 'test' in base 'Nil" image I used this simple function . But can't return the string .I learn code from your plugin code

Funmungus commented 2 years ago

There are a few more steps involved. Here is the full documentation on creating a plugin: https://docs.godotengine.org/en/stable/tutorials/platform/android/android_plugin.html

  1. Create an Android library: https://developer.android.com/studio/projects/android-library
  2. Add the Godot library dependency (godot-lib.3.3.3.stable.release.aar)
  3. Create a class extends org.godotengine.godot.plugin.GodotPlugin and implement the code in your snippet.
  4. Update the plugin AndroidManifest.xml file: tag for your plugin name and Java/Kotlin class.
  5. Build plugin library, the artifact is an .aar file, probably YomobPlugin-release.gdap.
  6. Create a Godot Android Plugin configuration file, YomobPlugin.gdap.
  7. In Godot, in the Android export dialog, in the Plugins section, enable YomobPlugin.
2439905184 commented 2 years ago

Thank you. I have finished the plugin now(test ad). In the past, I dont't know some details under what gradle does.