• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

AIR Admob ANE issue #3500: The extension context does not have a method with the name cacheInterstitial

Explorer ,
Oct 05, 2017 Oct 05, 2017

Copy link to clipboard

Copied

I'm trying to make google adverts in my game.I use Pozirk Ane admob.I added library files and ane on Actionscript 3 settings. When I test Debug and I got this error.

ANE Link

https://github.com/pozirk/ANEAdMob

I couldn't figure out where is the error.

The error

[SWF] com.pozirk.ads.AdMob - 7065 bytes after decompression
  
[SWF] Testreklam.swf - 45613 bytes after decompression
  
ArgumentError: Error #3500: The extension context does not have a method with the name cacheInterstitial.
  at flash
.external::ExtensionContext/_call()
  at flash
.external::ExtensionContext/call()
  at com
.pozirk.ads.admob::AdMob/cacheInterstitial()[D:\Pozirk\_projects\ANEAdMob\air\AdMob\com\pozirk\ads\admob\AdMob.as:83]
  at
Main()[C:\APK\Reklam\Main.as:43]
  at runtime
::ContentPlayer/loadInitialContent()
  at runtime
::ContentPlayer/playRawContent()
  at runtime
::ContentPlayer/playContent()
  at runtime
::AppRunner/run()
  at
ADLAppEntry/run()
  at global
/runtime::ADLEntry()

My Main.as code

