googleads / googleads-mobile-unity

Official Unity Plugin for the Google Mobile Ads SDK
https://developers.google.com/admob/unity
Apache License 2.0
1.34k stars 1.09k forks source link

GMA 8.7.0 - Execution failed for task ':launcher:mergeReleaseJavaResource' #3124

Closed madTeddy closed 5 months ago

madTeddy commented 5 months ago

[REQUIRED] Step 1: Describe your environment

[REQUIRED] Step 2: Describe the problem

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:mergeReleaseJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 2 files found with path 'META-INF/kotlinx-serialization-json.kotlin_module' from inputs:
      - C:\Users\razeb\.gradle\caches\transforms-3\601683efc9a8009dee4a884706bb4564\transformed\jetified-org.jetbrains.kotlinx.kotlinx-serialization-json-1.3.2.jar
      - C:\Users\razeb\.gradle\caches\transforms-3\f8521230d3476b2848d15cbf5122e7e7\transformed\jetified-org.jetbrains.kotlinx.kotlinx-serialization-json-jvm-1.3.2.jar
     Adding a packagingOptions block may help, please refer to
     https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html
     for more information
madTeddy commented 5 months ago

Ok. The checkbox "Enable kotlinx.coroutines packaging option" was not helpful. But with additional packagingOptions in Main Gradle Template and Launcher Template:

packagingOptions {
    pickFirst('META-INF/kotlinx-serialization-json.kotlin_module')
}

Build was successful. If this bug is not on my side, please fix it.

NVentimiglia commented 5 months ago

Glad you got this working. You are correct that we need the packagingOptions which is added by the SDK.

If you run into more issues, please reopen Nick