11

I'm currently using Proguard in my app, and the Audience Network is not working. I need some different configuration, rather than the usual:

-keep class com.facebook.** { *; }

The problem is the integration guide doesn't refer any kind of Proguard configuration. Does someone already faced this problem and figured out what is missing?

Sergio Carneiro
  • 3,726
  • 4
  • 35
  • 51
  • I'm using the same setting and it works fine. Can you elaborate on which class / function breaks for you? – Amir Naor Aug 06 '14 at 01:11
  • It doesn't break anywhere. I also receive test ads (just a screen saying it's everything fine). But when I try to receive real ads, I don't see anything. Then I remove the ProGuard obfuscation and it starts to work. – Sergio Carneiro Aug 14 '14 at 03:07

4 Answers4

6

I need some different configuration, rather than the usual:

-keep class com.facebook.** { *; }

You need to use

-keep class com.facebook.ads.** { *; }

proguard configuration to show Facebook Audience Network.Because inAudienceNetwork.jar the main package is com.facebook.ads

Giru Bhai
  • 14,370
  • 5
  • 46
  • 74
  • didn't get you.please elaborate. – Giru Bhai Jul 27 '15 at 06:10
  • 3
    `-keep class com.facebook.** { *; }` keeps everything in this package including the .ads.** and `-keep class com.facebook.ads.** { *; }` keeps everything under the ads.** package so basically the result is the same with both instructions. Ads package is being kept either way right? – ThanosFisherman Jul 27 '15 at 12:38
  • @ThanosF you are right as Ads package is being kept,but in `-keep class com.facebook.** { *; }` Proguard will kept all facebook classes also such as for e.g. it will kept login and messenger class also if Facebook login implemented.But in `com.facebook.ads.** { *; }` it will kept Ads classes and same would apply for login `com.facebook.login.** { *; }`. – Giru Bhai Feb 29 '16 at 05:09
5
-keep class com.facebook.ads.** { *; }
-dontwarn com.facebook.ads.**
Abhijit
  • 360
  • 4
  • 14
  • 6
    While this code snippet may solve the question, [including an explanation](//meta.stackexchange.com/questions/114762/explaining-entirely-code-based-answers) really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion. Please also try not to crowd your code with explanatory comments, this reduces the readability of both the code and the explanations! – kayess Dec 06 '16 at 09:49
2

simply use

-keep class com.facebook.ads.** { *; }
Williem
  • 1,131
  • 1
  • 12
  • 19
0

Please write these line in proguard-rules.pro file

-keep class com.facebook.ads** {
   *;
}
-dontwarn
-ignorewarnings
Tariq Mahmood
  • 147
  • 15