Hello,
You can simply add xmlns:ads
property to your AdView element, like:
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_conterHorizontal="true"
android:layout_alignParentBottom="true"
app:adSize="BANNER"
app:adUnitId="@string/AdMobID"
/>
Then open the strings.xml file
in Resources/values/
. Then add following AdMobID
key and value is your id from google console.
<resources>
<string name="app_name">AppADMob</string>
<string name="action_settings">Settings</string>
<string name="AdMobID">your id</string>
</resources>
In the end, rebuild your project, this error will disappear.
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.