Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Gradle Build failed on basic project in 2022.2.*

Discussion in 'Editor & General Support' started by Xozyain, Mar 18, 2023.

  1. Xozyain

    Xozyain

    Joined:
    Jun 16, 2017
    Posts:
    10
    I have a project with AppLovin Mediation integrated. It perfectly works on 2019, 2021 branches.
    But in 2022.2 branch (fron .1 to .10) i cant build my project an even basic project with Applovin SDK only.
    Actualy, it builds with Facebook adapter enabled, but fails wit ironsource adapter enabled. (all this is working in previous branches)

    I have "Custom Main Manifest" enabled without any manifest modisication (i will need to make them later)
    Error log for test project (empty Unity 3D temate+ApplovinSDK+Facebook_adapter+Ironsource_Adapter) is:

    Code (CSharp):
    1. FAILURE: Build completed with 2 failures.
    2.  
    3. 1: Task failed with an exception.
    4. -----------
    5. * What went wrong:
    6. Execution failed for task ':unityLibrary:generateReleaseRFile'.
    7. > Could not resolve all dependencies for configuration ':unityLibrary:releaseCompileClasspath'.
    8.   The project declares repositories, effectively ignoring the repositories you have declared in the settings.
    9.   You can figure out how project repositories are declared by configuring your build to fail on project repositories.
    10.   See https://docs.gradle.org/7.2/userguide/declaring_repositories.html#sub:fail_build_on_project_repositories for details.
    11.    > Could not find com.ironsource.sdk:mediationsdk:7.2.7.
    12.      Required by:
    13.          project :unityLibrary > com.applovin.mediation:ironsource-adapter:7.2.7.0.0
    14.  
    15. * Try:
    16. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    17. ==============================================================================
    18.  
    19. 2: Task failed with an exception.
    20. -----------
    21. * What went wrong:
    22. Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
    23. > Could not resolve all dependencies for configuration ':launcher:releaseRuntimeClasspath'.
    24.   The project declares repositories, effectively ignoring the repositories you have declared in the settings.
    25.   You can figure out how project repositories are declared by configuring your build to fail on project repositories.
    26.   See https://docs.gradle.org/7.2/userguide/declaring_repositories.html#sub:fail_build_on_project_repositories for details.
    27.    > Could not find com.ironsource.sdk:mediationsdk:7.2.7.
    28.      Searched in the following locations:
    29.        - https://dl.google.com/dl/android/maven2/com/ironsource/sdk/mediationsdk/7.2.7/mediationsdk-7.2.7.pom
    30.        - https://repo.maven.apache.org/maven2/com/ironsource/sdk/mediationsdk/7.2.7/mediationsdk-7.2.7.pom
    31.        - file:/Users/xozyain/Documents/code/AdsTest2/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/mediationsdk-7.2.7.aar
    32.        - file:/Users/xozyain/Documents/code/AdsTest2/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/mediationsdk.aar
    33.      Required by:
    34.          project :launcher > project :unityLibrary > com.applovin.mediation:ironsource-adapter:7.2.7.0.0
    35.  


    ====

    I found several similar questions and all of them was related to gradle paths issues, but no one helped in my case.

    The same test enviroument on 2019 Unity is bulding without problems
    Help)
     
  2. Starbox

    Starbox

    Joined:
    Sep 17, 2014
    Posts:
    456
    I just love how Unity went from a convenient multiplatform tool that was relatively well self contained to a total monstrosity where learning a secondary tool is totally obligatory to solve such issues. The least thing Unity could do would be to provide a graphical and intuitive interface to have a modicum of control over gradle for at least the most basic tasks.

    The Gradle version included to Unity 2019 was an older version so I wouldn't be the least surprised that it didn't include new cumbersome verifications. My my my, times were good when Gradle was an option. That sh*t tool made me hate Unity with renewed passion. If you still have that old Unity installed, you may try to see if in 2021/2022's External Tools, by pointing to the older Gradle installation, you can run a build without issues. You may want to synchronize the NDS/SDK/Java paths too if the former try fails, just to be sure that all tools are of a version that belongs to the roughly same period.
    Also, IronSource being now part of Unity means that you may be encountering the same problem as if you tried to integrate Unity Ads with the AppLovin adapter through their MAX mediation suite, which might generate similar issues which are solved by doing this:

    This solution is provided here.
     
    CreativeUrge and Shodan0101 like this.