Everytime I get this error upon build:
“Could not resolve all files for configuration ‘:launcher:releaseRuntimeClasspath’. See the Console for details.”
Unity 2021.3.37 and other versions of 2021. Target API Level 34.
Stacktrace:
Note: E:\proj\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
ERROR:: D8: com.android.tools.r8.kotlin.H
FAILURE: Build completed with 3 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':launcher:mergeExtDexRelease'.
> Could not resolve all files for configuration ':launcher:releaseRuntimeClasspath'.
> Failed to transform play-services-measurement-api-21.5.1.aar (com.google.android.gms:play-services-measurement-api:21.5.1) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-incremental-transform=true, dexing-is-debuggable=false, dexing-min-sdk=22, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for DexingWithClasspathTransform: C:\Users\user\.gradle\caches\transforms-2\files-2.1\0a90e66ff9319bf31d2d761c3485ef0c\jetified-play-services-measurement-api-21.5.1-runtime.jar.
> Error while dexing.
* Try:
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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':launcher:bundleReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable
> AAPT2 aapt2-4.2.2-7147631-windows Daemon #0: Unexpected error during link, attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
* Try:
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.
==============================================================================
3: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':launcher:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> AAPT2 aapt2-4.2.2-7147631-windows Daemon #1: Unexpected error during link, attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
* Try:
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.
==============================================================================
* Get more help at https://help.gradle.org
BUILD FAILED in 20s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
UnityEditor.GenericMenu:CatchMenu (object,string[],int)
Builds successfully if the target API level is 33. So can’t build for level 34.
Also unity 2022 versions with target API level is 34 build successfully.
I tried to double check passwords for project keystore, check/uncheck preferences/External Tools, reimported all, force resolve Android libraries, relaunch unity, etc. nothing works.
Also I have custom Main Manifest, Main Gradle Template, Launcher Gradle Template, Base Gradle Template, Gradle Properties Template. No Minify selected. Multidex enabled.
How can I build for level 34 on unity 2021.3.37?