Duplicate androidx-multidex when building extensionsin

Hi!
I want to make my first extension for appodeal for android and faced a problem with duplication of resources

androidx-multidex.jar is defined multiple times

    Error in /var/extender/sdk/504de7800fa81847bfc2e26a21973899db9dd747/defoldsdk/ext/share/java/androidx-multidex.jar:androidx/multidex/BuildConfig.class:
    Type androidx.multidex.BuildConfig is defined multiple times: /var/extender/sdk/504de7800fa81847bfc2e26a21973899db9dd747/defoldsdk/ext/share/java/androidx-multidex.jar:androidx/multidex/BuildConfig.class, /tmp/.gradle/unpacked/androidx.multidex-multidex-2.0.1.aar/classes.jar:androidx/multidex/BuildConfig.class

build.grade

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

repositories {
        mavenCentral()
        maven { url "https://artifactory.appodeal.com/appodeal"}
}

dependencies {
    implementation 'com.appodeal.ads:sdk:3.0.2.+'
}

i tried to exclude from manifest - but it didn’t work (
ext.manifest

name: "AppodealSdkAds"

platforms:
  android:
    context:
        aaptExtraPackages: ['androidx-multidex']

Please any help. Thank you!

1 Like

ok i solved it. Created a manifest

platforms:
    android:
        context:
            excludeJars: ["(.*)/androidx-multidex.jar"]

it works!

4 Likes