Android 与 eclipse proguard.cfg 问题

发布于 2025-01-07 05:34:06 字数 266 浏览 1 评论 0原文

到目前为止,我的应用程序运行良好。

我收到错误,就像

Obsolete proguard file; use -keepclasseswithmembers instead of -keepclasseswithmembernames proguard.cfg

我没有触及 proguard.cfg 文件一样。

我已经清理了我的申请并重新打开了我的申请。没有运气。

有什么想法吗?

问候

My application works fine until now.

I'm getting error like

Obsolete proguard file; use -keepclasseswithmembers instead of -keepclasseswithmembernames proguard.cfg

I haven't touched proguard.cfg file.

I have already cleaned my application and also reopened my application. Without luck.

Any ideas?

Regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

江湖正好 2025-01-14 05:34:06

这是 SDK 工具 v11 的一个错误。
http://code.google.com/p/android/issues/detail ?id=16384

当 Lint 产生错误时,

  • 进入 lint warnings 视图(Window > Show View > Other > android > Lint warnings),双击错误进行修改proguard.cfg

  • 将“keepclasseswithmembernames”重命名为“keepclasseswithmembers”在线显示错误并保存。

  • 再次运行 Lint(在 Lint 警告视图中单击刷新)

  • 如果在后续行中显示进一步警告,请重复重命名。

我把我的改成了这个样子。

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class com.android.vending.licensing.ILicensingService

-keepclasseswithmembernames class * {
    native <methods>;
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

This is a bug with the SDK tools v11.
http://code.google.com/p/android/issues/detail?id=16384

When Lint generates error,

  • go to lint warnings view (Window > Show View > Other > android > Lint Warnings) and double click the error to modify proguard.cfg

  • rename "keepclasseswithmembernames" to "keepclasseswithmembers" on line it shows error and save.

  • run Lint again (click refresh in Lint Warnings view)

  • repeat renaming if it shows further warnings in subsequent lines.

I changed mine to look like this.

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class com.android.vending.licensing.ILicensingService

-keepclasseswithmembernames class * {
    native <methods>;
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文