Search Unity

Question Gradle build failed after updating to Unity 2021.3.14

Discussion in 'Android' started by FogCZ, Nov 24, 2022.

  1. FogCZ

    FogCZ

    Joined:
    Apr 30, 2020
    Posts:
    30
    Hello, so I am currently having trouble with building my game for Android, I published my game to Google Play already and built it many times before. I was suggested by Unity to use Custom Main Gradle Template and Custom Gradle Properties Template, I don't really know what it does I just ticked the box. Now when I try to build the game I get this Gradle Failed Error.

    FAILURE: Build completed with 3 failures.

    1: Task failed with an exception.
    -----------
    * What went wrong:
    Cannot isolate parameters com.android.build.gradle.internal.dependency.AarResourcesCompilerTransform$Parameters_Decorated@5aab0f73 of artifact transform AarResourcesCompilerTransform
    > Could not isolate value com.android.build.gradle.internal.dependency.AarResourcesCompilerTransform$Parameters_Decorated@5aab0f73 of type AarResourcesCompilerTransform.Parameters
    > Could not resolve all files for configuration ':launcher:_internal_aapt2_binary'.
    > Could not resolve com.android.tools.build:aapt2:4.0.1-6197926.
    Required by:
    project :launcher
    > Cannot find a version of 'com.android.tools.build:aapt2' that satisfies the version constraints:
    Dependency path 'Gradle:launcher:unspecified' --> 'com.android.tools.build:aapt2:4.0.1-6197926'
    Constraint path 'Gradle:launcher:unspecified' --> 'com.android.tools.build:aapt2:{strictly 3.6.0-6040484}' because of the following reason: dependency was locked to version '3.6.0-6040484'

    > Could not resolve com.android.tools.build:aapt2:{strictly 3.6.0-6040484}.
    Required by:
    project :launcher
    > Cannot find a version of 'com.android.tools.build:aapt2' that satisfies the version constraints:
    Dependency path 'Gradle:launcher:unspecified' --> 'com.android.tools.build:aapt2:4.0.1-6197926'
    Constraint path 'Gradle:launcher:unspecified' --> 'com.android.tools.build:aapt2:{strictly 3.6.0-6040484}' because of the following reason: dependency was locked to version '3.6.0-6040484'
     

    Attached Files:

  2. FogCZ

    FogCZ

    Joined:
    Apr 30, 2020
    Posts:
    30
    Fixed by reinstalling Android Studio, and then using its SDK and NDK Package, seems to be caused by SDK not having a compliant version