[iOS & Android] AdMob Extension [3.0]

QkyGames

  • Posts: 125
Hi,

I get the next error.

Quote
-compile:
[ERR] java.lang.NullPointerException
[LOG]     [javac] Compiling 18 source files to J:\StencylWorks\stencylworks\games-generated\Sketch Assault Android\Export\android\bin\bin\classes
[LOG] Unexpected problem on thread AWT-EventQueue-0: null
[LOG]     [javac] J:\StencylWorks\stencylworks\games-generated\Sketch Assault Android\Export\android\bin\src\AdWhirl.java:77: error: AdRequest() has private access in AdRequest
[LOG]     [javac]              AdRequest adRequest = new AdRequest();
[LOG]     [javac]                                    ^
[ERR] java.lang.NullPointerException
[LOG]     [javac] J:\StencylWorks\stencylworks\games-generated\Sketch Assault Android\Export\android\bin\src\AdWhirl.java:136: error: AdRequest() has private access in AdRequest
[LOG]     [javac]             AdRequest adRequest = new AdRequest();
[ERR] java.lang.NullPointerException
[LOG]     [javac]                                   ^
[LOG] Unexpected problem on thread AWT-EventQueue-0: null
[LOG]     [javac] Note: Some input files use or override a deprecated API.
[LOG]     [javac] Note: Recompile with -Xlint:deprecation for details.
[LOG]     [javac] 2 errors
[LOG] BUILD FAILED
[LOG] J:\StencylWorks\stencylworks\android-sdk\android-sdk-windows\tools\ant\build.xml:720: The following error occurred while executing this line:
[LOG] J:\StencylWorks\stencylworks\android-sdk\android-sdk-windows\tools\ant\build.xml:734: Compile failed; see the compiler error output for details.
[LOG] Total time: 5 seconds
[LOG] Finished building for Android (or errored out): 1

I followed these steps, but nothing changes
Quote
-disable the extension
-save game and close stencyl
-delete the admob file from your stencyl workspace - engine extensions and also the one in your installation path
-reinstall the extension
-delete this two lines of the include.nmml file in plaf-haxe-extensions- ads (the one in the workspace and the other one like before):
         <java path="project/android" />
         <template path="template/android/libs/GoogleAdMobAdsSdk-4.0.3.jar" rename="libs/GoogleAdMobAdsSdk-4.0.3.jar" if="android"/>
-reopen your game, enable the extension like always (closing and saving) and it sould work now.

Regards.
Maxi.

Abliblablobla

  • *
  • Posts: 524
Hi QkyGames,
Follow these steps to solve the issue.

Thanks, you have the same issue as Spuller and you have to go through the same process.

@Spuller,
In your case, Stencyl is trying to use an old version of the AdMob SDK. To fix this error, do a clean install of Stencyl. To do a clean install you have to uninstall/delete your current version of Stencyl, download the latest private release and install it. Do NOT install the latest version of Stencyl over your existing one! After you have done a clean install of Stencyl, use Run > Clean Project. This should fix your issue.
.: BuruBuru :.

madscs

  • Posts: 39
My game won't compile when I use this extension, it works fine with just the regular banner ad that stencyl provides for you easily, but I can't get the interstitial ad to work with this extension?

I tried doing some of the suggestions for earlier posts here, but no luck yet.

Generated logs too, thanks in advance :)

Abliblablobla

  • *
  • Posts: 524
So if you disable this extension, you can compile your game without issues? Which platform are you targeting (iOS or Android)? Could you post a screenshot of the behavior you are using for interstitial ads?
.: BuruBuru :.

madscs

  • Posts: 39
