android - 合并 dex 档案时构建 APK 错误时出现错误
问题描述
以下是我的 gradle 文件:我已经清理了我的项目,重建了我的项目。它运行成功,但在构建 APK 时出错。
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId 'com.shipping.customerapp'
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testApplicationId 'shipping1'
}
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries = false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
implementation 'com.shuhart.stickyheader:stickyheader:1.0.5'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.squareup.retrofit2:converter-jackson:2.3.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-iid:17.0.4'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'ch.acra:acra:4.5.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.muditsen.multilevelrecyclerview:multilevelview:1.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.android.libraries.places:places-compat:1.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
已完成任何可能的解决方案,但仍然出现此错误,请帮助。
我得到的错误::
Caused by: java.lang.RuntimeException: com.android.build.api.transform.TransformException: Error while generating the main dex list:
Error while merging dex archives:
解决方案
推荐阅读
- javascript - 带有钩子的功能组件导致“无法读取未定义的属性映射”
- python - 使用 apache2 部署烧瓶应用程序仅显示索引
- php - 应用 jQuery AJAX load() 方法在现有 PHP 网站上异步加载页面内容
- c# - 如何通过变量访问类成员
- database - 最快的基于磁盘的解决方案,可缓存数万亿个唯一 md5 哈希
- node.js - 无法在 Node.Js 中访问 MongoDB 文档的字段
- c# - 如何使用 Unity 格式化 JSON
- python - 在 Conda 环境中,如何升级安装了 pip 的包?
- javascript - 在网络日历中定位 div 元素的问题
- reactjs - 使用 react-dateTime 组件的值设置状态