have been searching hours on google, still without success. error message , adbanner doesnt load:
there problem getting ad response. errorcode: 1 failed load ad: 1
build.gradle
compile 'com.android.support:appcompat-v7:24.0.0' compile 'com.google.android.gms:play-services-ads:9.4.0'
android manifest
<activity android:name="com.google.android.gms.ads.adactivity" android:configchanges="keyboard|keyboardhidden|orientation|screenlayout|uimode|screensize|smallestscreensize" android:theme="@android:style/theme.translucent" />
layout
<com.google.android.gms.ads.adview android:id="@+id/adview" android:layout_width="match_parent" android:layout_height="wrap_content" ads:adsize="banner" android:layout_margintop="20dip" ads:adunitid="pub-*****************" android:layout_below="@+id/middle" android:layout_alignparentright="true" android:layout_alignparentend="true" />
activity (imports)
import com.google.android.gms.ads.adrequest; import com.google.android.gms.ads.adview;
activity
adview adview = (adview)findviewbyid(r.id.adview); adrequest adrequest = new adrequest.builder().build(); adview.loadad(adrequest);
permissions added
ty in advance
the error code 1 refers invalid request.
//(public static final int error_code_invalid_request ad request invalid; instance, ad unit id incorrect. constant value: 1) //
thus must check whether ad-ids defined @ right place. don't put banner ads id interestial ads , vice versa. other error codes take on link: https://developers.google.com/android/reference/com/google/android/gms/ads/adrequest#error_code_no_fill
Comments
Post a Comment