尝试创建APK时出现Proguard错误

时间:2018-07-29 15:46:02

标签: android facebook proguard ads

这是错误

com.google.ads.mediation.facebook.FacebookAdapter: can't find referenced method 'void setAdListener(com.facebook.ads.AdListener)' in program class com.facebook.ads.NativeAd    
com.google.ads.mediation.facebook.FacebookAdapter$AppInstallMapper: can't find referenced method 'java.lang.String getAdTitle()' in program class com.facebook.ads.NativeAd 
com.google.ads.mediation.facebook.FacebookAdapter$AppInstallMapper: can't find referenced method 'com.facebook.ads.NativeAd$Image getAdCoverImage()' in program class com.facebook.ads.NativeAd 
com.google.ads.mediation.facebook.FacebookAdapter$AppInstallMapper: can't find referenced class com.facebook.ads.NativeAd$Image 
com.google.ads.mediation.facebook.FacebookAdapter$AppInstallMapper: can't find referenced method 'java.lang.String getAdBody()' in program class com.facebook.ads.NativeAd  
com.google.ads.mediation.facebook.FacebookAdapter$AppInstallMapper: can't find referenced method 'com.facebook.ads.NativeAd$Image getAdIcon()' in program class com.facebook.ads.NativeAd   
com.google.ads.mediation.facebook.FacebookAdapter$AppInstallMapper: can't find referenced method 'void setNativeAd(com.facebook.ads.NativeAd)' in program class com.facebook.ads.MediaView  
com.google.ads.mediation.facebook.FacebookAdapter$AppInstallMapper: can't find referenced method 'com.facebook.ads.NativeAd$Rating getAdStarRating()' in program class com.facebook.ads.NativeAd    
com.google.ads.mediation.facebook.FacebookAdapter$AppInstallMapper: can't find referenced method 'java.lang.String getAdSubtitle()' in program class com.facebook.ads.NativeAd  
com.google.ads.mediation.facebook.FacebookAdapter$AppInstallMapper: can't find referenced method 'AdChoicesView(android.content.Context,com.facebook.ads.NativeAd,boolean)' in program class com.facebook.ads.AdChoicesView 
com.google.ads.mediation.facebook.FacebookAdapter$AppInstallMapper: can't find referenced method 'void registerViewForInteraction(android.view.View,java.util.List)' in program class com.facebook.ads.NativeAd 
com.google.ads.mediation.facebook.FacebookAdapter$AppInstallMapper: can't find referenced class com.facebook.ads.NativeAd$Rating    
com.google.ads.mediation.facebook.FacebookAdapter$AppInstallMapper: can't find referenced class com.facebook.ads.NativeAd$Image 
com.google.ads.mediation.facebook.FacebookAdapter$AppInstallMapper: can't find referenced class com.facebook.ads.NativeAd$Rating    

我的图书馆项目中有这个

api ('com.facebook.android:audience-network-sdk:4.99.1'){
    exclude group: 'com.android.support', module: 'appcompat-v7'
}
api 'com.google.ads.mediation:facebook:4.28.2.0'

并将其保存在我的应用的防护程序中

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

该应用程序无需proguard即可运行,并且如果我可以从代码中访问这些无法找到的类。我尝试了所有可以想到的事情,例如将API更改为应用程序,将proguard更改为直接保留com.facebook.ads.NativeAd

0 个答案:

没有答案