2

I am using Eclipse and I try to show ads via the Facebook Audience Network. I have added the "AudienceNetwork.jar" from the official Facebook SDK, and the "FacebookAdapter.jar" from the AdMob Mediation Networks.

I should mention that I monetize via the AdMob and do not use proguard.

My problem is that when I try to load ads, I get the following error:

02-19 20:07:35.315: I/Ads(23957): Instantiating mediation adapter: com.google.ads.mediation.facebook.FacebookAdapter
02-19 20:07:35.316: I/dalvikvm(23957): Failed resolving Lcom/google/ads/mediation/facebook/FacebookAdapter; interface 1798 'Lcom/google/android/gms/ads/mediation/MediationInterstitialAdapter;'
02-19 20:07:35.316: W/dalvikvm(23957): Link of class 'Lcom/google/ads/mediation/facebook/FacebookAdapter;' failed
02-19 20:07:35.316: W/Ads(23957): Could not instantiate mediation adapter: com.google.ads.mediation.facebook.FacebookAdapter. com.google.ads.mediation.facebook.FacebookAdapter

According to this and this post, this should happen only if I used proguard, which I don't.

Does anyone has a suggestion on why this happens?

And why doesn't the Facebook itself have any documentation on how to integrate the Audience Network via AdMob, since the first is supported by the latter one? :-)

Community
  • 1
  • 1
Dimitris
  • 419
  • 4
  • 19

2 Answers2

0

It doesn't look like com/google/ads/mediation/facebook/FacebookAdapter is contained within your APK. Check your APK, your build process, how you have added the FacebookAdapter library and the contents of the FacebookAdapter library itself.

William
  • 20,150
  • 8
  • 49
  • 91
  • Thanks William, the point is that I have run through the process of re-creating the entire APK many times, including cleaning up the project. Both jars are copied to my "libs" folder. I have followed the same procedure with other mediation networks, which also simply require to add their SDK and adapter jars to the project libs folder. Regarding the adapter, I have only the jar, so how could I see what's inside? I was wondering if there is a specific process in Eclipse to add the FacebookAdapter, but Facebook has no documentation!! – Dimitris Feb 21 '15 at 08:01
  • Use an unzip/unjar tool to open up the FacebookAdapter jar and see if the class is inside it. – William Feb 21 '15 at 13:20
  • OK, I did it. I have used the "jar xf" to unjar it. I opened it and within each class, part of it has text, part of it has non-readable text. I have uploaded it here ( https://www.dropbox.com/s/bs3sgzbtnlry80p/FacebookAdapter_unjared.rar?dl=0 ), in case you would like to see it. However, I would still be surprised if something is wrong with the Adapter, since it was downloaded from the official website!! :) – Dimitris Feb 22 '15 at 14:43
  • Yes, when I unjared, it I found the following files: FacebookAdapter.class, FacebookAdapter$BannerListener.class, and FacebookAdapter$InterstitialListener.class – Dimitris Feb 25 '15 at 08:17
0

I tried with a banner ad. Wanted to load ads from Facebook Audience Networrk through Admob mediation when I ended up with the same error.

Please make sure you added the Google Play Services Lib to your build path and check if your version of the Google Play Services Lib contains the MediationInterstitialAdapter.class and the MediationNativeAdapter.class. Mine did not (still working with eclipse) and so the FacebookAdapter was searching for a class that was not there.

After updating to a newer version (links here: How to download older google play services?) the mediation now works fine for me. :)

Community
  • 1
  • 1
Richard R
  • 873
  • 6
  • 20