M
M
Morgenstern Akhmedovich2021-10-03 20:50:01
Unity
Morgenstern Akhmedovich, 2021-10-03 20:50:01

How to fix Gradle failed to fetch dependencies and Picked up JAVA_TOOL_OPTIONS errors?

I have been suffering for several days because of the same errors in the console. I didn't find much information on the internet to fix it. I have 2 mistakes, I combined them, and I will be very grateful if at least one is decided. I've been working on the project for 2 months and I don't want all my work to be in vain because of clumsy me or clumsy Unity. Before these errors, I connected AdMob and set JAVA_HOME in "Environment Variables" to solve the "gradle failed to fetch dependencies" error.

Error number 1 occurs when I click "Force Resolve" in Asset->ExternalDependencyManager->AndroidResolver->ForceResolve.
Error number 2 occurs when trying to build a project.
Here are the error messages in the console:

Error 1:
Gradle failed to fetch dependencies.


Failed to run 'F:\MyUnity3DProjects\Unity_v_deistvii\Flying Box\Temp\PlayServicesResolverGradle\gradlew.bat --no-daemon -b "F:\MyUnity3DProjects\Unity_v_deistvii\Flying Box\Temp\PlayServicesResolverGradle\PlayServicesResolver.scripts.download_artifacts.gradle " "-PANDROID_HOME=F:/2021.1.12f1/Editor/Data/PlaybackEngines/AndroidPlayer\SDK" "-PTARGET_DIR=F:\MyUnity3DProjects\Unity_v_deistvii\Flying Box\Assets\Plugins\Android" "-PMAVEN_REPOS= https:// maven.google.com/ " "-PPACKAGES_TO_COPY=com.google.android. gms:play-services-ads:20.2.0 " "-PUSE_JETIFIER=1" "-PDATA_BINDING_VERSION=3.6.0"'

Error 2:
Picked up JAVA_TOOL_OPTIONS : -Dfile.encoding=UTF-8
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.(SchemaModule.java:75
) AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by : java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636)
at java.base/jdk.internal.loader.ClassLoaders$ AppClassLoader.loadClass(ClassLoaders.java:182)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
... 5 more

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

I'd be happy if anyone can help in any way. Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Roo, 2021-10-03
@Lil_crystal

java.lang.NoClassDefFoundError is that you are missing this library: javax.xml.bind.annotation.*
Gradle failed to fetch dependencies is that the dependencies could not be loaded

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question