Android: Current state of Mavhod's Admob module?

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

Just wondering if anyone is successfully using Mavhod’s Admob module with 2.0.3. I followed the instructions from Github and I’m getting errors. It can’t seem to find the Google ads API’s.
Steps I performed, based on instructions here GitHub - Mavhod/GodotAdmob: Module Admob for Godot engine

  1. Downloaded the admob zipped folder from github
  2. Extracted the admob sub-directory as \godot\modules\admob
  3. Moved the file \godot\modules\admob\android\GodotAdMob.java into \godot\platform\android\java\src\org\godotengine\godot
  4. From command-line with VCVARS set up: \godot\platform\android\java>gradlew.bat build

Some of the errors:

H:\dev\godot\src\godot-2.0.3-stable\platform\android\java>gradlew.bat build
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:processDebugJavaRes UP-TO-DATE
:compileDebugJava
H:\dev\godot\src\godot-2.0.3-stable\platform\android\java\src\org\godotengine\godot\GodotAdMob.java:
7: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.*;
^
H:\dev\godot\src\godot-2.0.3-stable\platform\android\java\src\org\godotengine\godot\GodotAdMob.java:
24: error: cannot find symbol
        private AdView          adView                  = null;
                ^
  symbol:   class AdView
  location: class GodotAdMob
H:\dev\godot\src\godot-2.0.3-stable\platform\android\java\src\org\godotengine\godot\GodotAdMob.java:
25: error: cannot find symbol
        private AdView          adViewW                 = null;
                ^
  symbol:   class AdView
  location: class GodotAdMob
H:\dev\godot\src\godot-2.0.3-stable\platform\android\java\src\org\godotengine\godot\GodotAdMob.java:
26: error: cannot find symbol
        private AdView          adViewH                 = null;
                ^
  symbol:   class AdView
  location: class GodotAdMob
:bust_in_silhouette: Reply From: volzhs

Change #env.android_add_java_dir("android/java/src") to env.android_add_java_dir("android") in modules/Admob
And compile android first to update gradlew.bat

scons -j 4 platform=android target=release

You don’t need 3rd step.

Thanks. So I’ve additionally done:

  1. Move GodotAdmob.java back where it was originally
  2. Changed the code in that file as you said above
  3. Run gradlew.bat build again (I’ve built for Android already)

This successfully built java-release-unsigned.apk in build/outputs/apk/.

Then I loaded the demo project testAdmob and did:

  1. Added java-release-unsigned.apk to Custom Package/Release in Android Export options
    (enging.cfg already contains [android]
    modules=“org/godotengine/godot/GodotAdMob”
    )
  2. Set up my release keystore info
  3. Set Signed ON
  4. Turned Debugging Enabled OFF
  5. Changed the code in main.xscn of the testAdmob demo to use my AdMob ad ID
  6. Checked permissions Access Network State and Internet (only)
  7. Exported and installed → crash

Tried on a Nexus 6P running N beta and a Nexus 7 running 6.0.1

Any ideas? :slight_smile:

duke_meister | 2016-06-04 00:03

No idea. I’m using my own admob module.
You need to see adb log what problem is.

volzhs | 2016-06-04 04:16

ok thanks anyway for your time

duke_meister | 2016-06-04 04:47

me too, crashed when app ran.It so discouraged. :frowning:
no idea.

guawoo | 2016-06-04 13:29

I might try another admob module.

duke_meister | 2016-06-04 22:35

:bust_in_silhouette: Reply From: guawoo

DO you install google play services via SDK Manager? please check folders “your_android_sdk\extras\google\google-play-services\libproject\google-play-services_lib” exist. if not, the crash problem is here. download google-play-services from “https://dl-ssl.google.com/android/repository/google_play_services_6587000_r22.zip”, and unzip to “your_android_sdk\extras\google”, replace your google-play-services folder.

now recompile export template.