I created an empty project with appcompact and tried to add to it the AdMob block
fragment_main.xml
THIS IS THE ANSWER ... you will write root before the findViewById. That's all
AdView mAdView = (AdView) root.findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
You have
View rootView = inflater.inflate(R.layout.fragment_main, container,
false);
return rootView; // remove this
adView = new AdView(getActivity()); // this is unreachable coz you have return above.
The return at the end of onCreateView
is fine