我有一个混淆Android代码的问题。我使用Proguard 4.7版和Eclipse作为我的IDE。我将proguard.cfg
更改为:
-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.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * implements android.view.View.OnTouchListener
-keep class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}
-keep class * extends android.preference.Preference {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}
# LVL License binder class
-keep class com.android.vending.licensing.ILicensingService
# This is necessary for LVL among others. According to proguard doc java accesses enum fields by introspection.
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
#Optimization settings
-dontoptimize
当我编译我的项目时,我收到一个错误,我无法解决它。这是错误:
Unable to execute dex: Multiple dex files define Lchangebackground/app/OnSwipeListener
Conversion to Dalvik Format failed: Unable to execute dex: Multiple dex files define Lchangebackground/app/OnSwipeListener
答案 0 :(得分:0)
这通常意味着您要包含两次库,或者您的类路径存在其他一些问题。将所有罐子放在libs /下并清理你的项目。检查同一个库的不同版本,并通过引用的库项目包含库。