English 中文(简体)
不明引用错误: 未定义 AFMA_ getSdkconstants
原标题:Uncaught ReferenceError: AFMA_getSdkConstants is not defined

我试图在我的机器人应用程序中添加一个 AdMob adad, 但每当我打开活动时,

I/Ads(11448): adRequestUrlHtml: <html><head><script src="http://media.admob.com/sdk-core-v40.js"></script><script>AFMA_getSdkConstants();AFMA_buildAdURL({"kw":[],"preqs":4,"session_id":"17111845472336325405","u_sd":2,"seq_num":"5","slotname":"MYUSERIDHERE","u_w":360,"msid":"com.lazyprogrammer.dartscore","adtest":"on","js":"afma-sdk-a-v6.0.1","mv":"8011019.com.android.vending","isu":"70069487A7A68D24BEF2581104A73318","cipa":0,"format":"360x50_mb","net":"wi","smart_h":"auto","app_name":"1.android.com.lazyprogrammer.dartscore","hl":"en","smart_w":"full","u_h":613,"carrier":"26203","ptime":225498,"u_audio":1});</script></head><body></body></html>
E/Ads(11448): JS: Uncaught ReferenceError: AFMA_getSdkConstants is not defined (about:blank:1)
E/Web Console(11448): Uncaught ReferenceError: AFMA_getSdkConstants is not defined at about:blank:1
I/Ads(11448): AdLoader timed out after 60000ms while getting the URL.
D/webviewglue(11448): nativeDestroy view: 0x2bc958
I/Ads(11448): onFailedToReceiveAd(A network error occurred.)
I/Ads(11448): AdLoader timed out after 60000ms while getting the URL.
D/webviewglue(11448): nativeDestroy view: 0x5a1850
I/Ads(11448): onFailedToReceiveAd(A network error occurred.)

在谷歌或其他地方,我找不到任何关于这个问题的信息,我不认为我做错了什么。

以防万一,这是我的Xml片段,该展示广告:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
    ...

    <com.google.ads.AdView
        android:id="@+id/adView"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ads:adSize="SMART_BANNER"
        ads:adUnitId="MyIDhere"
        ads:loadAdOnCreate="true"
        ads:testDevices="70069487A7A68D24BEF2581104A73318" />

</RelativeLayout>

当然,我拿出了所有――我认为―― 不必要的代码来解决这个问题, 但如果有必要的话,我也会把它贴在这里。

我还拿出我的AdMob UnitedID, 你可能明白了, 但我在这里写这个, 这样失踪的UnitedId就不会是一个答案。

My Manifest has the right permissions listed:
android.permission.ACCESS_NETWORK_STATE
android.permission.INTERNET

并且我还加上了 正确的组合变化

最佳回答

我也有这个错误,并通过将广告装入单独的线条(在 ICS 中,您不允许在主线中执行网络操作) 来解决了这个错误。

(new Thread() {
                public void run() {
                     Looper.prepare();
                    adView.loadAd(new AdRequest());
                }
            }).start();
问题回答

这是一个连接问题,我通过拆卸广告阻塞器来修复它...

只需检查一下你所有的互联网连接。 我的笔记本电脑在电话里有互联网。 我确实试图连接到电脑上的网络服务器, 并且运作良好。 所以在尝试用手机加热后, 我重新启动了 DSL 路由器, 一切正常, 一切正常了。

我在网络之间移动时遇到这个问题 并且让模拟器运行

我发现只要我与新网络连接后 重新启动模拟器 就能解决问题

检查/ etc/ hosts 文件。 许多自定义的roms 都有 adblock 条目...





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签