如何在合并dex档案时解决错误?

问题描述 投票:0回答:2

我在Build面板中遇到此错误:

* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
  Program type already present: com.parse.AbstractQueryController$1

将这个库实现'com.parse:parse-livequery-android:1.0.6'添加到我现有的实现后,他们是这些:

  implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
    implementation 'com.google.android.material:material:1.1.0-alpha04'
    implementation 'com.google.android.gms:play-services:11.4.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.2-alpha01'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.2-alpha01'
    //image_view_cornered_lib
    implementation 'com.github.siyamed:android-shape-imageview:0.9.3@aar'
    //circle image view lib
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    //parse libs here
    implementation 'com.github.parse-community.Parse-SDK-Android:parse:1.19.0'
    implementation 'com.github.parse-community.Parse-SDK-Android:fcm:1.19.0'
    implementation 'com.github.parse-community.Parse-SDK-Android:ktx:1.19.0'
android parse-platform
2个回答
0
投票

你试过这个:

在app / build.gradle中:

android {
    defaultConfig {
       multiDexEnabled true
    }
}

0
投票

com.parse.AbstractQueryController模块由多个库使用

在你的情况下,它必须是com.parse:parse-livequery-android:1.0.6com.github.parse-community.Parse-SDK-Android:parse:1.19.0

要查找模块应用程序的依赖项列表(应用程序的默认模块名称),我们可以执行此操作

gradlew app:依赖项

检索所有库的列表。

在您发现使用两次不同版本的模块后,将其排除在外

implementation ('com.parse:parse-livequery-android:1.0.6') {
    exclude module: 'duplicated module'
}
© www.soinside.com 2019 - 2024. All rights reserved.