I'm getting the error message "an error has occurred in sub... you must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />" when I run my app using the admob library.
My manifest looks like:
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
)
'AdMob
AddApplicationText(
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
)
AddApplicationText(<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />)
'End of AdMob
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
It has the meta data tag in there already, any idea why the error would be happening?
I believe I've done all that, I'm currently using AdMob v2.00 from the admob.zip as opposed to the oldadmob.zip, and I've downloaded the Google Play Services jar file via the Android SDK toolkit though I'm not sure how to find out what version that is.
Hi, yes, I've been through the examples multiple times.
I now see the slight difference in the AddApplicationText that GMan posted. The app now runs but I get a FailedToReceiveAd response with an error code of 0 which is ERROR_CODE_INTERNAL_ERROR (I'm using the correct publisher id because if I don't I get an error code of 1 (ERROR_CODE_INVALID_REQUEST)).
I'm initiating the ad with
B4X:
AdView1.Initialize2("Ad", "mypublisherid", AdView1.SIZE_BANNER) 'publisher id that you received from AdMob.
Activity.AddView(AdView1, 0dip, 0dip, 320dip, 50dip)
AdView1.LoadAd 'loads an ad
Maybe it takes a while for Admob to dish out ads, maybe I'll start getting ads soon.
This is now my manifest after replacing what I'd got with what is in the tutorial:
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
)
'AdMob
AddApplicationText(
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
)
'End of AdMob
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
I think so, in Admob Settings there is the Ad Network Optimization Settings where you can add (what I think are) other sources of ads, and the ones I get are InMobi, JumpTap, MdotM and MobFox but I don't need to add those do I? They require logons/ids etc and I've never signed up with those, just Google Admob. Where do I configure networks for my country?