- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我遇到了某种问题。
我尝试使用
手动
https://developers.google.com/admob/android/native
快速入门
https://developers.google.com/admob/android/quick-start .
对于由 AdView
加载的简单横幅来说还可以,但是当我改为通过 AdLoader
加载原生广告时,我真的卡住了。
我正在使用 Idea + Gradle 和 Android Annotations。
这是 Logcat(已更新,请查看问题的结尾):
07-13 17:12:32.260 2548-2580/com.clockbyte.vkgroupwatcher D/dalvikvm﹕ DexOpt: --- BEGIN 'ads-1439082442.jar' (bootstrap=0) ---
07-13 17:12:32.350 2548-2548/com.clockbyte.vkgroupwatcher I/Ads﹕ CsiReporterFactory: CSI is not enabled. No CSI reporter created.
07-13 17:12:32.350 2548-2548/com.clockbyte.vkgroupwatcher I/Ads﹕ Starting ad request.
07-13 17:12:32.840 2548-2580/com.clockbyte.vkgroupwatcher D/dalvikvm﹕ DexOpt: --- END 'ads-1439082442.jar' (success) ---
07-13 17:12:32.840 2548-2580/com.clockbyte.vkgroupwatcher D/dalvikvm﹕ DEX prep '/data/data/com.clockbyte.vkgroupwatcher/cache/ads-1439082442.jar': unzip in 0ms, rewrite 580ms
07-13 17:12:35.100 1798-1826/com.google.android.gms I/Ads﹕ CsiReporterFactory: CSI is not enabled. No CSI reporter created.
07-13 17:12:36.360 2548-2548/com.clockbyte.vkgroupwatcher I/dalvikvm﹕ Could not find method android.webkit.WebSettings.setMixedContentMode, referenced from method com.google.android.gms.ads.internal.t.h.<init>
07-13 17:13:36.351 2548-2612/com.clockbyte.vkgroupwatcher W/Ads﹕ Timed out waiting for native ad.
07-13 17:13:36.351 2548-2613/com.clockbyte.vkgroupwatcher W/Ads﹕ Timeout when loading native ad.
java.util.concurrent.TimeoutException: CallbackFuture timed out.
at com.google.android.gms.ads.internal.util.a.a.get(SourceFile:108)
at com.google.android.gms.ads.internal.o.a.a.b(SourceFile:156)
at com.google.android.gms.ads.internal.o.a.a.call(SourceFile:70)
at com.google.android.gms.ads.internal.util.n.run(SourceFile:75)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
07-13 17:13:36.351 2548-2548/com.clockbyte.vkgroupwatcher W/Ads﹕ Failed to load ad: 2
07-13 17:13:36.351 2548-2548/com.clockbyte.vkgroupwatcher I/com.clockbyte.vkgroupwatcher.ads.AdmobFetcher﹕ Fetching Ad now
07-13 17:13:36.391 1798-1825/com.google.android.gms I/Ads﹕ CsiReporterFactory: CSI is not enabled. No CSI reporter created.
07-13 17:13:36.741 2548-2548/com.clockbyte.vkgroupwatcher I/chromium﹕ [INFO:CONSOLE(0)] "Document was loaded from Application Cache with manifest http://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.appcache", source: http://googleads.g.doubleclick.net/mads/static/mad/sdk/native/native_ads.html (0)
07-13 17:13:36.751 2548-2548/com.clockbyte.vkgroupwatcher I/chromium﹕ [INFO:CONSOLE(0)] "Application Cache Checking event", source: http://googleads.g.doubleclick.net/mads/static/mad/sdk/native/native_ads.html (0)
07-13 17:13:36.861 2548-2548/com.clockbyte.vkgroupwatcher I/chromium﹕ [INFO:CONSOLE(0)] "Application Cache NoUpdate event", source: http://googleads.g.doubleclick.net/mads/static/mad/sdk/native/native_ads.html (0)
07-13 17:13:36.881 2548-2548/com.clockbyte.vkgroupwatcher W/Ads﹕ Failed to load ad: 0
这是获取广告的代码(我从扩展的 BaseAdapter
调用方法 prefetchAds
以将加载的广告发布到 ListView
).
package com.clockbyte.vkgroupwatcher.ads;
import android.content.Context;
import android.provider.Settings;
import android.text.TextUtils;
import com.clockbyte.vkgroupwatcher.CbLog;
import com.clockbyte.vkgroupwatcher.Crypt;
import com.clockbyte.vkgroupwatcher.GroupWatcherApplication;
import com.clockbyte.vkgroupwatcher.R;
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdLoader;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.MobileAds;
import com.google.android.gms.ads.formats.NativeAd;
import com.google.android.gms.ads.formats.NativeAdOptions;
import com.google.android.gms.ads.formats.NativeAppInstallAd;
import com.google.android.gms.ads.formats.NativeContentAd;
public class AdmobFetcher {
private AdLoader adLoader;
private WeakReference<Context> mContext = new WeakReference<>(null);
...
//I call this method once, just to setup AdLoader and fetch the ad.
public synchronized void prefetchAds(Context context) {
mContext = new WeakReference<>(context);
setupAds();
fetchAd();
}
private synchronized void setupAds() {
String admobUnitId = "ca-app-pub-3940256099942544/2247696110"; // the test ad unit id that is pointed in the manual
adLoader = new AdLoader.Builder(mContext.get(), admobUnitId)
.forAppInstallAd(new NativeAppInstallAd.OnAppInstallAdLoadedListener() {
@Override
public void onAppInstallAdLoaded(NativeAppInstallAd appInstallAd) {
onAdFetched(appInstallAd); // Can't get here
}
})
.forContentAd(new NativeContentAd.OnContentAdLoadedListener() {
@Override
public void onContentAdLoaded(NativeContentAd contentAd) {
onAdFetched(contentAd); // Can't get here
}
})
.withAdListener(new AdListener() {
@Override
public void onAdFailedToLoad(int errorCode) {
// Here I got errorCode = 0 each time (kindly check Logcat)
}
})
.withNativeAdOptions(new NativeAdOptions.Builder()
// Methods in the NativeAdOptions.Builder class can be
// used here to specify individual options settings.
//.setReturnUrlsForImageAssets(true)
.build())
.build();
}
/**
* Fetches a new native ad.
*/
private synchronized void fetchAd() {
Context context = mContext.get();
if (context != null) {
adLoader.loadAd(getAdRequest()); //Fetching the ads item
} else {
mFetchFailCount++;
}
}
/**
* Setup and get an AdRequest instance
*/
private synchronized AdRequest getAdRequest() {
String deviceId = "XXXXXXXXXXXXXXX";
return new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR) // All emulators are added by default as test devices
.addTestDevice(deviceId)
.build();
}
...
}
应用的 list :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.clockbyte.vkgroupwatcher"
android:versionCode="4"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="22" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
<application
android:name="GroupWatcherApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<!--This meta-data tag is required to use Google Play Services.-->
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name=".activities.LoginActivity_"
android:configChanges="keyboardHidden|orientation"
android:launchMode="standard"
android:noHistory="false" >
</activity>
<activity
android:name=".activities.MainContainerActivity_"
android:launchMode="standard" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activities.PreferencesActivity_"
android:theme="@style/SettingsTheme" >
</activity>
<activity
android:name=".activities.WatcherEditActivity_"
android:launchMode="standard" >
</activity>
<activity
android:name=".activities.AddGroupsActivity_"
android:launchMode="standard" >
</activity>
<activity
android:name=".activities.MessageDetailsActivity_"
android:launchMode="standard" >
</activity>
<!--Include the AdActivity configChanges and theme. -->
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent" />
<service
android:name=".service.WatcherService_"
android:enabled="true" />
<receiver
android:name="com.clockbyte.vkgroupwatcher.environment.EnvironmentStateReceiver_"
android:enabled="true" >
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
</intent-filter>
</receiver>
</application>
</manifest>
最后是模块的build.gradle
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.2'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
} }
repositories {
jcenter()
mavenCentral()
mavenLocal() }
apply plugin: 'com.android.application' apply plugin: 'android-apt' def AAVersion = '3.3.1'
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
resourcePackageName 'com.clockbyte.vkgroupwatcher'
} }
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.clockbyte.vkgroupwatcher"
minSdkVersion 11
targetSdkVersion 22
versionCode 6
versionName "1.1"
multiDexEnabled = true
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
apt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion"
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.loopj.android:android-async-http:1.4.7'
compile 'com.google.code.gson:gson:2.3.1'
compile 'org.jsoup:jsoup:1.8.2'
compile 'org.ocpsoft.prettytime:prettytime:4.0.0.Final'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.google.android.gms:play-services-ads:7.5.0'
compile 'com.google.android.gms:play-services-appinvite:7.5.0'
compile project(':google-licensing') }
我错过了什么吗?
或者 Admob
仍然不支持原生广告?
我还尝试了将我的应用程序单元 ID 从测试更改为真实单元、在模拟器/设备上进行测试以及清除设备上 Google Play 服务的缓存数据等操作 - 结果相同。
任何帮助/想法将不胜感激......
更新:我已经从 gradle 的配置中删除了 multidex 模式,并将 buildToolsVersion
更改为最新版本 (22.0.1),logcat 已更新到问题的顶部。现在方法 fetchAd
的第一次调用失败,代码为 2(超时),接下来的调用如前所述失败,代码为 0。请查看更新后的 Logcat
更新2:真实设备的日志(android api 级别 15):
07-14 00:23:26.985 7698-7698/com.clockbyte.vkgroupwatcher I/Ads﹕ CsiReporterFactory: CSI is not enabled. No CSI reporter created.
07-14 00:23:27.015 7698-7698/com.clockbyte.vkgroupwatcher I/Ads﹕ Starting ad request.
07-14 00:23:27.225 7698-7823/com.clockbyte.vkgroupwatcher D/dalvikvm﹕ DexOpt: --- BEGIN 'ads833267715.jar' (bootstrap=0) ---
07-14 00:23:27.365 7698-7823/com.clockbyte.vkgroupwatcher D/dalvikvm﹕ DexOpt: --- END 'ads833267715.jar' (success) ---
07-14 00:23:27.365 7698-7823/com.clockbyte.vkgroupwatcher D/dalvikvm﹕ DEX prep '/data/data/com.clockbyte.vkgroupwatcher/cache/ads833267715.jar': unzip in 0ms, rewrite 139ms
07-14 00:23:36.424 7433-7443/? I/Ads﹕ CsiReporterFactory: CSI is not enabled. No CSI reporter created.
07-14 00:23:36.454 7433-7863/? I/Ads﹕ CsiReporterFactory: CSI is not enabled. No CSI reporter created.
07-14 00:23:36.504 7433-7863/? I/dalvikvm﹕ Could not find method android.net.ConnectivityManager.isActiveNetworkMetered, referenced from method com.google.android.gms.ads.internal.request.a.r.a
07-14 00:23:36.584 7433-7433/? I/dalvikvm﹕ Could not find method android.webkit.WebSettings.setMixedContentMode, referenced from method com.google.android.gms.ads.internal.t.h.<init>
07-14 00:23:36.584 7433-7433/? I/dalvikvm﹕ Could not find method android.webkit.WebView.evaluateJavascript, referenced from method com.google.android.gms.ads.internal.t.h.evaluateJavascript
07-14 00:23:36.594 7433-7433/? I/dalvikvm﹕ Could not find method com.google.android.gms.ads.internal.t.h.isAttachedToWindow, referenced from method com.google.android.gms.ads.internal.t.h.onDraw
07-14 00:23:36.594 7433-7433/? W/dalvikvm﹕ VFY: unable to resolve virtual method 6452: Lcom/google/android/gms/ads/internal/t/h;.isAttachedToWindow ()Z
07-14 00:23:36.624 7433-7857/? D/skia﹕ WebFrame::loadStarted (1) https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html
07-14 00:23:37.295 7433-7857/? D/skia﹕ WebFrame::loadStarted (0) gmsg://mobileads.google.com/loadAdURL?drt_include=1&request_id=d72e3527-8d9a-4f0c-b771-18f9f922403c&request_scenario=online_request&type=admob&url=https%3A%2F%2Fgoogleads.g.doubleclick.net%2Fmads%2Fgma%3Fsession_id%3D157010986198
07-14 00:23:37.295 7433-7433/? W/Ads﹕ JS: The page at about:blank displayed insecure content from gmsg://mobileads.google.com/loadAdURL?drt_include=1&request_id=d72e3527-8d9a-4f0c-b771-18f9f922403c&request_scenario=online_request&type=admob&url=https%3A%2F%2Fgoogleads.g.doubleclick.net%2Fmads%2Fgma%3Fsession_id%3D15701098619806543204%26seq_num%3D1%26rm%3D1%26fdz%3D-1%26adtest%3Don%26js%3Dafma-sdk-a-v7574000.7571000.1%26eid%3D46621077%252C46621098%252C318474371%26hl%3Dru%26submodel%3DHTC%2520Sensation%2520XE%2520with%2520Beats%2520Audio%2520Z715e%26gnt%3D0%26native_templates%3D1%252C2%26ma%3D0%26platform%3DHTC%26forceHttps%3Dtrue%26u_sd%3D1.5%26sp%3D0%26cnt%3D1%26native_version%3D3%26muv%3D15%26riv%3D0%26ms%3DbBaKMM241P7ZUZbIw630exH1iY80ufKc8Z12nKVbEOI4eDpWg2KlW24F0xUKsi7r1FLSD9ISfYeAdN8C_jtjpY6xx5wG5BARDyrZUgeW_qnHTavdTzBzrpSaI1-3y19EgkD3mrsTe5XMetskcd4lTidQnf63xhT8BeE9u1LAJb1pTp_N8TssVCQNtBBRk59fPAK8olxqwKJm-nDWnLngOBSH0F_dXlmb_-ZhxT0VwHw8Hv406I5dXx2jh6YAvc0kd_cJwwBfLhCXEnxqcNCgAhLJWbdnzqf2kYziboXI8BGqqPbVNRNeKqzWB149Ri-q0no25qbKdZIbT0yuMNMkgA%26mv%3D80321300.com.android.vending%26format%3D320x50_mb%26coh%3D1%26gl%3DRU%26request_id%3Dd72e3527-8d9a-4f0c-b771-18f9f922403c%26am%3D0%26native_image_orientation%3Dany%26u_w%3D360%26u_h%3D640%26msid%3Dcom.clockbyte.vkgroupwatcher%26app_name%3D6.android.com.clockbyte.vkgroupwatcher%26an%3D6.android.com.clockbyte.vkgroupwatcher%26net%3Dwi%26u_audio%3D3%26u_so%3Dp%26preqs%3D0%26support_transparent_background%3Dtrue%26pimp%3D0%26currts%3D4989768%26pclick%3D0%26basets%3D4989768%26output%3Dhtml%26region%3Dmobile_app%26u_tz%3D180%26client_sdk%3D1%26ex%3D1%26client%3Dca-app-pub-3940256099942544%26slotname%3D6300978111%26gsb%3Dwi%26bisch%3Dtrue%26blev%3D0.55%26cans%3D-1%26canm%3Dfalse%26caps%3DinlineVideo_interactiveVideo_mraid1_mraid2_th_autoplay_mediation_transparentBackground_sdkAdmobApiForAds_di%26_efs%3Dfalse%26blockAutoClicks%3D0%26forceGmsDoritos%3D1%26tcar%3D46%26jsv%3D176%26urll%3D1435&base_uri=https%3A%2F%2Fgoogleads.g.doubleclick.net%2Fmads%2Fgma&use_webview_loadurl=0&enable_auto_click_protection=0&google.afma.Notify_dt=1436822617303.
(null:1)
07-14 00:23:37.295 7433-7433/? W/Web Console﹕ The page at about:blank displayed insecure content from gmsg://mobileads.google.com/loadAdURL?drt_include=1&request_id=d72e3527-8d9a-4f0c-b771-18f9f922403c&request_scenario=online_request&type=admob&url=https%3A%2F%2Fgoogleads.g.doubleclick.net%2Fmads%2Fgma%3Fsession_id%3D15701098619806543204%26seq_num%3D1%26rm%3D1%26fdz%3D-1%26adtest%3Don%26js%3Dafma-sdk-a-v7574000.7571000.1%26eid%3D46621077%252C46621098%252C318474371%26hl%3Dru%26submodel%3DHTC%2520Sensation%2520XE%2520with%2520Beats%2520Audio%2520Z715e%26gnt%3D0%26native_templates%3D1%252C2%26ma%3D0%26platform%3DHTC%26forceHttps%3Dtrue%26u_sd%3D1.5%26sp%3D0%26cnt%3D1%26native_version%3D3%26muv%3D15%26riv%3D0%26ms%3DbBaKMM241P7ZUZbIw630exH1iY80ufKc8Z12nKVbEOI4eDpWg2KlW24F0xUKsi7r1FLSD9ISfYeAdN8C_jtjpY6xx5wG5BARDyrZUgeW_qnHTavdTzBzrpSaI1-3y19EgkD3mrsTe5XMetskcd4lTidQnf63xhT8BeE9u1LAJb1pTp_N8TssVCQNtBBRk59fPAK8olxqwKJm-nDWnLngOBSH0F_dXlmb_-ZhxT0VwHw8Hv406I5dXx2jh6YAvc0kd_cJwwBfLhCXEnxqcNCgAhLJWbdnzqf2kYziboXI8BGqqPbVNRNeKqzWB149Ri-q0no25qbKdZIbT0yuMNMkgA%26mv%3D80321300.com.android.vending%26format%3D320x50_mb%26coh%3D1%26gl%3DRU%26request_id%3Dd72e3527-8d9a-4f0c-b771-18f9f922403c%26am%3D0%26native_image_orientation%3Dany%26u_w%3D360%26u_h%3D640%26msid%3Dcom.clockbyte.vkgroupwatcher%26app_name%3D6.android.com.clockbyte.vkgroupwatcher%26an%3D6.android.com.clockbyte.vkgroupwatcher%26net%3Dwi%26u_audio%3D3%26u_so%3Dp%26preqs%3D0%26support_transparent_background%3Dtrue%26pimp%3D0%26currts%3D4989768%26pclick%3D0%26basets%3D4989768%26output%3Dhtml%26region%3Dmobile_app%26u_tz%3D180%26client_sdk%3D1%26ex%3D1%26client%3Dca-app-pub-3940256099942544%26slotname%3D6300978111%26gsb%3Dwi%26bisch%3Dtrue%26blev%3D0.55%26cans%3D-1%26canm%3Dfalse%26caps%3DinlineVideo_interactiveVideo_mraid1_mraid2_th_autoplay_mediation_transparentBackground_sdkAdmobApiForAds_di%26_efs%3Dfalse%26blockAutoClicks%3D0%26forceGmsDoritos%3D1%26tcar%3D46%26jsv%3D176%26urll%3D1435&base_uri=https%3A%2F%2Fgoogleads.g.doubleclick.net%2Fmads%2Fgma&use_webview_loadurl=0&enable_auto_click_protection=0&google.afma.Notify_dt=1436822617303.
at null:1
07-14 00:23:37.335 7433-7857/? D/skia﹕ WebFrame::loadStarted (0) gmsg://mobileads.google.com/loadAdURL?drt_include=1&request_id=d72e3527-8d9a-4f0c-b771-18f9f922403c&request_scenario=online_request&type=admob&url=https%3A%2F%2Fgoogleads.g.doubleclick.net%2Fmads%2Fgma%3Fsession_id%3D157010986198
07-14 00:23:37.345 7433-7433/? W/Ads﹕ JS: The page at about:blank displayed insecure content from gmsg://mobileads.google.com/loadAdURL?drt_include=1&request_id=d72e3527-8d9a-4f0c-b771-18f9f922403c&request_scenario=online_request&type=admob&url=https%3A%2F%2Fgoogleads.g.doubleclick.net%2Fmads%2Fgma%3Fsession_id%3D15701098619806543204%26seq_num%3D1%26rm%3D1%26fdz%3D-1%26adtest%3Don%26js%3Dafma-sdk-a-v7574000.7571000.1%26eid%3D46621077%252C46621098%252C318474371%26hl%3Dru%26submodel%3DHTC%2520Sensation%2520XE%2520with%2520Beats%2520Audio%2520Z715e%26gnt%3D0%26native_templates%3D1%252C2%26ma%3D0%26platform%3DHTC%26forceHttps%3Dtrue%26u_sd%3D1.5%26sp%3D0%26cnt%3D1%26native_version%3D3%26muv%3D15%26riv%3D0%26ms%3DbBaKMM241P7ZUZbIw630exH1iY80ufKc8Z12nKVbEOI4eDpWg2KlW24F0xUKsi7r1FLSD9ISfYeAdN8C_jtjpY6xx5wG5BARDyrZUgeW_qnHTavdTzBzrpSaI1-3y19EgkD3mrsTe5XMetskcd4lTidQnf63xhT8BeE9u1LAJb1pTp_N8TssVCQNtBBRk59fPAK8olxqwKJm-nDWnLngOBSH0F_dXlmb_-ZhxT0VwHw8Hv406I5dXx2jh6YAvc0kd_cJwwBfLhCXEnxqcNCgAhLJWbdnzqf2kYziboXI8BGqqPbVNRNeKqzWB149Ri-q0no25qbKdZIbT0yuMNMkgA%26mv%3D80321300.com.android.vending%26format%3D320x50_mb%26coh%3D1%26gl%3DRU%26request_id%3Dd72e3527-8d9a-4f0c-b771-18f9f922403c%26am%3D0%26native_image_orientation%3Dany%26u_w%3D360%26u_h%3D640%26msid%3Dcom.clockbyte.vkgroupwatcher%26app_name%3D6.android.com.clockbyte.vkgroupwatcher%26an%3D6.android.com.clockbyte.vkgroupwatcher%26net%3Dwi%26u_audio%3D3%26u_so%3Dp%26preqs%3D0%26support_transparent_background%3Dtrue%26pimp%3D0%26currts%3D4989768%26pclick%3D0%26basets%3D4989768%26output%3Dhtml%26region%3Dmobile_app%26u_tz%3D180%26client_sdk%3D1%26ex%3D1%26client%3Dca-app-pub-3940256099942544%26slotname%3D6300978111%26gsb%3Dwi%26bisch%3Dtrue%26blev%3D0.55%26cans%3D-1%26canm%3Dfalse%26caps%3DinlineVideo_interactiveVideo_mraid1_mraid2_th_autoplay_mediation_transparentBackground_sdkAdmobApiForAds_di%26_efs%3Dfalse%26blockAutoClicks%3D0%26forceGmsDoritos%3D1%26tcar%3D46%26jsv%3D176%26urll%3D1435&base_uri=https%3A%2F%2Fgoogleads.g.doubleclick.net%2Fmads%2Fgma&use_webview_loadurl=0&enable_auto_click_protection=0&google.afma.Notify_dt=1436822617303.
(null:1)
07-14 00:23:37.345 7433-7433/? W/Web Console﹕ The page at about:blank displayed insecure content from gmsg://mobileads.google.com/loadAdURL?drt_include=1&request_id=d72e3527-8d9a-4f0c-b771-18f9f922403c&request_scenario=online_request&type=admob&url=https%3A%2F%2Fgoogleads.g.doubleclick.net%2Fmads%2Fgma%3Fsession_id%3D15701098619806543204%26seq_num%3D1%26rm%3D1%26fdz%3D-1%26adtest%3Don%26js%3Dafma-sdk-a-v7574000.7571000.1%26eid%3D46621077%252C46621098%252C318474371%26hl%3Dru%26submodel%3DHTC%2520Sensation%2520XE%2520with%2520Beats%2520Audio%2520Z715e%26gnt%3D0%26native_templates%3D1%252C2%26ma%3D0%26platform%3DHTC%26forceHttps%3Dtrue%26u_sd%3D1.5%26sp%3D0%26cnt%3D1%26native_version%3D3%26muv%3D15%26riv%3D0%26ms%3DbBaKMM241P7ZUZbIw630exH1iY80ufKc8Z12nKVbEOI4eDpWg2KlW24F0xUKsi7r1FLSD9ISfYeAdN8C_jtjpY6xx5wG5BARDyrZUgeW_qnHTavdTzBzrpSaI1-3y19EgkD3mrsTe5XMetskcd4lTidQnf63xhT8BeE9u1LAJb1pTp_N8TssVCQNtBBRk59fPAK8olxqwKJm-nDWnLngOBSH0F_dXlmb_-ZhxT0VwHw8Hv406I5dXx2jh6YAvc0kd_cJwwBfLhCXEnxqcNCgAhLJWbdnzqf2kYziboXI8BGqqPbVNRNeKqzWB149Ri-q0no25qbKdZIbT0yuMNMkgA%26mv%3D80321300.com.android.vending%26format%3D320x50_mb%26coh%3D1%26gl%3DRU%26request_id%3Dd72e3527-8d9a-4f0c-b771-18f9f922403c%26am%3D0%26native_image_orientation%3Dany%26u_w%3D360%26u_h%3D640%26msid%3Dcom.clockbyte.vkgroupwatcher%26app_name%3D6.android.com.clockbyte.vkgroupwatcher%26an%3D6.android.com.clockbyte.vkgroupwatcher%26net%3Dwi%26u_audio%3D3%26u_so%3Dp%26preqs%3D0%26support_transparent_background%3Dtrue%26pimp%3D0%26currts%3D4989768%26pclick%3D0%26basets%3D4989768%26output%3Dhtml%26region%3Dmobile_app%26u_tz%3D180%26client_sdk%3D1%26ex%3D1%26client%3Dca-app-pub-3940256099942544%26slotname%3D6300978111%26gsb%3Dwi%26bisch%3Dtrue%26blev%3D0.55%26cans%3D-1%26canm%3Dfalse%26caps%3DinlineVideo_interactiveVideo_mraid1_mraid2_th_autoplay_mediation_transparentBackground_sdkAdmobApiForAds_di%26_efs%3Dfalse%26blockAutoClicks%3D0%26forceGmsDoritos%3D1%26tcar%3D46%26jsv%3D176%26urll%3D1435&base_uri=https%3A%2F%2Fgoogleads.g.doubleclick.net%2Fmads%2Fgma&use_webview_loadurl=0&enable_auto_click_protection=0&google.afma.Notify_dt=1436822617303.
at null:1
07-14 00:23:37.365 7433-7433/? W/Ads﹕ JS: The page at https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html displayed insecure content from file:///android_asset/webkit/android-weberror.png.
(null:1)
07-14 00:23:37.365 7433-7433/? W/Web Console﹕ The page at https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html displayed insecure content from file:///android_asset/webkit/android-weberror.png.
at null:1
07-14 00:23:38.155 7433-7857/? D/skia﹕ WebFrame::loadStarted (1) about:blank
07-14 00:23:38.276 7698-7698/com.clockbyte.vkgroupwatcher I/dalvikvm﹕ Could not find method android.webkit.WebSettings.setMixedContentMode, referenced from method com.google.android.gms.ads.internal.t.h.<init>
07-14 00:23:38.286 7698-7698/com.clockbyte.vkgroupwatcher I/dalvikvm﹕ Could not find method android.webkit.WebView.evaluateJavascript, referenced from method com.google.android.gms.ads.internal.t.h.evaluateJavascript
07-14 00:23:38.286 7698-7698/com.clockbyte.vkgroupwatcher I/dalvikvm﹕ Could not find method com.google.android.gms.ads.internal.t.h.isAttachedToWindow, referenced from method com.google.android.gms.ads.internal.t.h.onDraw
07-14 00:23:38.286 7698-7698/com.clockbyte.vkgroupwatcher W/dalvikvm﹕ VFY: unable to resolve virtual method 6452: Lcom/google/android/gms/ads/internal/t/h;.isAttachedToWindow ()Z
07-14 00:23:38.336 7698-7827/com.clockbyte.vkgroupwatcher D/skia﹕ WebFrame::loadStarted (1) https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/native_ads.html
07-14 00:23:38.916 7698-7827/com.clockbyte.vkgroupwatcher D/skia﹕ WebFrame::loadStarted (0) gmsg://mobileads.google.com/nativeAdPreProcess?failure=true&google.afma.Notify_dt=1436822618925
07-14 00:23:38.926 7698-7698/com.clockbyte.vkgroupwatcher W/Ads﹕ JS: The page at about:blank displayed insecure content from gmsg://mobileads.google.com/nativeAdPreProcess?failure=true&google.afma.Notify_dt=1436822618925.
(null:1)
07-14 00:23:38.926 7698-7698/com.clockbyte.vkgroupwatcher W/Web Console﹕ The page at about:blank displayed insecure content from gmsg://mobileads.google.com/nativeAdPreProcess?failure=true&google.afma.Notify_dt=1436822618925.
at null:1
07-14 00:23:38.946 7698-7698/com.clockbyte.vkgroupwatcher W/Ads﹕ Failed to load ad: 0
更新 3按照@RedBrogdon 的建议,我尝试仅获取内容广告(通过评论 AdLoader.Builder 中的相应 block )。这是日志
08-17 12:07:16.806 4918-5025/com.engineers.admobtest54321 D/dalvikvm﹕ DexOpt: --- BEGIN 'ads-973066727.jar' (bootstrap=0) ---
08-17 12:07:16.926 4918-5025/com.engineers.admobtest54321 D/dalvikvm﹕ DexOpt: --- END 'ads-973066727.jar' (success) ---
08-17 12:07:16.926 4918-5025/com.engineers.admobtest54321 D/dalvikvm﹕ DEX prep '/data/data/com.engineers.admobtest54321/cache/ads-973066727.jar': unzip in 0ms, rewrite 123ms
08-17 12:07:16.946 4918-4918/com.engineers.admobtest54321 I/Ads﹕ Starting ad request.
08-17 12:07:17.566 4918-5055/com.engineers.admobtest54321 I/Ads﹕ Trying mediation network:
08-17 12:07:17.576 4918-4918/com.engineers.admobtest54321 I/Ads﹕ Instantiating mediation adapter: com.google.DummyAdapter
08-17 12:07:17.576 4918-4918/com.engineers.admobtest54321 W/Ads﹕ Could not instantiate mediation adapter: com.google.DummyAdapter. com.google.DummyAdapter
08-17 12:07:17.576 4918-5055/com.engineers.admobtest54321 I/Ads﹕ No fill from any mediation ad networks.
08-17 12:07:17.576 4918-4918/com.engineers.admobtest54321 W/Ads﹕ Failed to load ad: 3
最佳答案
注释来自 documentation
Note: At the current time, publishers should not use the addTestDevice method with native ad requests. Using the above ad unit ID with calls to addTestDevice is the current best practice for testing.
因此请尝试删除对 addTestDevice(deviceId)
的调用。我遇到了同样的问题,在我完成之后它开始工作。
关于android - Admob Native 广告加载失败,错误代码为 0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31378661/
我在使用以下代码时遇到问题: function http_file_exists($url){ $f=fopen($url,"r"); if($f){ fclose($f); retu
我已经通过 Git 部署到 Azure 几个月了,没有出现重大问题,但现在我似乎遇到了一个无法克服的错误。 我创建了一个新的 Azure 网站,为正在开发的项目创建单独的预览链接。我在新站点上设置了
我已经通过flutter创建了一个App并完成了它,我想在flutter文档中阅读时进行部署。 我收到此错误: FAILURE: Build failed with an exception. * W
我在Windows 10中使用一些简单的Powershell代码遇到了这个奇怪的问题,我认为这可能是我做错了,但我不是Powershell的天才。 我有这个: $ix = [System.Net.Dn
我正在尝试使用 RapidJSON 解析从服务器接收到的数据。以下是收到的确切字符串: [ { "Node": "9478149a08f9", "Address": "172.17
我尝试为 ios 编译 OpenCV。我总是收到这些错误。我用不同版本的opencv试了一下,结果都是一样的。 我运行这个:python 平台/ios/build_framework.py ios_o
我在一台机器上做基本的发布/订阅,我的客户端是 StackExchange-Redis 的 C# 客户端,我在同一台机器上运行基于 Windows 的 Redis 服务器(服务器版本 2.8.4) 当
我有这段代码,但无法执行,请帮我解决这个问题 连接 connect_error) { die ("connection failed: " . $terhubung->connect_erro
我在 tomcat 上运行并由 maven 编译的 Web 应用程序给出了以下警告和错误。我可以在本地存储库中看到所有 JAR,但有人可以帮忙吗。 WARNING: Failed to scan JA
我正在 Windows 8 上使用 Android Studio 开发一个 android 应用程序,我正在使用一些 native 代码。突然间我无法编译我的 C 文件。当我运行 ndk-build
下面的代码对类和结构的成员进行序列化和反序列化。序列化工作正常,但我在尝试使用 oarch >> BOOST_SERIALIZATION_NVP(outObj); 反序列化时遇到了以下错误; 代码中是
如果我运行此命令“rspec ./spec/requests/api/v1/password_reset_request_spec.rb”,此文件中的所有测试都会通过。 但是,当我运行“rspec”时
我在尝试执行测试以使用 Protractor 上传文件时出错,我的代码是这个 it('it should be possible to upload a file', function() {
System.loadLibrary("nativefaceswap"); 当我运行我的应用程序时,我在 Android Studio 中发现了此类错误。在logcat中显示: java.lang.U
我希望有人能帮助我!使用任何方法或命令行的任何 SSL/HTTPS 调用均无效。 我在 Windows 10 中使用 Ubuntu Server 18.04 作为子系统。我的问题是昨天才开始出现的,因
通过删除这两个值将日期字段从 null=True 和 Blank=True 更改为 required 时,使用 db.alter 命令时遇到问题。 当以下行被注释掉时,迁移运行不会出现问题。
我第一次使用 Heroku 尝试创建应用程序(使用 SendGrid 的 Inbound Parse Webhook"和 Twilio SMS 通过电子邮件发送和接收 SMS 消息)。通过 Virtu
我正在将我的 swift 项目更新到 Xcode 7 上的 Swift 2.0。xcode 在构建项目时报告了以下错误: 命令/Applications/Xcode.app/Contents/Deve
在我的代码中,SSL 库函数 SSL_library_init() 没有按预期返回 1。我如何才能看到它返回了什么错误? 我在 SSL_library_init() 之后调用了 SSL_load_er
我正在尝试运行在以下链接中找到的答案: Asynchronously Load the Contents of a Div 但是当我这样做时,我会遇到我不太理解的错误。 我的代码: $(documen
我是一名优秀的程序员,十分优秀!