Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/218.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android合并索引错误_Android_Merge_Android Manifest_Manifest_Dex - Fatal编程技术网

Android合并索引错误

Android合并索引错误,android,merge,android-manifest,manifest,dex,Android,Merge,Android Manifest,Manifest,Dex,错误:任务“:app:transformDexArchiveWithExternalLibsDexMergerForDebug”的执行失败 java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:无法合并dex 您好,我收到上述错误,请解决。在Gradle中尝试以下代码: android { defaultConfig { multiDexEnabled true

错误:任务“:app:transformDexArchiveWithExternalLibsDexMergerForDebug”的执行失败

java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:无法合并dex


您好,我收到上述错误,请解决。

在Gradle中尝试以下代码:

android {
    defaultConfig {
       multiDexEnabled true
    }
}

在应用程序级渐变文件中添加以下代码

  defaultConfig {
        multiDexEnabled true
        }

请在这里更新build.gradle。并在gadel文件中添加multidex enable。 安卓{ 编译DK22版 buildToolsVersion“23.0.0”

}

依赖关系{ 编译'com.android.support:multidex:1.0.3' }`

1)添加多索引启用的true,如下所述

android {
    defaultConfig {
       multiDexEnabled true
    }
}
2) 添加依赖项

compile 'com.android.support:multidex:1.0.1'
3) 在应用程序类中调用下面的方法

@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
}

希望它能帮助你

首先清理项目,然后构建项目

multiDexEnabled true添加到您的build.gradle

android {
    compileSdkVersion xx
    defaultConfig {
      ...
        minSdkVersion xx //make sure your minSDK greater than 14 
        targetSdkVersion xx
        multiDexEnabled true
     ...
    }
}
最后添加依赖性

compile 'com.android.support:multidex:1.0.1'

可能重复的EC工程师可以做Android开发者的工作..太棒了.工程师可以做任何事兄弟。。!
compile 'com.android.support:multidex:1.0.1'