Search Issue Tracker

Fixed

Fixed in 2023.2.10f1, 2023.3.0b7, 2024.1.0a1

Votes

0

Found in

2023.2.7f1

2023.3.0b4

2024.1.0a1

Issue ID

UUM-61916

Regression

No

[Android] Build fails with "Execution failed for task :launcher:checkReleaseAarMetadata" when Android Target API Level is set to any Level less than 33 and Application Entry Point is set to GameActivity

--

-

Reproduction steps:
1. Open the attached project “ReproProject”
2. Set Target API Level and Minimal API to either (30,31,32) at (menu: Project Settings > Player > Other Settings > Identification)
3. Set the Application Entry Point to GameActivity at (menu: Project Settings > Player > Other Settings > Application Entry Point)
4. Build And Run on Android
5. Observe the Console Window

Expected result: The Build is completed successfully
Actual result: Build failed with the error “A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction”

Reproducible with: 4.0.0, 4.1.2, 4.2.0-exp-env-depth.1, 4.2.0-exp-env-depth.2 (2023.2.7f1, 2023.3.0b4)
Couldn’t test with: 2021.3.34f1, 2022.3.19f1 (No Application Entry Point option)

Reproducible on: macOS(Intel) 14.2.1, Windows 10 (10.0.19045) 64bit (by user)
Not reproducible on: No other environment tested

Notes:
- Not Reproducible when Target API Level and Minimal API to 33+
- Not Reproducible if Application Entry Point is set to “Activity”

A few lines of the building errors obtained:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:checkReleaseAarMetadata'.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
6 issues were found when checking AAR metadata:

{noformat} 1. Dependency 'androidx.appcompat:appcompat-resources:1.6.1' requires libraries and applications that
depend on it to compile against version 33 or later of the
Android APIs.

:launcher is currently compiled against android-32.

Recommended action: Update this project to use a newer compileSdkVersion
of at least 33, for example 33.

Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed{noformat}

  1. Resolution Note (fix version 2023.3.0b7):

    For now you can workaround the following issue in the following ways:
    * Choose Activity instead of GameActivity in PlayerSettings

    or

    * Export gradle project and manually change dependencies in unityLibrary/build.gradle

    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'androidx.core:core:1.9.0'

    to
    implementation 'androidx.appcompat:appcompat:1.5.1'
    implementation 'androidx.core:core:1.8.0'

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.