【问题标题】:Error in Android Studio when running my application [duplicate]运行我的应用程序时 Android Studio 出错 [重复]
【发布时间】:2016-05-30 19:27:45
【问题描述】:

我正在尝试在 android studio 上开发新应用,我曾经在 e 上工作

 UNEXPECTED TOP-LEVEL EXCEPTION:
  com.android.dex.DexIndexOverflowException: method ID not in [0,          
  0xffff]: 65536
at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:484)
at    com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:261)
   Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
 com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

这个错误可能是什么?

我已将一些 jar 文件移动到我的 Eclipse 中。而我的build.gradle是这样的

   apply plugin: 'com.android.application'
     android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
    applicationId "com.netvariant.heinz"
    minSdkVersion 14
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'),     'proguard-rules.pro'
    }
}}dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'}

【问题讨论】:

标签: java android


【解决方案1】:

我认为您的 dex 文件已达到其最大方法数。尝试使用

multiDexEnabled true

在您的默认配置中或尝试从您的依赖项中最小化您的播放服务。仅使用必需的软件包。尝试更改您的版本或排除不需要的软件包

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-03
    • 1970-01-01
    • 2015-04-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多