【发布时间】:2015-07-23 11:57:17
【问题描述】:
我正在 Eclipse 上开发一个应用程序。其中我需要使用以下libraries
1) 应用压缩
2) 谷歌播放服务
3) LiveSDK
4) json.jar
当我尝试运行我的项目时,它给出了这个错误。
Dex Loader] Unable to execute dex: method ID not in [0, 0xffff]: 65536
Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536
即使我已经从 Java Buid Path 中删除了库,但我仍然收到此错误。
我也使用了progaurd,但错误没有解决。这是我的 progarud 文件
project.properties
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-22
android.library.reference.1=./workspace2/google-play-services_lib
android.library.reference.2=./workspace2/LiveSdk
android.library.reference.3=./android/workspace2/appcompat_v7
proguard-project.txt
-优化通过 5 -dontusemixedcase类名 -dontskipnonpubliclibraryclasses -dontpreverify -详细 -优化 !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 * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-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 class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keep class * extends java.util.ListResourceBundle {
protected Object[][] getContents();
}
-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
public static final *** NULL;
}
-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
@com.google.android.gms.common.annotation.KeepName *;
}
-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
}
帮帮我!!
【问题讨论】:
-
清除您的
yourProject-->bin-->dexedlibs folder,然后删除所有libraries,然后再次添加所有libraries -
@MD 仍然有同样的错误
-
@JesusFreke,这不会解决我的问题。在那个链接上给出的答案是
AndroidStudio而不是Eclipse。