gpt4 book ai didi

android - 无法合并dex,Android项目构建失败

转载 作者:行者123 更新时间:2023-11-30 05:12:26 25 4
gpt4 key购买 nike

我已经更新了一个过时的项目并进行了构建gradle的更改,基本上升级了一些gradle依赖项并更改了gradle版本。当我进行清理和重建时,项目构建成功。但是,当我尝试在设备或模拟器上运行它时,它无法构建并出现 transformDexArchiveWithExternalLibsDexMergerForDebug 错误。

我已经尝试了这两个 SO 线程的几乎所有解决方案,但仍然无法使其工作。

  1. Unable to Merge Dex - Android Studio 3.0

  2. Unable to merge dex

下面是我的项目级gradle。

buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// classpath 'com.github.dcendents:android-maven-plugin:1.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'com.google.gms:google-services:3.2.1'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
dependencies {
}

ext {
libraryVersion = "1.0.8"
}

这是应用模块 gradle。

apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'

defaultConfig {
applicationId "com.dapp.myapp"
minSdkVersion 16
targetSdkVersion 28
multiDexEnabled true
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/notice.txt'
}
buildTypes {

release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
aaptOptions {
cruncherEnabled = false
useNewCruncher = false
}

lintOptions {
disable 'MissingTranslation'
}

dexOptions {
jumboMode true
javaMaxHeapSize "4g"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':maskedEditText')
implementation project(':aPV')
//implementation files('libs/libGoogleAnalyticsServices.jar')
//compile 'com.android.support:appcompat-v7:19.1.0'
implementation files('libs/simple-xml-2.7.1.jar')
implementation project(':segmentControl')
implementation files('libs/gcm.jar')
implementation project(':UpPlatformSdk')
implementation files('libs/scribe-1.3.7.jar')
implementation files('libs/signpost-commonshttp4-1.2.1.2.jar')
implementation files('libs/signpost-core-1.2.1.2.jar')
// compile 'com.github.PhilJay:MPAndroidChart:v2.1.0'
implementation files('libs/joda-time-2.0.jar')
implementation project(':MPChartLib')
implementation files('libs/apache-httpcomponents-httpclient.jar')
implementation files('libs/apache-httpcomponents-httpcore.jar')
/*compile 'com.google.android.gms:play-services:8.4.0'*/
implementation files('libs/libphonenumber-3.8.jar')
implementation files('libs/ebizcharge-sdk.jar')
//compile project(':slicepaymentlibrary')

//compile project(':camerafragment')
implementation project(':camerafragment')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.loopj.android:android-async-http:1.4.5'
implementation 'com.android.support:customtabs:28.0.0'
//implementation 'com.google.android.gms:play-services-identity:16.0.0'
implementation 'com.google.android.gms:play-services-gcm:16.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
}

构建日志 enter image description here

完整的错误堆栈跟踪,因为粘贴到这里超出了字符限制

https://pastebin.com/Zukca8FM

感谢任何帮助。谢谢。

最佳答案

更新您的 Google 服务依赖项:

classpath 'com.google.gms:google-services:3.3.0'

Firebase versioning style has changed ,这可能会导致库冲突引起的问题。

关于android - 无法合并dex,Android项目构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53496978/

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