<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="@string/adAppId" />
In my MainActivity I have
MobileAds.initialize(this, getString(R.string.adAppId));
In my fragment I have
AdRequest.Builder builder = new AdRequest.Builder();
builder.addTestDevice("1B13C5A76246A215EFBE3FE70813578E");
adView.loadAd(builder.build());
In my layout I have
<com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adSize="SMART_BANNER"
ads:adUnitId="@string/adUnitId" />
In my string.xml I have, with my app id and ad unit id that I got from playstore (x'd out here)
<string name="adAppId">ca-app-pub-xxxxxxxxxxxxxxxx~xxxxxxxxxx</string>
<string name="adUnitId">ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx</string>
I have been trying to get this to work for days and just can't see what I am doing wrong. Any help would be greatly appreciated.
--
---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/c02c9146-e3eb-4bee-87aa-2d141cc20f6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.
11-05 17:31:37.527 32604-32604/com.xspeed.bestphotoeditor E/AndroidRuntime: FATAL EXCEPTION: main Process: com.xspeed.bestphotoeditor, PID: 32604 java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException: ****************************************************************************** * Invalid application ID. Follow instructions here: https://goo.gl/fQ2neu to * * find your app ID. * ****************************************************************************** at android.app.ActivityThread.installProvider(ActivityThread.java:5322) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4893) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4833) at android.app.ActivityThread.access$1500(ActivityThread.java:178) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1531) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5631) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754) Caused by: java.lang.IllegalStateException: ****************************************************************************** * Invalid application ID. Follow instructions here: https://goo.gl/fQ2neu to * * find your app ID. * ****************************************************************************** at com.google.android.gms.internal.ads.zzmn.attachInfo(Unknown Source) at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(Unknown Source) at android.app.ActivityThread.installProvider(ActivityThread.java:5319) ... 11 more
--
---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/f6d13bfb-283d-42d3-9674-1f73c38b706d%40googlegroups.com.
please add this line to your project AndroidManifest.xml
inside <application>
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="[appid here]"/>
Thanks bro resolved thanks.
Thanks bro resolved thanks.