- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在 Eclipse 上开发一个应用程序。我需要在其中使用以下库
1) 紧凑型
2) Google Play 服务
3) LiveSDK
4) json.jar
当我尝试运行我的项目时出现此错误。
Dex Loader] 无法执行 dex:方法 ID 不在 [0, 0xffff] 中:65536
转换为 Dalvik 格式失败:无法执行 dex:方法 ID 不在 [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
-optimizationpasses 5 -dontusemixedcaseclassnames -不要跳过非公共(public)图书馆类(class) -不要预先验证 -冗长 -优化 !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;
}
帮帮我!!
最佳答案
您已超过 65k 个方法限制。所以你想要的是启用 multidex 或在你的应用程序 + 库中有少于 65k 的方法。
有一个 multidex 支持库,但 ant 或 eclipse 不支持它。 https://plus.google.com/+AndroidDevelopers/posts/HQM7qeosJoF
您还可以加载单独的 Play Services API,因为您可能并不需要全部 https://developers.google.com/android/guides/setup
但您仍然需要 AS 和 gradle。
显然你可以将 gradle 与 eclipse 一起使用,但我从未尝试过
Is it possible to use the Gradle build system for Android with Eclipse?
我的建议是迁移到 Android Studio
关于java - 无法在 Eclipse 中执行 dex : method ID not in [0, 0xffff]: 65536,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31586675/
以下代码行与 Visual Studio 2013 一起运行: wchar_t test[] = L"\xffff"; wchar_t buf[100]; int ret = swprintf(
我是一名优秀的程序员,十分优秀!