CommandInvokationFailure: Gradle build failed - unity3d

I am new to unity. I am using unity 2021.3.10f1 I made my own game and added advertising and other features. When trying to build, it shows the error "CommandInvokationFailure: Gradle build failed." Can you help? An error that is shown in unity:
CommandInvokationFailure: Gradle build failed.
D:\HappyWin\Unity and projects\2021.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "D:\HappyWin\gradle-6.1.1\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':launcher:lintVitalRelease'.
> This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
The following AndroidX dependencies are detected: androidx.fragment:fragment:1.0.0, androidx.slidingpanelayout:slidingpanelayout:1.0.0, androidx.versionedparcelable:versionedparcelable:1.1.0, androidx.core:core:1.2.0, androidx.customview:customview:1.0.0, androidx.swiperefreshlayout:swiperefreshlayout:1.0.0, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.drawerlayout:drawerlayout:1.0.0, androidx.viewpager:viewpager:1.0.0, androidx.collection:collection:1.0.0, androidx.localbroadcastmanager:localbroadcastmanager:1.0.0, androidx.lifecycle:lifecycle-common:2.0.0, androidx.arch.core:core-common:2.0.0, androidx.annotation:annotation:1.2.0, androidx.startup:startup-runtime:1.0.0, androidx.tracing:tracing:1.0.0, androidx.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.lifecycle:lifecycle-viewmodel:2.0.0, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.arch.core:core-runtime:2.0.0, androidx.legacy:legacy-support-core-utils:1.0.0, androidx.documentfile:documentfile:1.0.0, androidx.cursoradapter:cursoradapter:1.0.0, androidx.lifecycle:lifecycle-runtime:2.0.0, androidx.coordinatorlayout:coordinatorlayout:1.0.0, androidx.asynclayoutinflater:asynclayoutinflater:1.0.0, androidx.print:print:1.0.0
Changed gradle to different versions. Did not help.

Related

When I run my flutter code I face the following Gradle Dependency problem. What should I do?

I have tried to solve it through different pre-answered questions on StackOverflow but they are not working, That is why asking here, Please help.
here is the problem:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\TME_Education\StudioProjects\jeda\android\app\build.gradle' line: 58
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find method compile() for arguments [com.android.tools.build:gradle:7.1.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Here is my dependency
dependencies {
compile 'com.android.tools.build:gradle:7.1.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
I was runing the code but this gradle Dependency eror happened.

Error in flutter project build gradle problem

What went wrong:
A problem occurred configuring root project 'android'
Could not resolve all artifacts for configuration
":classpath
Could not find com.android.tools.build:gradle:6.7.
Searched in the following locations:
-nttps:1/dl.google.com/d/android/maven2/com/android/tools/build/aradle/6.7/gradle-6.7.pom
nttps://repo_naven_apache.org/maven2/com/android/tools/build/aradle/6.7/gradle-6.7.pom
Required by:
project

Package Build gradle failed

everytime i add google_maps_flutter package i always get this error but in another project it's fine.
Please help...
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\flutter\.pub-cache\hosted\pub.dartlang.org\google_maps_flutter-2.1.2\android\build.gradle'
* What went wrong:
Could not compile build file 'C:\flutter\.pub-cache\hosted\pub.dartlang.org\google_maps_flutter-2.1.2\android\build.gradle'.
> startup failed:
General error during conversion: Unsupported class file major version 61
java.lang.IllegalArgumentException: Unsupported class file major version 61

Please I keep getting this error when I try to run my flutter app

What went wrong: Could not determine the dependencies of task
':app:compileDebugJavaWithJavac'. > Could not resolve all task
dependencies for configuration ':app:debugCompileClasspath'. > Could
not find
io.flutter:flutter_embedding_debug:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.
Required by: project :app > Could not find
io.flutter:x86_debug:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.
Required by: project :app > Could not find
io.flutter:x86_64_debug:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.
Required by: project :ap
Make sure you're on master branch and your flutter upgraded to last version.
then if the error remain delete the .gradle cache folder in youre home and applying ./gradlew cleanBuildCache in the project's android sub directory.

cannot compile unity project

CommandInvokationFailure: Gradle build failed.
C:\Program Files\Java\jdk1.8.0_192\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2018.2.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.10.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':lintVitalRelease'.
Could not resolve all files for configuration ':lintClassPath'.
Could not find org.codehaus.groovy:groovy-all:2.4.12.
Searched in the following locations:
file:/C:/d/programs/android sdk/extras/m2repository/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.pom
file:/C:/d/programs/android sdk/extras/m2repository/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.jar
file:/C:/d/programs/android sdk/extras/google/m2repository/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.pom
file:/C:/d/programs/android sdk/extras/google/m2repository/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.jar
… and more...