I have this in my main xml file:
remove xmlns:ads="http://schemas.android.com/tools" from root view
then add AdView
Remember these steps:
You can define xmlns:ads="http://schemas.android.com/apk/res-auto"
on root view it self .
if you have not defined xmlns:ads="http://schemas.android.com/apk/res-auto" inside rootView then you must need to add xmlns:ads="http://schemas.android.com/apk/res-auto" inside AdView.
if you have defined adSize inside your AdView xml file then don't set dynamically, like : adView.setAdSize(AdSize.BANNER); or else it will through an exception java.lang.IllegalStateException: The ad size can only be set once on AdView.
xmlns:ads="http://schemas.android.com/apk/res-auto" and xmlns:app="http://schemas.android.com/apk/res-auto" are looking same but there is a difference which is xmlns:ads and xmlns:app so don't get confuse.
I think it will resolve your issue ... Happy to help :)