Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When an extension has a dependency on androidx-multidex, it conflicts with Defold SDK multidex. #385

Open
AGulev opened this issue Jun 1, 2024 · 1 comment
Milestone

Comments

@AGulev
Copy link
Contributor

AGulev commented Jun 1, 2024

Type androidx.multidex.BuildConfig is defined multiple times: /var/extender/sdk/d36ee4b6a68f12558ad9be53bcac37b063f8e759/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
Compilation failed
Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /var/extender/sdk/d36ee4b6a68f12558ad9be53bcac37b063f8e759/defoldsdk/ext/share/java/androidx-multidex.jar:androidx/multidex/BuildConfig.class
        at com.android.tools.r8.internal.pj.a(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:98)
        at com.android.tools.r8.D8.main(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:4)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /var/extender/sdk/d36ee4b6a68f12558ad9be53bcac37b063f8e759/defoldsdk/ext/share/java/androidx-multidex.jar:androidx/multidex/BuildConfig.class
        at Version.fakeStackEntry(Version_3.3.20-dev+aosp5.java:0)
        at com.android.tools.r8.internal.pj.a(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:75)
        at com.android.tools.r8.internal.pj.a(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:28)
        at com.android.tools.r8.internal.pj.a(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:27)
        at com.android.tools.r8.internal.pj.b(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:2)
        at com.android.tools.r8.D8.a(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:22)
        at com.android.tools.r8.D8.a(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:17)
        at com.android.tools.r8.internal.pj.a(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:85)
        ... 1 more
Caused by: com.android.tools.r8.internal.f: Type androidx.multidex.BuildConfig is defined multiple times: /var/extender/sdk/d36ee4b6a68f12558ad9be53bcac37b063f8e759/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
        at com.android.tools.r8.internal.RS.a(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:14)
        at com.android.tools.r8.internal.RS.a(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:22)
        at com.android.tools.r8.internal.VM.a(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:36)
        at com.android.tools.r8.internal.VM.a(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:10)
        at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2056)
        at com.android.tools.r8.internal.VM.a(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:6)
        at com.android.tools.r8.graph.E2$a.e(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:4)
        at com.android.tools.r8.dex.b.a(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:105)
        at com.android.tools.r8.dex.b.a(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:28)
        at com.android.tools.r8.D8.a(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:25)
        at com.android.tools.r8.D8.d(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:609)
        at com.android.tools.r8.D8.c(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:1)
               at com.android.tools.r8.internal.pj.a(R8_3.3.20-dev+aosp5_a629c2c3592f558d09a1aa063f8fa13e35ca354216d318a506759ca7374873e0:24)
        ... 5 more

        at com.defold.extender.ProcessExecutor.execute(ProcessExecutor.java:73)
        at com.defold.extender.Extender.executeCommand(Extender.java:322)
        ... 14 common frames omitted
@AGulev
Copy link
Contributor Author

AGulev commented Jun 1, 2024

workaround:
add the following lines into ext.manifest

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants