【问题标题】:Android with eclipse proguard.cfg problemsAndroid 出现 eclipse proguard.cfg 问题
【发布时间】:2012-02-20 09:24:13
【问题描述】:

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

我遇到了类似的错误

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

我没有接触过 proguard.cfg 文件。

我已经清理了我的应用程序并重新打开了我的应用程序。没有运气。

有什么想法吗?

问候

【问题讨论】:

    标签: android eclipse compiler-errors


    【解决方案1】:

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

    当 Lint 产生错误时,

    • 进入 lint 警告视图(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 *;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-07-10
      • 2011-05-03
      • 1970-01-01
      • 2017-07-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多