The game compiles without any problems at all with the extension disabled (It works fine with the built in Stencyl ad (Settings -> Mobile -> Monetization).

I only target android.

Screenshot attached - I know you can't see the device ID but it is inputted as well though :)

Edit: I got it to work now with the Stencyl build 7825, I tried installing it before but it didn't work. I tried it again today and it works now for some reason. :)

« Last Edit: September 14, 2014, 12:07:08 pm by madscs »

djngam

  • Posts: 63
hi guys i know this might sound like a really noob question.  but how do i put in the extension? theres a lot of files in the admob zip. :/ sorry!

djngam

  • Posts: 63
i have tried to go to settings>extensions>chose the admob.zip file. but nothing happens.  :/

Abliblablobla

  • *
  • Posts: 524
hi guys i know this might sound like a really noob question.  but how do i put in the extension? theres a lot of files in the admob zip. :/ sorry!
Read this quick guide. http://community.stencyl.com/index.php/topic,30432.0.html

i have tried to go to settings>extensions>chose the admob.zip file. but nothing happens.  :/
When you install an extension you should be able to see it in Settings > Extensions. After you have enabled it, you should be able to see the blocks f the extension in the "Extension" tab of the blocks palette.

And do NOT post multiple help requests all over the forums! You have to understand that it may take some time for other users to answer your question.
.: BuruBuru :.

ManlyMouse

  • Posts: 144
Just fixed it right now... i repeated several times the steps mentioned above and now it compiled well.

if anyone have the same issue just try this steps:

-disable the extension
-save game and close stencyl
-delete the admob file from your stencyl workspace - engine extensions and also the one in your installation path
-reinstall the extension
-delete this two lines of the include.nmml file in plaf-haxe-extensions- ads (the one in the workspace and the other one like before):
         <java path="project/android" />
         <template path="template/android/libs/GoogleAdMobAdsSdk-4.0.3.jar" rename="libs/GoogleAdMobAdsSdk-4.0.3.jar" if="android"/>
-reopen your game, enable the extension like always (closing and saving) and it sould work now.

i must add that i didnt test if the ads or the blocks work correctly, i just tested that my game compiles succesfully when the extension is enabled.

Has there been a fix for this?

to expand: I currently have Stencyl 3.1. I cannot compile my games because i get the same errors that luismp does. Would it work for me if I download the latest stencyl private release?

« Last Edit: September 30, 2014, 09:58:47 am by ManlyMouse »
I know more about Stencyl now.

Abliblablobla

  • *
  • Posts: 524
Just fixed it right now... i repeated several times the steps mentioned above and now it compiled well.

if anyone have the same issue just try this steps:

-disable the extension
-save game and close stencyl
-delete the admob file from your stencyl workspace - engine extensions and also the one in your installation path
-reinstall the extension
-delete this two lines of the include.nmml file in plaf-haxe-extensions- ads (the one in the workspace and the other one like before):
         <java path="project/android" />
         <template path="template/android/libs/GoogleAdMobAdsSdk-4.0.3.jar" rename="libs/GoogleAdMobAdsSdk-4.0.3.jar" if="android"/>
-reopen your game, enable the extension like always (closing and saving) and it sould work now.

i must add that i didnt test if the ads or the blocks work correctly, i just tested that my game compiles succesfully when the extension is enabled.

Has there been a fix for this?

to expand: I currently have Stencyl 3.1. I cannot compile my games because i get the same errors that luismp does. Would it work for me if I download the latest stencyl private release?

It was fixed on June 20th but many users are still having some issues because you need to do a clean install of Stencyl to get it working properly. To do a clean install, unistall/delete your current version of Stencyl from your computer, download the latest private release and install it.
.: BuruBuru :.

ManlyMouse

  • Posts: 144
Yes after downloading the latest build (and fixing many, many bugs) I got the admobs extension working. Thanks again!
I know more about Stencyl now.

kaintid

  • Posts: 2
Hi, I downloaded this extension and installed it.  The issue is that I'm not getting any blocks for this extension in the extension pallete.  I have the extension enabled.

SolDiez

  • Posts: 33
Hi! I have an error. The game compiles just fine, but closes as soon as a scene opens. This happened around the time I updated to build 7917, and still happens with 7918.
I tried doing a clean uninstall, I reinstalled stencyl, cleaned the project, but this still happens. I was about to release my game, and now I can't. Any manual fix for this for the time being?

From the logfile:
Code: [Select]
2014-10-29 16:33:03,054 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): FATAL EXCEPTION: main
2014-10-29 16:33:03,058 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): Process: com.hgmobileapps.impossiblemario, PID: 16618
2014-10-29 16:33:03,065 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 6111000 but found 4323000.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
2014-10-29 16:33:03,070 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at com.google.android.gms.common.GooglePlayServicesUtil.E(Unknown Source)
2014-10-29 16:33:03,074 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
2014-10-29 16:33:03,078 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at com.google.android.gms.internal.au.a(Unknown Source)
2014-10-29 16:33:03,082 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: I/GAV2    (16594): Thread[GAThread,5,main]: No campaign data found.
2014-10-29 16:33:03,083 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: W/ActivityManager(  544): Activity pause timeout for ActivityRecord{42cbe430 u0 com.hgmobileapps.impossiblemario/.MainActivity t115 f}
2014-10-29 16:33:03,084 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at com.google.android.gms.internal.bh.bi(Unknown Source)
2014-10-29 16:33:03,091 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at com.google.android.gms.internal.bh.a(Unknown Source)
2014-10-29 16:33:03,095 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at com.google.android.gms.ads.AdView.loadAd(Unknown Source)
2014-10-29 16:33:03,100 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at com.abliblablobla.AdMob.MyAdmob$1.run(MyAdmob.java:68)
2014-10-29 16:33:03,104 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at android.os.Handler.handleCallback(Handler.java:733)
2014-10-29 16:33:03,108 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at android.os.Handler.dispatchMessage(Handler.java:95)
2014-10-29 16:33:03,115 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at android.os.Looper.loop(Looper.java:136)
2014-10-29 16:33:03,120 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at android.app.ActivityThread.main(ActivityThread.java:5001)
2014-10-29 16:33:03,124 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at java.lang.reflect.Method.invokeNative(Native Method)
2014-10-29 16:33:03,129 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at java.lang.reflect.Method.invoke(Method.java:515)
2014-10-29 16:33:03,134 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
2014-10-29 16:33:03,140 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
2014-10-29 16:33:03,145 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
2014-10-29 16:33:03,149 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: E/AndroidRuntime(16618): at dalvik.system.NativeStart.main(Native Method)
2014-10-29 16:33:03,154 INFO  [Thread-9] stencyl.sw.util.StreamGobbler: W/ActivityManager(  544):   Force finishing activity com.hgmobileapps.impossiblemario/.MainActivity

SolDiez

  • Posts: 33
Ok, I manually fixed this by changing the version directly in the extension's manifest in: \Stencyl\stencylworks\engine-extensions\admob\dependencies\myadmob

Max Finch

  • *
  • Posts: 2174
I too have erased stencyl, cleaned my project, done a fresh install of stencyl, and the game crashes on my iPhone and doesn't seem to want to build on my Nexus.


I also tried the above post solution to his problem and it didn't work for me.


Edit: It's a problem with how admob is initialized.