我想知道是否有办法检查我的应用是否因从 AdMob 投放广告而被禁用。我在 Google Play 商店中发布了一个旧应用程序,该应用程序上曾经有广告,现在我再次开始使用该应用程序,我一直在尝试再次添加 AdMob,但结果不成功。尝试在真实设备上投放广告时出现以下错误。
注意:如果我将真实设备添加为测试设备,测试广告会正确显示,测试广告也会在模拟器中正确显示。
There was a problem getting an ad response. ErrorCode: 0
Failed to load ad: 0
我一直在通过互联网上的多个线程寻找解决方案,其中一些建议我的应用程序已被禁用,无法从 AdMob 投放广告,我应该收到一封包含相关信息的电子邮件,此应用程序已经无人看管了几个月所以我可能丢失了那封电子邮件,我们有办法从 AdMob 控制台检查特定应用的状态吗?
注意:我的帐户在 AdMob 控制台中的状态为“打开”。
如果有帮助,这是我的应用程序当前的依赖项和代码:
摇篮依赖:
...
compile 'com.firebaseui:firebase-ui:1.2.0'
compile 'com.jakewharton:butterknife:8.5.1'
compile 'com.github.jkwiecien:EasyImage:1.3.1'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.google.firebase:firebase-ads:10.2.0'
compile 'com.google.firebase:firebase-crash:10.2.0'
...
登录活动.java
...
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
MobileAds.initialize(this, "ca-app-pub-X~Y");
...
MainFragment.java
...
AdView mAdView = (AdView) view.findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
...
fragment_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/content_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.x.y.MainActivity"
android:background="@color/tw__composer_deep_gray">
<android.support.v7.widget.CardView
android:id="@+id/titleCardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginBottom="10dp">
<TextView
android:text="TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/usernameTitle"
android:layout_margin="10dp" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/imageCardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/titleCardView"
android:layout_above="@+id/adView"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginBottom="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/com_facebook_button_background"
android:id="@+id/profileImage"
android:layout_gravity="center_vertical|center_horizontal" />
</android.support.v7.widget.CardView>
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id">
</com.google.android.gms.ads.AdView>
</RelativeLayout>