0

I have:

    @Override
    public void onActivityCreated( Bundle bundle )
    {
        super.onActivityCreated( bundle );
        AdView mAdView = (AdView) getView().findViewById( R.id.adView );
        AdRequest adRequest = new AdRequest.Builder().build();
        mAdView.loadAd( adRequest );
    }

It tells me, "cannot find symbol variable adView" for the second line in the braces. Why is this?

Thanks.

Puck
  • 217
  • 1
  • 3
  • 11

2 Answers2

1

You need to specify the package name of the item it can't find. In most IDEs, you can hover over that item, and it will give you the option there the package specifier directly to your code.

Booger
  • 18,579
  • 7
  • 55
  • 72
  • You're absolutely right, I apologize. I had a saved document and in tiredmode did not see that I had failed to fill out the subject. Thank you for the catch. – Puck Nov 06 '14 at 00:20
0

If you are using a third-party ad service (like AdMob) then their library needs to be in a "libs" folder in your project.

See this post: java.lang.NoClassDefFoundError: com.google.ads.AdView

Community
  • 1
  • 1
Jim
  • 10,172
  • 1
  • 27
  • 36