gpt4 book ai didi

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

转载 作者:搜寻专家 更新时间:2023-11-01 09:29:11 24 4
gpt4 key购买 nike

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
jcenter()

}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
google()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}




apply plugin: 'com.android.application'

android {
signingConfigs {
}
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId 'net.example.net.app'
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/DEPENDENCIES'
}
productFlavors {
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
compile('org.apache.httpcomponents:httpmime:4.3.4') {
exclude module: 'org.apache.httpcompoents:httpcore'
exclude module: 'org.apache.httpcompoents:httpclient'
}
compile 'org.codehaus.jackson:jackson-core-asl:1.8.3'
compile 'org.codehaus.jackson:jackson-mapper-asl:1.8.3'
}

Error:java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex Error:java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex Error:com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex Error:com.android.dex.DexException: Multiple dex files define Lorg/apache/http/conn/socket/LayeredConnectionSocketFactory;

最佳答案

Error:java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

您应该升级您的 gms:play-servicescom.android.support 版本。

 compile 'com.google.android.gms:play-services:11.6.0' //11.8.0
compile 'com.android.support:support-v4:26.0.2'
compile 'com.android.support:appcompat-v7:26.0.2'

之后,Clean-Rebuild-Run

仅供引用

启用multiDexEnabled .

 defaultConfig {
multiDexEnabled true
}

关于java - 错误 :java. lang.RuntimeException : java. lang.RuntimeException : com. android.builder.dexing.DexArchiveMergerException:无法合并 dex,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48622537/

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