googleads-mobile-unity
googleads-mobile-unity copied to clipboard
Cannot change resolution strategy of dependency configuration ':unityLibrary:aarArtifacts' after it has been resolved.
[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.
Hi @2345678910JQKA
This is essentially a Gradle issue and can be solved with configuration.
- How are you building the application, is this a Gradle build or a Unity build.
- Are you using Gradle or EDM4U dependency resolution
- What version of gradle are you using
gradle 7.2
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.
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
@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 , @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.
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 have yo tried using a Custom Base Gradle Template ?
@NVentimiglia yup, it didn't help. But after upgrading plugin to 9.0.0 I can now build successfully.
Great, Glad it is working now.