Build Failed On Unity With Latest Admob

2,276 views
Skip to first unread message

Ridwan Fauzy

unread,
Nov 22, 2023, 9:50:18 PM11/22/23
to Google Mobile Ads SDK Developers
I am using admob (8.6.0) , API LEVEL (min API 19 - max API 33), gradle version (6.9.3).
enableKotlinXCoroutinesPackagingOption(true)
Remove property tag from GMA Android SDK(true)


Execution failed for task ':launcher:mergeReleaseJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > More than one file was found with OS independent path 'META-INF/kotlinx_coroutines_core.version'.


how to fix it? Please

Mobile Ads SDK Forum Advisor

unread,
Nov 22, 2023, 10:03:16 PM11/22/23
to ridwan...@gmail.com, google-adm...@googlegroups.com

Hi Ridwan Fauzy, 

Thank you for getting back to us.

By reviewing your concern, I understand that you are facing build issues. Kindly provide the below information for further investigation:

  • app ID
  • ad unit ID
  • Sample project which replicates the issue
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02qUeGQ:ref"

Thanks,
 
Google Logo Mobile Ads SDK Team


Mobile Ads SDK Forum Advisor

unread,
Nov 22, 2023, 10:09:07 PM11/22/23
to google-adm...@googlegroups.com, ridwan...@gmail.com

Hi Ridwan Fauzy, 

Thank you for contacting the Mobile Ads SDK support team.

I see that you have already raised this concern on another thread with the subject 'Build Failed On Unity With Latest Admob', and we have already responded to this issue. To avoid multiple threads on the same issue, please take a look at that thread and continue the discussion on the same for further updates on the issue. 

Mobile Ads SDK Forum Advisor

unread,
Nov 22, 2023, 10:16:30 PM11/22/23
to google-adm...@googlegroups.com, ridwan...@gmail.com

Hi Ridwan Fauzy, 

kindly ignore the previous mail and provide the required information on this thread.
 

Luis Gualandi

unread,
Nov 30, 2023, 11:46:04 AM11/30/23
to Google Mobile Ads SDK Developers
I'm also experiencing this with the latest version.
I see there's a new setting "Enable kotlinx.coroutines packaging option" which aims to fix exactly this but it simply doesn't help.
Testing on a blank project with just admob

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':unityLibrary:mergeReleaseJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 2 files found with path 'META-INF/kotlinx_coroutines_core.version' from inputs:
      - C:\Users\luis_\Documents\Unity Projects\Test Project\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\libs\org.jetbrains.kotlinx.kotlinx-coroutines-core-1.7.1.jar
      - C:\Users\luis_\Documents\Unity Projects\Test Project\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\libs\org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.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

Mobile Ads SDK Forum Advisor

unread,
Dec 1, 2023, 10:08:27 AM12/1/23
to luis_muss...@hotmail.com, google-adm...@googlegroups.com

Hi Luis, 

Thank you for getting back to us.

By reviewing your concern, I understand that you are facing build issues. Kindly provide the below information for further investigation:

  • app ID
  • ad unit ID
  • Sample project which replicates the issue
 

Luis Gualandi

unread,
Dec 1, 2023, 5:42:51 PM12/1/23
to Google Mobile Ads SDK Developers
Test project: https://infopar-my.sharepoint.com/:u:/g/personal/luis_gualandi_com_br/ERrzO2fecp1FqUxEh9YU4xMBHTPQAuX4oBMRVowHx9Z2qg?e=LZJbBE
App ID: ca-app-pub-4319354704294023~9378118398 (not sure if helps)
Unity 2022.3.13f1

Mobile Ads SDK Forum Advisor

unread,
Dec 4, 2023, 11:32:43 AM12/4/23
to luis_muss...@hotmail.com, google-adm...@googlegroups.com

Hi Luis,

Thank you for getting back to us.

I will check with our team regarding your issue and one of my team members will reach out to you once we have an update on this. Meanwhile, your patience is highly appreciated. 

Mobile Ads SDK Forum Advisor

unread,
Dec 4, 2023, 7:48:49 PM12/4/23
to luis_muss...@hotmail.com, google-adm...@googlegroups.com
Hello Luis,

Thanks for reaching out.

This might be a Gradle cache issue. Can you check the following:

  1. The environment you are running the build - Unity Editor Version, Gradle version and Android Gradle Plugin version.
  2. Can you confirm the Remove property tag from GMA Android SDK is turned on. This can be found in Assets > Google Mobile Ads > Settings... > Android settings
  3. Also is it possible to clean build with a clean gradle cache. This can be done by deleting the caches folder in gradle installation directory. On a Mac this can be found at: ~/.gradle/caches/

Regards,
Joshua

ref:!00D1U01174p.!5004Q02qUeGQ:ref

Luis Gualandi

unread,
Dec 5, 2023, 12:24:20 PM12/5/23
to Google Mobile Ads SDK Developers
1) I tested in Unity versions 2022.3.13f1 and 2021.3.19f1, with Unity's built in gradle versions

2)Tested with both new settings marked

3) Tried clearing Gradle cache (Windows) still no help

I managed to solve the issue though in Unity 2021 by manually putting this in launcherTemplate.gradle

packagingOptions {
pickFirst  'META-INF/kotlinx_coroutines_core.version'
}

I see that Google is attempting to do just that cuz there's the same snippet in Plugins/Android/GoogleMobileAdsPlugin.androidlib/packaging_options.gradle, but it's not working for some reason, even with the setting regarding this ticked.

With 2022 a new gradle error popped up:

FAILURE: Build failed with an exception.

* Where:
Settings file 'C:\Users\luis_\Documents\Unity Projects\Admob test\Library\Bee\Android\Prj\IL2CPP\Gradle\settings.gradle' line: 14

* What went wrong:
A problem occurred evaluating settings 'Gradle'.
> Could not find method dependencyResolutionManagement() for arguments [settings_2ctfxs0sy1p8yswwt8b52l3qh$_run_closure1@83924f7] on settings 'Gradle' of type org.gradle.initialization.DefaultSettings.

Mobile Ads SDK Forum Advisor

unread,
Feb 18, 2025, 10:42:37 AM2/18/25
to luis_muss...@hotmail.com, google-adm...@googlegroups.com
Hello Luis,


Just wanted to follow up and see if you're still having any issues with the Unity plugin.

If so, I would suggest going through our developer documentation on Build Unity for Android.

Let me know if you need anything else by replying to this email.


Thanks,
 
Google Logo
Joshua Hui
Mobile Ads SDK Team


Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-02-18 15:41:47Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02qUeGQ:ref" (ADR-00212123)

 



Reply all
Reply to author
Forward
0 new messages