0

I want to add my project android Google advertising . He did all of this example.I add all libraries, all as described there.But after compiling and attempts to launch an application on my phone get it is not clear to me the problem in the debugger(IDE-Intellij Idea).

I add in manifect:

        <meta-data android:name="com.google.android.gms.version"
         android:value="17"/>

and

<activity android:name="com.google.android.gms.ads.AdActivity"
          android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
          android:theme="@android:style/Theme.Translucent" />

I add in main class(onCreate):

 AdView mAdView = (AdView) findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder().build();
    mAdView.loadAd(adRequest);

and

import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;

And in .xml: xmlns:ads="http://schemas.android.com/apk/com.dd_pc.service.ServiceActivity"

and

  <com.google.android.gms.ads.AdView
            android:id="@+id/adView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_alignParentBottom="true"
            ads:adSize="BANNER"
            ads:adUnitId="@string/banner_ad_unit_id">
    </com.google.android.gms.ads.AdView>

And this is log error in link(github).

1 Answers1

0

According to your error log, you need to import the Google Play Services library to your project.

You can find instructions here and since you are using Intellij Idea, here are specific instructions that may be useful.

Community
  • 1
  • 1
Marco Batista
  • 1,410
  • 1
  • 20
  • 38