1

自最初发布以来,我一直在使用 Android Studio,没有任何 ProGuard 问题。今天突然停止工作了。据我所知,任何会干扰 Proguard 的文件都没有改变。例如,我的 ProGuard 配置文件保持不变,并且自上次成功构建以来,ActionBarSherlock(现在遇到错误的模块之一)没有以任何方式更改。

推荐使用的错误日志-dontskipnonpubliclibraryclassmembers并不能解决问题。使用包含的默认配置而不是我自己的配置运行 ProGuard 仍然会导致相同的错误。

据我所知,当 Android Studio 构建我的应用程序时,模块现在正在从应用程序中剥离。我不确定它是否只是没有将适当的标志传递给 ProGuard,或者 Proguard 是否自行删除它们。

一些相关日志:

ProGuard: [Meditation Assistant] Warning: com.actionbarsherlock.widget.SuggestionsAdapter: can't find referenced field 'android.content.Context mContext' in class com.actionbarsherlock.widget.SuggestionsAdapter
ProGuard: [Meditation Assistant] Warning: com.actionbarsherlock.widget.SuggestionsAdapter: can't find referenced method 'android.database.Cursor getCursor()' in class com.actionbarsherlock.widget.SuggestionsAdapter
ProGuard: [Meditation Assistant] Warning: com.actionbarsherlock.widget.SuggestionsAdapter: can't find referenced field 'android.database.Cursor mCursor' in class com.actionbarsherlock.widget.SuggestionsAdapter
--snip--
ProGuard: [Meditation Assistant]       You should check if you need to specify additional program jars.
ProGuard: [Meditation Assistant] Warning: there were 10 unresolved references to classes or interfaces.
ProGuard: [Meditation Assistant]          You may need to specify additional library jars (using '-libraryjars').
ProGuard: [Meditation Assistant] Warning: there were 191 unresolved references to program class members.
4

2 回答 2

1

讯息

Warning: there were 10 unresolved references to classes or interfaces.

建议 ProGuard 找不到一些需要的类。这些类列在 ProGuard 早期的控制台输出中。您应该检查所有必要的 jar 是否在目录“libs”中。在这种情况下,android-support-v4.jar 可能会丢失。

于 2013-06-30T23:20:59.573 回答
0

I solved it adding the following line to proguard-project.txt:

-libraryjars libs/android-support-v4.jar

In case of using Eclipse do not forget to clean the project before exporting the APK.

于 2013-06-27T20:29:27.737 回答