Search Issue Tracker

Third Party Issue

Votes

9

Found in

2022.3.10f1

Issue ID

UUM-49559

Regression

Yes

Error "Execution failed for task ':launcher:checkReleaseDuplicateClasses'" is thrown when building with a "Build App Bundle (Google Play)" and "Split Application Binary" enabled at the same time

--

-

How to reproduce:
1. Open the "IN_51273" project
2. In the Project Settings -> Publish make sure the “Split Application Binary” is enabled
3. In the Build Settings make sure "Build App Bundle (Google Play)" is enabled
4. Press Build

Expected result: project is built successfully
Actual result: build failed with an error "Execution failed for task ':launcher:checkReleaseDuplicateClasses'."

Reproducible with: 2022.3.10f1
Not reproducible with: 2021.3.30f1, 2023.1.14f1, 2023.2.0b10, 2023.3.0a4

Reproducible on: Windows 10 Pro
Not reproducible on: No other environment tested

Notes:
- After the first few times of reproducing this issue, the errors started appearing with and without "Split Application Binary" enabled
- Some versions (2021.3.30f1) still have build errors but they are different from the users reported so you can check if the issue reproduces by observing the error given in the description and matching it to the error which shows up in the Console
- Sometimes if the issue doesn't reproduce you need to re-download the project and open it again
- Keep in mind versions written in "Not reproducible with" still have build errors but these are not the same as user-reported
- Didn't search for a regressed version due to reproduction instability and unreasonable long testing time (same reason with a fixed version)
- User mentioned the issue is not reproducible on 2022.2.9f1

User found a workaround that works for him (only worked for me the first time of testing):
1. In the Build Settings enable “Export” and export the project
2. Open file AndroidStudio_project_folder\unityLibrary\build.gradle
3. Replace one string in the dependencies block: “com.google.android.play:asset-delivery:2.0.0” to “com.google.android.play:core:1.10.0” or delete the “com.google.android.play:asset-delivery:2.0.0”

  1. Resolution Note:

    Closing this bug as it is Google External Dependency Manager issue. Google recommends to use custom Gradle templates when using GoogleAds Unity plugin to avoid problem with duplicated symbols - https://developers.google.com/admob/unity/quick-start#include_external_dependencies
    User confirmed that this workaround works for them.

Comments (9)

  1. boriss_unity

    Nov 09, 2023 08:13

    DENDYAK, NP, I'm glad that this solution works for you. And thanks for raising this issue. The fact that it doesn't work out of the box is not good. We have to document this at least.

  2. dendyak

    Nov 09, 2023 07:39

    BORISS_UNITY, I`m sorry, actually your solution works! I was just confused by no aar-s and jar-s files in Assets/Plugins/Android. Thanks, and sorry again for spending your time.

  3. boriss_unity

    Nov 08, 2023 07:35

    DENDYAK, this problem started to happen because we were forced to replace dependency of obsolete com.google.android.play:core package with dependency of com.google.android.play:asset-delivery. This change cannot be reverted. But it appears that Google External Dependency Manager (which is not the Unity developed tool) can't correctly resolve dependencies in this case. Using custom Gradle templates forces Gradle to resolve dependencies itself, which works perfectly for GoogleAds plugin. If it doesn't work for some specific plugin for you - please provide it, so we can check the problem from our side.

  4. dendyak

    Nov 07, 2023 11:07

    BORISS_UNITY, I have attached GoogleAds plugin just for example. The problem happens with any plugin with aar-s/jar-s. It is not related with plugin version because I tested it with different versions of different plugins. The problem related with Unity version, because on old Unity (for exemple: 2022.2.9f1 and earlier) it does not happens. I don`t know when it started but I know for sure the problem exists for 2022.3.5f1 and newer.

  5. boriss_unity

    Nov 07, 2023 09:43

    DENDYAK, the project in this bug report doesn't include any plugins other than GoogleMobileAds. So if there were any non-google/android jar/aar files in Assets/Plugins/Android folder then of course you should keep them. Also you need to make sure that *Dependencies.xml are set correctly for these custom plugins. Without looking at the actual project there is nothing else I can help with.

  6. dendyak

    Nov 07, 2023 04:38

    BORISS_UNITY, after this six steps build will pass successfully, but all my plugins don`t work without those aar-s and jar-s.

  7. boriss_unity

    Nov 06, 2023 10:40

    Can you try if these steps help to resolve the issue?

    1. clean up all aar and jar files and also their metafiles from Assets/Plugins/Android folder
    2. delete Library/Bee/Android/Prj/IL2CPP/Gradle folder
    3. open project
    4. ensure that Custom Main Gradle Template, Custom Gradle Settings Template, Custom Gradle Properties Template are turned on in Player settings
    5. run Assets/Eternal Dependency Manager/Android Resolver/Resolve (it should end immediately, there should be no new files in Assets/Plugins/Android appear)
    6. build AAB

  8. frozenwolfstudio9

    Oct 29, 2023 16:23

    when will this be fixed? currently this is my last step in order to publish my app and it's a very huge inconvenience. no fix has worked for me

  9. dendyak

    Sep 21, 2023 18:35

    or there is more simple way to fix:

    1 - enable Custom Main Gradle Template

    2 - add packagingOptions block into Assets\Plugins\Android\mainTemplate.gradle:

    android {
    ...
    packagingOptions {
    exclude ('com.google.android.play:asset-delivery:2.0.0')
    }
    ...
    }
    3 - after that *.aab builds successfull in Unity

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.