I was trying to fix “Gradle build failed”, but nothing worked. Versions: android-ndk-r23b gradle-8.2 jdk-11.0.17 sdk from android studio unity 2023.1.0a21
Error:
stderr[
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ‘:launcher:buildReleasePreBundle’.
Could not create task ‘:launcher:stripReleaseDebugSymbols’.
Cannot use @TaskAction annotation on method IncrementalTask.taskAction$gradle_core() because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method.
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 2s
]
stdout[
Configure project :launcher
WARNING:The option setting ‘android.bundle.enableUncompressedNativeLibs=false’ is deprecated.
The current default is ‘true’.
It will be removed in version 8.0 of the Android Gradle plugin.
You can add the following to your build.gradle instead:
android {
packagingOptions {
jniLibs {
useLegacyPackaging = true
} }
}
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to Command-Line Interface in the Gradle documentation.
]
exit code: 1
I updated sdk, jdk, ndk and gradle from default that downloaded with Unity, but empty project can’t build for Android