package  {

  
import flash.display.MovieClip;
  
import com.pozirk.ads.admob.AdMob;
  
import com.pozirk.ads.admob.AdParams;
  
import com.pozirk.ads.admob.AdEvent;
  
import flash.events.MouseEvent;

  
public class Main extends MovieClip {
  
private var _bannerAdUID:String = "ca-app-pub-3940256099942544/6300978111";//BÄ°ZÄ°MDEGÄ°L
  
private var _intersAdUID:String = "ca-app-pub-4769962435850149/5055329136";
  
protected var _banner:AdMob = new AdMob();
  
protected var _inters:AdMob = new AdMob();
  
private var _initOK:Boolean = false;
  
private var _isShow:Boolean = false;
  
private var _cacheOK:Boolean = false;  

  
public function Main() {
  
// constructor code
  btBanner
.addEventListener(MouseEvent.CLICK, showBanner);
  btInters
.addEventListener(MouseEvent.CLICK, showInterstitial);

  _banner
.init();
_banner
.addEventListener(AdEvent.INIT_OK, onInitEvent);
_banner
.addEventListener(AdEvent.INIT_FAIL, onEvent);
_banner
.addEventListener(AdEvent.BANNER_SHOW_OK, onEvent);
_banner
.addEventListener(AdEvent.BANNER_SHOW_FAIL, onEvent);
_banner
.addEventListener(AdEvent.BANNER_LEFT_APP, onEvent);
_banner
.addEventListener(AdEvent.BANNER_OPENED, onEvent);
_banner
.addEventListener(AdEvent.BANNER_CLOSED, onEvent);

_inters
.init();
_inters
.addEventListener(AdEvent.INIT_OK, onInitEvent);
_inters
.addEventListener(AdEvent.INIT_FAIL, onEvent);
_inters
.addEventListener(AdEvent.INTERSTITIAL_SHOW_OK, onEvent);
_inters
.addEventListener(AdEvent.INTERSTITIAL_SHOW_FAIL, onEvent);
_inters
.addEventListener(AdEvent.INTERSTITIAL_CACHE_OK, onCacheEvent);
_inters
.addEventListener(AdEvent.INTERSTITIAL_CACHE_FAIL, onEvent);
_inters
.addEventListener(AdEvent.INTERSTITIAL_LEFT_APP, onEvent);
_inters
.addEventListener(AdEvent.INTERSTITIAL_OPENED, onEvent);
_inters
.addEventListener(AdEvent.INTERSTITIAL_CLOSED, onCloseIntersEvent);

_inters
.cacheInterstitial(_intersAdUID);
  
}


  
protected function onEvent(event:AdEvent😞void {

}

protected function onInitEvent(event:AdEvent😞void {
  _initOK
= true;
}

protected function onCacheEvent(event:AdEvent😞void {
  _cacheOK
= true;
}

protected function onCloseIntersEvent(event:AdEvent😞void {
  _inters
.cacheInterstitial(_intersAdUID);
}


////////////


private function showBanner(e:MouseEvent😞void {
  
if(_initOK) {
  
if(!_isShow) {
  _banner
.show(_bannerAdUID, AdParams.SIZE_SMART_BANNER, AdParams.HALIGN_CENTER, AdParams.VALIGN_BOTTOM);
  _isShow
= true;
  
}else {
  _banner
.hide();
  _isShow
= false;
  
}
  
} else {
  trace
("Banner Not Ready.");
  
}
}

private function showInterstitial(e:MouseEvent😞void {
  
if(_initOK && _cacheOK) {
  _inters
.showInterstitial();
  
} else {
  trace
("Inters Not Ready.");
  
}
}









  
}

}

APP XML file code

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<application xmlns="http://ns.adobe.com/air/application/24.0">
 
<id>Testreklam</id>
 
<versionNumber>1.0.0</versionNumber>
 
<versionLabel/>
 
<filename>Testreklam</filename>
 
<description/>
<!-- To localize the description, use the following format for the description element.<description><text xml:lang="en">English App description goes here</text><text xml:lang="fr">French App description goes here</text><text xml:lang="ja">Japanese App description goes here</text></description>-->
 
<name>Testreklam</name>
<!-- To localize the name, use the following format for the name element.<name><text xml:lang="en">English App name goes here</text><text xml:lang="fr">French App name goes here</text><text xml:lang="ja">Japanese App name goes here</text></name>-->
 
<copyright/>
 
<initialWindow>
  
<content>Testreklam.swf</content>
  
<systemChrome>standard</systemChrome>
  
<transparent>false</transparent>
  
<visible>true</visible>
  
<fullScreen>true</fullScreen>
  
<aspectRatio>portrait</aspectRatio>
  
<renderMode>direct</renderMode>
  
<autoOrients>false</autoOrients></initialWindow>
 
<icon>
  
<image72x72>AppIconsForPublish/Medal-2-icon.png</image72x72>
 
</icon>
 
<customUpdateUI>false</customUpdateUI>
 
<allowBrowserInvocation>false</allowBrowserInvocation>
 
<android>
  
<manifestAdditions>
  
<![CDATA[<manifest><uses-permission android:name="android.permission.INTERNET"/><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/><application>
<meta-data android:name="com.google.android.gms.version" android:value="4323000" /> <!-- should be android:value="@integer/google_play_services_version" --> <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application></manifest>]]>
  
</manifestAdditions>
  
</android>
 
<versionLabel> </versionLabel>
 
<extensions>
  
<extensionID>com.pozirk.ads.AdMob</extensionID>
 
</extensions>
</application>

TOPICS
ActionScript

Views

2.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 05, 2017 Oct 05, 2017

Copy link to clipboard

Copied

are you testing on an android device (not a simulator)?

(and your code is unreadable.)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 05, 2017 Oct 05, 2017

Copy link to clipboard

Copied

Everything is well in to edit mode but here as you say unreadable.I can't edit because edit button is gone.

Error

  [SWF] com.pozirk.ads.AdMob - 7065 bytes after decompression
  
[SWF] Testreklam.swf - 45613 bytes after decompression
  
ArgumentError: Error #3500: The extension context does not have a method with the name cacheInterstitial.
  at flash
.external::ExtensionContext/_call()
  at flash
.external::ExtensionContext/call()
  at com
.pozirk.ads.admob::AdMob/cacheInterstitial()[D:\Pozirk\_projects\ANEAdMob\air\AdMob\com\pozirk\ads\admob\AdMob.as:83]
  at
Main()[C:\APK\Reklam\Main.as:43]
  at runtime
::ContentPlayer/loadInitialContent()
  at runtime
::ContentPlayer/playRawContent()
  at runtime
::ContentPlayer/playContent()
  at runtime
::AppRunner/run()
  at
ADLAppEntry/run()
  at global
/runtime::ADLEntry()

Main AS

package  {

  
import flash.display.MovieClip;
  
import com.pozirk.ads.admob.AdMob;
  
import com.pozirk.ads.admob.AdParams;
  
import com.pozirk.ads.admob.AdEvent;
  
import flash.events.MouseEvent;

  
public class Main extends MovieClip {
  
private var _bannerAdUID:String = "ca-app-pub-3940256099942544/6300978111";//BÄ°ZÄ°MDEGÄ°L
  
private var _intersAdUID:String = "ca-app-pub-4769962435850149/5055329136";
  
protected var _banner:AdMob = new AdMob();
  
protected var _inters:AdMob = new AdMob();
  
private var _initOK:Boolean = false;
  
private var _isShow:Boolean = false;
  
private var _cacheOK:Boolean = false;  

  
public function Main() {
  
// constructor code
  btBanner
.addEventListener(MouseEvent.CLICK, showBanner);
  btInters
.addEventListener(MouseEvent.CLICK, showInterstitial);

  _banner
.init();
_banner
.addEventListener(AdEvent.INIT_OK, onInitEvent);
_banner
.addEventListener(AdEvent.INIT_FAIL, onEvent);
_banner
.addEventListener(AdEvent.BANNER_SHOW_OK, onEvent);
_banner
.addEventListener(AdEvent.BANNER_SHOW_FAIL, onEvent);
_banner
.addEventListener(AdEvent.BANNER_LEFT_APP, onEvent);
_banner
.addEventListener(AdEvent.BANNER_OPENED, onEvent);
_banner
.addEventListener(AdEvent.BANNER_CLOSED, onEvent);

_inters
.init();
_inters
.addEventListener(AdEvent.INIT_OK, onInitEvent);
_inters
.addEventListener(AdEvent.INIT_FAIL, onEvent);
_inters
.addEventListener(AdEvent.INTERSTITIAL_SHOW_OK, onEvent);
_inters
.addEventListener(AdEvent.INTERSTITIAL_SHOW_FAIL, onEvent);
_inters
.addEventListener(AdEvent.INTERSTITIAL_CACHE_OK, onCacheEvent);
_inters
.addEventListener(AdEvent.INTERSTITIAL_CACHE_FAIL, onEvent);
_inters
.addEventListener(AdEvent.INTERSTITIAL_LEFT_APP, onEvent);
_inters
.addEventListener(AdEvent.INTERSTITIAL_OPENED, onEvent);
_inters
.addEventListener(AdEvent.INTERSTITIAL_CLOSED, onCloseIntersEvent);

_inters
.cacheInterstitial(_intersAdUID);
  
}


  
protected function onEvent(event:AdEvent😞void {

}

protected function onInitEvent(event:AdEvent😞void {
  _initOK
= true;
}

protected function onCacheEvent(event:AdEvent😞void {
  _cacheOK
= true;
}

protected function onCloseIntersEvent(event:AdEvent😞void {
  _inters
.cacheInterstitial(_intersAdUID);
}


////////////


private function showBanner(e:MouseEvent😞void {
  
if(_initOK) {
  
if(!_isShow) {
  _banner
.show(_bannerAdUID, AdParams.SIZE_SMART_BANNER, AdParams.HALIGN_CENTER, AdParams.VALIGN_BOTTOM);
  _isShow
= true;
  
}else {
  _banner
.hide();
  _isShow
= false;
  
}
  
} else {
  trace
("Banner Not Ready.");
  
}
}

private function showInterstitial(e:MouseEvent😞void {
  
if(_initOK && _cacheOK) {
  _inters
.showInterstitial();
  
} else {
  trace
("Inters Not Ready.");
  
}
}







  
}

}

APP XML file code

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<application xmlns="http://ns.adobe.com/air/application/24.0">
 
<id>Testreklam</id>
 
<versionNumber>1.0.0</versionNumber>
 
<versionLabel/>
 
<filename>Testreklam</filename>
 
<description/>
<!-- To localize the description, use the following format for the description element.<description><text xml:lang="en">English App description goes here</text><text xml:lang="fr">French App description goes here</text><text xml:lang="ja">Japanese App description goes here</text></description>-->
 
<name>Testreklam</name>
<!-- To localize the name, use the following format for the name element.<name><text xml:lang="en">English App name goes here</text><text xml:lang="fr">French App name goes here</text><text xml:lang="ja">Japanese App name goes here</text></name>-->
 
<copyright/>
 
<initialWindow>
  
<content>Testreklam.swf</content>
  
<systemChrome>standard</systemChrome>
  
<transparent>false</transparent>
  
<visible>true</visible>
  
<fullScreen>true</fullScreen>
  
<aspectRatio>portrait</aspectRatio>
  
<renderMode>direct</renderMode>
  
<autoOrients>false</autoOrients></initialWindow>
 
<icon>
  
<image72x72>AppIconsForPublish/Medal-2-icon.png</image72x72>
 
</icon>
 
<customUpdateUI>false</customUpdateUI>
 
<allowBrowserInvocation>false</allowBrowserInvocation>
 
<android>
  
<manifestAdditions>
  
<![CDATA[<manifest><uses-permission android:name="android.permission.INTERNET"/><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/><application>
<meta-data android:name="com.google.android.gms.version" android:value="4323000" /> <!-- should be android:value="@integer/google_play_services_version" --> <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application></manifest>]]>
  
</manifestAdditions>
  
</android>
 
<versionLabel> </versionLabel>
 
<extensions>
  
<extensionID>com.pozirk.ads.AdMob</extensionID>
 
</extensions>
</application>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 05, 2017 Oct 05, 2017

Copy link to clipboard

Copied

No I can't.Because it's created apk3301628292574833117.tmp file when I tried export as apk.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 05, 2017 Oct 05, 2017

Copy link to clipboard

Copied

that's a temp file that's automatically deleted (unless there's a problem like that error).  you can manually delete it.

in any case, you can test using a connected (via usb) device.  or publish the apk (file>publish) and install, but don't publish using any of the debug options (unless it's using a connected device via usb), or you'll encounter error #3500.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 05, 2017 Oct 05, 2017

Copy link to clipboard

Copied

Okay I fixed the problem and the game has been work successfully on usb device.However the test ad (with ane one) not publishing it's just show publishing message last ten minutes, it's take to long and I canceled.Why is not publishing ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 05, 2017 Oct 05, 2017

Copy link to clipboard

Copied

if you tested on a usb device, it published.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 05, 2017 Oct 05, 2017

Copy link to clipboard

Copied

No isn't.I clicked publish and its have been ten minute,still show publishing message.Just crate .tmp file 28kb.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 05, 2017 Oct 05, 2017

Copy link to clipboard

Copied

can you install via usb?

if so, do it.  that will publish an apk.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 05, 2017 Oct 05, 2017

Copy link to clipboard

Copied

I open debug mode on the phone,then click device release and two options under the "after publishing" on Air publish settings.My other project work fine that way on device.But this isn't.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 05, 2017 Oct 05, 2017

Copy link to clipboard

Copied

you said your game worked on your usb device.  was that a misstatement?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 06, 2017 Oct 06, 2017

Copy link to clipboard

Copied

I mean device.The device connected pc with usb.I publish and not see those errors anymore (my second message).But Flash is not publish the apk,it's only prosess.

It's publish successfully when I remove ANE file on Actionscript 3 settings.How can I fix that ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 06, 2017 Oct 06, 2017

Copy link to clipboard

Copied

if you attach an android mobile by usb and publish to your android mobile without error you will create an apk file.

if you then detach you mobile and publish and the publish doesn't end, you have a local (ie, on your computer) problem or an animate setting problem.  i can't determine what that problem is without downloading your fla and testing myself and i don't do that via the forums for free. but someone else might do that or you can hire me by sending an email via http://www.kglad.com.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 06, 2017 Oct 06, 2017

Copy link to clipboard

Copied

I will update AIR SDK and maybe switch to Animate cc from Pro CS6.Is there another way publish admob ads without using ane ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 06, 2017 Oct 06, 2017

Copy link to clipboard

Copied

LATEST

yes, you can use the same author's swc or use other author's ane's.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 05, 2017 Oct 05, 2017

Copy link to clipboard

Copied

I'm developing a game using this ANE too.

This error is because you're running the ANE inside the Animate IDE. You need to test on an android emulator or on android devices.

Add if statements in your code to check if you're on mobile or not.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 05, 2017 Oct 05, 2017

Copy link to clipboard

Copied

Can you share your code please.Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines