我正在尝试为我的Xamarin.Android应用程序创建一个发布版本,但是当我启用Proguard时遇到了问题。我已经通过创建Symlinks解决了与安装在Program Files中的Android-SDK相关的问题。我还通过使用Proguard 5.2.1覆盖Androind-SDK中的Proguard bat文件解决了Java 8支持问题。
现在我遇到了这些我不确定如何解决的问题:
'com.google.android.gms.ads.doubleclick.OnCustomRenderedAdLoadedListener' (TaskId:351)
2> Note: the configuration keeps the entry point 'com.google.android.gms.ads.formats.NativeAdView { void setNativeAd(com.google.android.gms.ads.formats.NativeAd); }', but not the descriptor class 'com.google.android.gms.ads.formats.NativeAd' (TaskId:351)
2> Note: the configuration keeps the entry point 'com.google.android.gms.ads.search.SearchAdView { void setAdListener(com.google.android.gms.ads.AdListener); }', but not the descriptor class 'com.google.android.gms.ads.AdListener' (TaskId:351)
2> Note: the configuration keeps the entry point 'com.google.android.gms.ads.search.SearchAdView { void setAdSize(com.google.android.gms.ads.AdSize); }', but not the descriptor class 'com.google.android.gms.ads.AdSize' (TaskId:351)
2> Note: the configuration keeps the entry point 'com.google.android.gms.plus.PlusOneButton { void setOnPlusOneClickListener(com.google.android.gms.plus.PlusOneButton$OnPlusOneClickListener); }', but not the descriptor class 'com.google.android.gms.plus.PlusOneButton$OnPlusOneClickListener' (TaskId:351)
2> Note: there were 7 references to unknown classes. (TaskId:351)
2> You should check your configuration for typos. (TaskId:351)
2> (http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass) (TaskId:351)
2> Note: there were 3 classes trying to access generic signatures using reflection. (TaskId:351)
2> You should consider keeping the signature attributes (TaskId:351)
2> (using '-keepattributes Signature'). (TaskId:351)
2> (http://proguard.sourceforge.net/manual/troubleshooting.html#attributes) (TaskId:351)
2> Note: there were 74 unkept descriptor classes in kept class members. (TaskId:351)
2> You should consider explicitly keeping the mentioned classes (TaskId:351)
2>PROGUARD : warning : there were 144 unresolved references to classes or interfaces.
2> You may need to add missing library jars or update their versions. (TaskId:351)
2> (using '-keep'). (TaskId:351)
2> (http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass) (TaskId:351)
2> Note: there were 8 unresolved dynamic references to classes or interfaces. (TaskId:351)
2> You should check if you need to specify additional program jars. (TaskId:351)
2> (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass) (TaskId:351)
2> Note: there were 4 accesses to class members by means of introspection. (TaskId:351)
2> You should consider explicitly keeping the mentioned class members (TaskId:351)
2> (using '-keep' or '-keepclassmembers'). (TaskId:351)
2> (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember) (TaskId:351)
2> If your code works fine without the missing classes, you can suppress (TaskId:351)
2> the warnings with '-dontwarn' options. (TaskId:351)
2> (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass) (TaskId:351)
2>PROGUARD : warning : there were 2 unresolved references to program class members.
2> Your input classes appear to be inconsistent. (TaskId:351)
2> You may need to recompile the code. (TaskId:351)
2> (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember) (TaskId:351)
2> java.io.IOException: Please correct the above warnings first. (TaskId:351)
2> at proguard.Initializer.execute(Initializer.java:473) (TaskId:351)
2> at proguard.ProGuard.initialize(ProGuard.java:233) (TaskId:351)
2> at proguard.ProGuard.execute(ProGuard.java:98) (TaskId:351)
2> at proguard.ProGuard.main(ProGuard.java:538) (TaskId:351)
2> Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 (TaskId:351)
注意#1:我已尝试(目前正在使用)“1G”的Java Max堆大小无济于事。
注意#2:我在自定义Proguard.cfg文件中添加了以下两行无效:
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**
任何帮助都将不胜感激!!
答案 0 :(得分:0)
对于在粘贴的构建日志中不可见的未解析引用,您有两个警告。
这些警告可能是无害的,你可以尝试使用-ignorewarnings
来忽略它们,但我仍然建议对它们进行调查,例如因为您缺少必需的库依赖项。