googleads-mobile-unity icon indicating copy to clipboard operation
googleads-mobile-unity copied to clipboard

Cannot change resolution strategy of dependency configuration ':unityLibrary:aarArtifacts' after it has been resolved.

Open 2345678910JQKA opened this issue 1 year ago • 7 comments

[REQUIRED] Step 1: Describe your environment

  • Unity version: 2021.3.11f1
  • Google Mobile Ads Unity plugin version: 8.6.0
  • Platform: Android
  • Platform OS version: Android 21
  • Any specific devices issue occurs on: N/A
  • Mediation ad networks used, and their versions: _____

[REQUIRED] Step 2: Describe the problem

  • When targeting API 34 in Unity, I'm seeing the the following error while making a build. I have enabled both the options as mentioned here
  • I need urgent assistance. I have been struggling with this issue for a long time."

Relevant Code:


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':unityLibrary'.
> Cannot change resolution strategy of dependency configuration ':unityLibrary:aarArtifacts' after it has been resolved.

2345678910JQKA avatar Jan 05 '24 13:01 2345678910JQKA

Hi @2345678910JQKA

This is essentially a Gradle issue and can be solved with configuration.

  1. How are you building the application, is this a Gradle build or a Unity build.
  2. Are you using Gradle or EDM4U dependency resolution
  3. What version of gradle are you using

NVentimiglia avatar Jan 09 '24 19:01 NVentimiglia

gradle 7.2

2345678910JQKA avatar Jan 12 '24 10:01 2345678910JQKA

After deleting the "bee" file in the "library" folder, I was able to successfully package it and the playback of advertisements worked. However, I'm not sure why this happened.

2345678910JQKA avatar Jan 12 '24 10:01 2345678910JQKA

This issue still happens to me if I have jetifier enabled in my gradle properties. When I remove these two lines I can get a build. Is there a way to make it happen with these settings applied to gradle.properties file? With keeping the current gradle that comes with Unity 2019 (Gradle 6.1.1) and with Gradle build tools version 4.0.1?

android.useAndroidX=true
android.enableJetifier=true

sametguzeldev avatar Jan 12 '24 21:01 sametguzeldev

@NVentimiglia Hey! Is it possible to use an older sdk for ads library like 22.2.0 maybe? Currently I see 22.6.0 is required for ump 2.1 version. 'com.google.android.gms:play-services-ads:22.6.0'

I can get a success build with older version and from my testing, it seems like UMP works as well but I just wanted to confirm it.

sametguzeldev avatar Jan 15 '24 02:01 sametguzeldev

@sametguzeldev , @2345678910JQKA

I was unable to replicate this issue on Unity 2021.3 / Plugin 8.6 / Api level 34. I recommend uninstalling and reinstalling the plugin and clearing your android gradle cache.

NVentimiglia avatar Jan 16 '24 23:01 NVentimiglia

Unity 2021.3.29 / Plugin 8.7.0 / API 33-34 and internal Gradle still fails. None of the workarounds help solve the issue.

kshkulev avatar Feb 07 '24 07:02 kshkulev

@kshkulev have yo tried using a Custom Base Gradle Template ?

NVentimiglia avatar Mar 22 '24 21:03 NVentimiglia

@NVentimiglia yup, it didn't help. But after upgrading plugin to 9.0.0 I can now build successfully.

kshkulev avatar Apr 01 '24 08:04 kshkulev

Great, Glad it is working now.

NVentimiglia avatar Apr 03 '24 17:04 NVentimiglia