2

我尝试使用 Proguard 将我的代码导出到 .apk 文件,但收到很多警告。我尝试了很多解决方案,但无法解决。有任何想法吗?

[2012-12-02 22:24:05 - com.crossrt.showtime.Main] Warning: android.support.v4.widget.ScrollerCompatIcs: can't find referenced method 'float getCurrVelocity()' in class android.widget.Scroller
[2012-12-02 22:24:05 - com.crossrt.showtime.Main] Warning: android.support.v4.widget.SearchViewCompatHoneycomb$1: can't find referenced class android.widget.SearchView$OnQueryTextListener
[2012-12-02 22:24:05 - com.crossrt.showtime.Main] Warning: android.support.v4.widget.SearchViewCompatHoneycomb$1: can't find referenced class android.widget.SearchView
[2012-12-02 22:24:05 - com.crossrt.showtime.Main] Warning: there were 242 unresolved references to classes or interfaces.
[2012-12-02 22:24:05 - com.crossrt.showtime.Main]          You may need to specify additional library jars (using '-libraryjars').
[2012-12-02 22:24:05 - com.crossrt.showtime.Main] Warning: there were 47 unresolved references to program class members.
[2012-12-02 22:24:05 - com.crossrt.showtime.Main]          Your input classes appear to be inconsistent.
[2012-12-02 22:24:05 - com.crossrt.showtime.Main]          You may need to recompile them and try again.
[2012-12-02 22:24:05 - com.crossrt.showtime.Main]          Alternatively, you may have to specify the option 
[2012-12-02 22:24:05 - com.crossrt.showtime.Main]          '-dontskipnonpubliclibraryclassmembers'.
[2012-12-02 22:24:05 - com.crossrt.showtime.Main] java.io.IOException: Please correct the above warnings first.
[2012-12-02 22:24:05 - com.crossrt.showtime.Main]   at proguard.Initializer.execute(Initializer.java:321)
[2012-12-02 22:24:05 - com.crossrt.showtime.Main]   at proguard.ProGuard.initialize(ProGuard.java:211)
[2012-12-02 22:24:05 - com.crossrt.showtime.Main]   at proguard.ProGuard.execute(ProGuard.java:86)
[2012-12-02 22:24:05 - com.crossrt.showtime.Main]   at proguard.ProGuard.main(ProGuard.java:492)
4

1 回答 1

10

支持类是指不一定存在于所有 Android 版本中的运行时类和方法。他们确实以安全的方式处理这个问题:代码适用于所有 Android 版本——这就是他们的目的。因此,您可以在配置文件 proguard-project.txt 中告诉 ProGuard 忽略这些问题:

-dontwarn android.support.**

参照。ProGuard 手册 > 疑难解答 >警告:找不到引用的类

于 2012-12-02T23:31:30.280 回答