FacebookSDK on Android Studio - Using Audience Network

1.1k views Asked by At

I've a doubt, I'm working with facebook sdk on Android Studio. I include it as the documentation says:

repositories {
    mavenCentral(); //FACEBOOK SDK
}
...
dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      compile 'com.android.support:appcompat-v7:22.2.0'
      compile 'com.facebook.android:facebook-android-sdk:4.2.0'
}

But, when I want to use Audience Network, it doesn't appear. This include fails

<activity android:name="com.facebook.ads.InterstitialAdActivity"
              android:configChanges="keyboardHidden|orientation|screenSize" />

Should I have to download the facebook sdk directly and include the audience network jar? Thanks

1

There are 1 answers

2
James McCracken On BEST ANSWER

There is a separate JAR file that you need to include in your /libs folder.

  1. Download and extract the Facebook SDK for Android.
  2. Under the AudienceNetwork/bin folder, copy the AudienceNetwork.jar file and place it in the /libs folder in your project (you might need to create the directory if it doesn't already exist). Make sure your IDE's UI reflects this change. If you are using Intellij IDEA, right click on the libs/AudienceNetwork.jar file and choose 'Add as Library'.
  3. If you are not already including it, add the Android v4 Support Library (without resources) to your project, detailed steps can be found here.

Reference