gpt4 book ai didi

java - 无法在 Eclipse 中执行 dex : method ID not in [0, 0xffff]: 65536

转载 作者:行者123 更新时间:2023-11-30 08:49:07 25 4
gpt4 key购买 nike

我正在 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com