unity-jar-resolver icon indicating copy to clipboard operation
unity-jar-resolver copied to clipboard

Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7

Open peterpp opened this issue 4 years ago • 69 comments

Please fill in the following fields:

Unity editor version: 2019.4.0f1 and also multiple of 2019.3.x versions External Dependency Manager version: 1.2.155 Source you installed EDM: Unity Package Manager Features in External Dependency Manager in use: Android Resolver Plugins SDK in use: Firebase, Facebook, IronSource Platform you are using the Unity editor on: Mac OS Catalina (10.15.5) Platform you are targeting: Android Scripting Runtime: IL2CPP

Please describe the issue here:

I am unable to run Android Resolver because of exception:

Failed to run '/Users/peter/Projects/hopply/Temp/PlayServicesResolverGradle/gradlew --no-daemon -b "/Users/peter/Projects/hopply/Temp/PlayServicesResolverGradle/PlayServicesResolver.scripts.download_artifacts.gradle" "-PANDROID_HOME=/Applications/Unity/Hub/Editor/2019.4.0f1/PlaybackEngines/AndroidPlayer/SDK" "-PTARGET_DIR=/Users/peter/Projects/hopply/Assets/Plugins/Android" "-PMAVEN_REPOS=https://dl.bintray.com/ironsource-mobile/android-sdk/;https://maven.google.com/;https://dl.bintray.com/ironsource-mobile/android-adapters/;file:////Users/peter/Projects/hopply/Library/PackageCache/[email protected]/Firebase/m2repository;file:////Users/peter/Projects/hopply/Library/PackageCache/[email protected]/Firebase/m2repository;file:////Users/peter/Projects/hopply/Library/PackageCache/[email protected]/Firebase/m2repository" "-PPACKAGES_TO_COPY=com.android.support:support-v4:25.3.1;com.android.support:appcompat-v7:25.3.1;com.android.support:cardview-v7:25.3.1;com.android.support:customtabs:25.3.1;com.parse.bolts:bolts-android:1.4.0;com.facebook.android:facebook-core:[6.2.0, 7);com.facebook.android:facebook-applinks:[6.2.0, 7);com.facebook.android:facebook-login:[6.2.0, 7);com.facebook.android:facebook-share:[6.2.0, 7);com.facebook.android:facebook-gamingservices:[6.2.0, 7);com.ironsource.sdk:mediationsdk:6.16.1;com.google.android.gms:play-services-ads-identifier:17.0.0;com.google.android.gms:play-services-ads:19.1.0;com.ironsource.adapters:admobadapter:4.3.9;com.ironsource.adapters:unityadsadapter:4.3.3;com.google.firebase:firebase-common:19.3.0;com.google.firebase:firebase-analytics:17.4.1;com.google.firebase:firebase-app-unity:6.15.0;com.google.firebase:firebase-config:19.1.4;com.google.firebase:firebase-config-unity:6.15.0;com.google.firebase:firebase-analytics-unity:6.15.0" "-PUSE_JETIFIER=1" "-PDATA_BINDING_VERSION=3.4.0"'

java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
	at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)
	at org.codehaus.groovy.reflection.GroovyClassValueFactory.<clinit>(GroovyClassValueFactory.java:35)
	at org.codehaus.groovy.reflection.ClassInfo.<clinit>(ClassInfo.java:109)
	at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:95)
	at org.codehaus.groovy.reflection.ReflectionCache.<clinit>(ReflectionCache.java:39)
	at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerMethods(MetaClassRegistryImpl.java:209)
	at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:107)
	at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:85)
	at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:36)
	at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:86)
	at groovy.lang.GroovyObjectSupport.getDefaultMetaClass(GroovyObjectSupport.java:59)
	at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32)
	at org.gradle.api.internal.plugins.DefaultExtraPropertiesExtension.<init>(DefaultExtraPropertiesExtension.java:29)
	at org.gradle.api.internal.plugins.DefaultConvention.<init>(DefaultConvention.java:47)
	at org.gradle.api.internal.ExtensibleDynamicObject.<init>(ExtensibleDynamicObject.java:58)
	at org.gradle.initialization.DefaultSettings.<init>(DefaultSettings.java:93)
	at org.gradle.initialization.DefaultSettings_Decorated.<init>(Unknown Source)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	...

I found out that it is related to Gradle issue: https://github.com/gradle/gradle/issues/10248 So I tried to:

  • manually change version of Gradle in Temp/PlayServicesResolverGradle/gradle/wrapper/gradle-wrapper.properties from gradle-5.1.1-bin.zip to gradle-6.4-bin.zip
  • run that long gradlew command by myself (...gradlew --no-daemon -b "/Users/peter/Projects/...) And it finishes without any problem.

My suggestion is to upgrade the Gradle used by resolver.

Please answer the following, if applicable:

What's the issue repro rate? 99%

In the past, I was able to run Android resolver successfully 3 times exactly. I really don't know why it worked, because it was always with the same configuration after countless of failures.

peterpp avatar Jun 16 '20 10:06 peterpp

I'll add this as a feature request to update the gradle wrapper (feel free to submit a PR!).

For now, I have good luck using the OpenJDK that ships with Unity. That would be another reliable workaround for now: image image

patm1987 avatar Jun 19 '20 21:06 patm1987

I have the same issue !

ApWin avatar Jul 13 '20 17:07 ApWin

Hi, I'm getting the same issue, installing OpenJDK via Unity Hub did not work for me.

I tried uninstalling and reinstalling Unity with the Android SDK and OpenJDK included, still getting this error. Any help or ideas would be greatly appreciated, thanks!

CorpusCallosum avatar Jul 16 '20 21:07 CorpusCallosum

Thank you @patm1987 for response. However, I have OpenJDK installed via Unity HUB with the exact same configuration as you do. After submitting this issue, I tried it again and... voilà... it worked. I changed nothing. So now I have exact 4 successfull cases (in several months).

peterpp avatar Jul 16 '20 21:07 peterpp

I run into the same issue 👎

extrawurst avatar Aug 24 '20 08:08 extrawurst

Also experiencing this on latest EDM4U 1.2.157, with Unity 2019.4.5f1 set up to use 100% external tools bundled in install from Hub. I believe for whatever reason EDM4U is failing to use the java version specified by Unity's External Tools preferences and is still using the system java. If you wish to reproduce this issue you may want to attempt uninstalling any systemwide install of jdk. (Find in /Library/Java/JavaVirtualMachines and verify with /usr/libexec/java_home -V)

roger-o3h avatar Aug 24 '20 16:08 roger-o3h

Yes, this appears to be the case. You can work around this issue by setting the systemwide java install to OpenJDK java 1.8 (e.g. brew tap AdoptOpenJDK/openjdk; brew cask install adoptopenjdk8) However, @patm1987 please consider the issue at hand that at least on MacOS Catalina, during resolution EDM4U is not honoring the JAVA_HOME set in Unity external tools preferences, instead using systemwide Java, which is a genuine issue.

roger-o3h avatar Aug 24 '20 16:08 roger-o3h

@roger-o3h can you give more details how you work around this issue? just installing this jdk cask does not cut it for me.

extrawurst avatar Aug 24 '20 17:08 extrawurst

Gradle failed to fetch dependencies.

Failed to run '<unityproject>/Temp/PlayServicesResolverGradle/gradlew --no-daemon -b "<unityproject>/Temp/PlayServicesResolverGradle/PlayServicesResolver.scripts.download_artifacts.gradle" "-PANDROID_HOME=/Applications/Unity/Hub/Editor/2019.4.8f1/PlaybackEngines/AndroidPlayer/SDK" "-PTARGET_DIR=<unityproject>/Assets/Plugins/Android" "-PMAVEN_REPOS=" "-PPACKAGES_TO_COPY=com.android.support:support-v4:25.3.1;com.android.support:appcompat-v7:25.3.1;com.android.support:cardview-v7:25.3.1;com.android.support:customtabs:25.3.1" "-PUSE_JETIFIER=1" "-PDATA_BINDING_VERSION=3.4.0"'
stdout:

stderr:
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
	at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)
	at org.codehaus.groovy.reflection.GroovyClassValueFactory.<clinit>(GroovyClassValueFactory.java:35)
	at org.codehaus.groovy.reflection.ClassInfo.<clinit>(ClassInfo.java:109)
	at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:95)
	at org.codehaus.groovy.reflection.ReflectionCache.<clinit>(ReflectionCache.java:39)
	at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerMethods(MetaClassRegistryImpl.java:209)
	at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:107)
	at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:85)
	at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:36)
	at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:86)
	at groovy.lang.GroovyObjectSupport.getDefaultMetaClass(GroovyObjectSupport.java:59)
	at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32)
	at org.gradle.api.internal.plugins.DefaultExtraPropertiesExtension.<init>(DefaultExtraPropertiesExtension.java:29)
	at org.gradle.api.internal.plugins.DefaultConvention.<init>(DefaultConvention.java:47)
	at org.gradle.api.internal.ExtensibleDynamicObject.<init>(ExtensibleDynamicObject.java:58)
	at org.gradle.initialization.DefaultSettings.<init>(DefaultSettings.java:93)
	at org.gradle.initialization.DefaultSettings_Decorated.<init>(Unknown Source)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
	at org.gradle.internal.reflect.DirectInstantiator.newInstance(DirectInstantiator.java:51)
	at org.gradle.api.internal.ClassGeneratorBackedInstantiator.newInstance(ClassGeneratorBackedInstantiator.java:36)
	at org.gradle.initialization.SettingsFactory.createSettings(SettingsFactory.java:52)
	at org.gradle.initialization.ScriptEvaluatingSettingsProcessor.process(ScriptEvaluatingSettingsProcessor.java:56)
	at org.gradle.initialization.PropertiesLoadingSettingsProcessor.process(PropertiesLoadingSettingsProcessor.java:37)
	at org.gradle.initialization.SettingsEvaluatedCallbackFiringSettingsProcessor.process(SettingsEvaluatedCallbackFiringSettingsProcessor.java:34)
	at org.gradle.initialization.RootBuildCacheControllerSettingsProcessor.process(RootBuildCacheControllerSettingsProcessor.java:36)
	at org.gradle.initialization.BuildOperationSettingsProcessor$2.call(BuildOperationSettingsProcessor.java:48)
	at org.gradle.initialization.BuildOperationSettingsProcessor$2.call(BuildOperationSettingsProcessor.java:45)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:315)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:305)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:101)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
	at org.gradle.initialization.BuildOperationSettingsProcessor.process(BuildOperationSettingsProcessor.java:45)
	at org.gradle.initialization.DefaultSettingsLoader.findSettingsAndLoadIfAppropriate(DefaultSettingsLoader.java:104)
	at org.gradle.initialization.DefaultSettingsLoader.findAndLoadSettings(DefaultSettingsLoader.java:45)
	at org.gradle.initialization.SettingsAttachingSettingsLoader.findAndLoadSettings(SettingsAttachingSettingsLoader.java:35)
	at org.gradle.internal.composite.CommandLineIncludedBuildSettingsLoader.findAndLoadSettings(CommandLineIncludedBuildSettingsLoader.java:34)
	at org.gradle.internal.composite.ChildBuildRegisteringSettingsLoader.findAndLoadSettings(ChildBuildRegisteringSettingsLoader.java:47)
	at org.gradle.internal.composite.CompositeBuildSettingsLoader.findAndLoadSettings(CompositeBuildSettingsLoader.java:35)
	at org.gradle.initialization.DefaultGradleLauncher$LoadBuild.run(DefaultGradleLauncher.java:277)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.initialization.DefaultGradleLauncher.loadSettings(DefaultGradleLauncher.java:202)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:147)
	at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:134)
	at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:58)
	at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:55)
	at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:82)
	at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:75)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:183)
	at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
	at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:75)
	at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:55)
	at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:31)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:58)
	at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
	at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:39)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:49)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:44)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:315)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:305)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:101)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:44)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:49)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:46)
	at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:78)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:46)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:59)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:36)
	at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)
	at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)
	at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:55)
	at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:207)
	at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:403)
	at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:376)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:37)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:23)
	at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:369)
	at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:299)
	at org.gradle.launcher.Main.doAction(Main.java:36)
	at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
	at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
	at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
	at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)

FAILURE: Build failed with an exception.

* What went wrong:
Could not create an instance of type org.gradle.initialization.DefaultSettings_Decorated.
> Could not initialize class org.codehaus.groovy.reflection.ReflectionCache

* 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 5s

exit code: 1

UnityEngine.Debug:LogError(Object)
Google.Logger:Log(String, LogLevel) (at Z:/tmp/tmp.iekf7WyTfN/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/Logger.cs:136)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel) (at Z:/tmp/tmp.ya7akFHaCt/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1008)
GooglePlayServices.<GradleResolution>c__AnonStorey1:<>m__2(Result) (at Z:/tmp/tmp.ya7akFHaCt/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:451)
GooglePlayServices.<GradleResolution>c__AnonStorey3:<>m__0() (at Z:/tmp/tmp.ya7akFHaCt/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:564)
Google.RunOnMainThread:ExecuteNext() (at Z:/tmp/tmp.iekf7WyTfN/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:486)
Google.RunOnMainThread:<ExecuteAllUnnested>m__1() (at Z:/tmp/tmp.iekf7WyTfN/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:536)
Google.RunOnMainThread:RunAction(Action) (at Z:/tmp/tmp.iekf7WyTfN/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)
Google.RunOnMainThread:ExecuteAllUnnested(Boolean) (at Z:/tmp/tmp.iekf7WyTfN/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)
Google.RunOnMainThread:ExecuteAll() (at Z:/tmp/tmp.iekf7WyTfN/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:512)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:310)
Unable to determine which Android packages are installed.
Failed to run '/Applications/Unity/Hub/Editor/2019.4.8f1/PlaybackEngines/AndroidPlayer/SDK/tools/bin/sdkmanager --list --verbose'
stdout:

stderr:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
	at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
	at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
	at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(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:602)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 5 more

exit code: 1

UnityEngine.Debug:Log(Object)
Google.Logger:Log(String, LogLevel) (at Z:/tmp/tmp.iekf7WyTfN/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/Logger.cs:124)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel) (at Z:/tmp/tmp.ya7akFHaCt/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1008)
GooglePlayServices.<QueryPackages>c__AnonStorey0:<>m__0(Result) (at Z:/tmp/tmp.ya7akFHaCt/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/AndroidSdkManager.cs:433)
GooglePlayServices.ProgressReporter:SignalComplete() (at Z:/tmp/tmp.ya7akFHaCt/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/CommandLineDialog.cs:116)
GooglePlayServices.ProgressReporter:CommandLineToolCompletion(Result) (at Z:/tmp/tmp.ya7akFHaCt/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/CommandLineDialog.cs:107)
GooglePlayServices.<RunAsync>c__AnonStorey1:<>m__0() (at Z:/tmp/tmp.ya7akFHaCt/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/CommandLine.cs:137)
Google.RunOnMainThread:ExecuteNext() (at Z:/tmp/tmp.iekf7WyTfN/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:486)
Google.RunOnMainThread:<ExecuteAllUnnested>m__1() (at Z:/tmp/tmp.iekf7WyTfN/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:536)
Google.RunOnMainThread:RunAction(Action) (at Z:/tmp/tmp.iekf7WyTfN/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)
Google.RunOnMainThread:ExecuteAllUnnested(Boolean) (at Z:/tmp/tmp.iekf7WyTfN/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)
Google.RunOnMainThread:ExecuteAll() (at Z:/tmp/tmp.iekf7WyTfN/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:512)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:310)

extrawurst avatar Aug 24 '20 17:08 extrawurst

You may have multiple JVMs installed? Can you paste the output of /usr/libexec/java_home -V ?

roger-o3h avatar Aug 24 '20 17:08 roger-o3h

Yeah I had multiple JVMs installed apparently, after uninstalling all but the adoptopenjdk8 it worked, is that supposed to be the case?

extrawurst avatar Aug 24 '20 19:08 extrawurst

Yes, that jives with what I think is going on here... And means I'm not alone in getting this error! Hopefully the workaround will tide us over until the issue is resolved. Thanks!

roger-o3h avatar Aug 24 '20 21:08 roger-o3h

Possible duplicate of https://github.com/googlesamples/unity-jar-resolver/issues/323

roger-o3h avatar Aug 25 '20 15:08 roger-o3h

I faced the same issue and have only 1 JVM installed

KseniaKrasotina avatar Sep 01 '20 12:09 KseniaKrasotina

This issue started reproducing today for no particular reason :(

Unity 2018.4.10f1
External Dependency Manager 1.2.156

qbit86 avatar Sep 03 '20 15:09 qbit86

Yeah we also still have one machine with this issue...

extrawurst avatar Sep 03 '20 15:09 extrawurst

I had the same problem when upgrading Kotlin from 1.3.x to 1.4.

Since Kotlin 1.4 demands a newer version of gradle I hade to upgrade my gradle version on my machine. This made my groovy tests failing, resulting in the exception raised in this thread.

After trying out some different stuff I managed to get it working by doing the following.

1. Remove apply plugin: ‘groovy’ from my build.gradle file 2. Add testImplementation ‘org.codehaus.groovy:groovy-all:2.4.15’ to my build.gradle file

Hope it works for you guys as well! Good luck!

FerhatBahceci avatar Sep 04 '20 08:09 FerhatBahceci

I resolve this problem with this article. (language:japanese) it's problem probably doesn't depend on jdk version referenced by unity.

・After play External Dependency Manager>Android>Force Resolve, manually change version of Gradle from gradle-5.1.1-bin.zip to gradle-6.4.1-bin.zip in gradle/wapper/gradle-wrapper.properties in Temp/PlayServicesResolverGradle/PlayServicesResolver.scripts.gradle-template.zip

unity editor version is 2017.4.40f1 External Dependency Manager 1.2.157 Mac OS Catalina (10.15.5)

nakatsuji-tomohiro avatar Sep 09 '20 05:09 nakatsuji-tomohiro

Hi folks,

I actually tried to upgrade gradle from 5.1.1 to 6.5 and it basically broke the unit tests (./gradlew testDownloadArtifacts) for EDM4U for a couple of reasons.

  • Gradle 6 introduced quite amount of breaking changes in script so that many code in download_artifacts.gradle, which does the resolution using Gradle, will need to update to work with 6.
  • Gradle 6 changes version range definition. 1.2.3 in Gradle 5 means any version equal and above 1.2.3 but below 2.0.0, while in Gradle 6 it simply means the exact version 1.2.3.

Due to this, I'm quite concerned to upgrade gradle for EDM4U to 6+. And make EDM4U compatible to 6+ turns out to be a pretty tedious work.

For those who installed later version Gradle, as long as Use Gradle Daemon in Android Resolver settings is UNCHECKED, EDM4U should still use the older version of Gradle.

If this remains to be an issue for you, I would recommend to utilize Custom Gradle Template, a.k.a mainTemplate.gradle. In that case, EDM4U will not run the Gradle script but simply injecting dependencies to mainTemplate.gradle.

It looks like this is impacting many people, and I cannot reproduce this issue on my machine. If possible, please offer a minimum viable project and your configurations (Unity version, JDK version, External tools settings, OS, etc).

Thanks

chkuang-g avatar Sep 18 '20 23:09 chkuang-g

I resolve this problem with this article. (language:japanese) it's problem probably doesn't depend on jdk version referenced by unity.

・After play External Dependency Manager>Android>Force Resolve, manually change version of Gradle from gradle-5.1.1-bin.zip to gradle-6.4.1-bin.zip in gradle/wapper/gradle-wrapper.properties in Temp/PlayServicesResolverGradle/PlayServicesResolver.scripts.gradle-template.zip

unity editor version is 2017.4.40f1 External Dependency Manager 1.2.157 Mac OS Catalina (10.15.5)

Thanks, changing version from 6.1.1 to 6.4.1 worked. 👍

nikhilmehta2014 avatar Sep 26 '20 17:09 nikhilmehta2014

Interesting fact: my problem was not in a gradle. I used maven =)

KseniaKrasotina avatar Sep 27 '20 06:09 KseniaKrasotina

Same problem here. Worked on one machine, but not on another. Confused about this. :-/

derwaldgeist avatar Oct 17 '20 23:10 derwaldgeist

Ok, I found the issue of my installation: On the new machine, I installed JDK 15, which is the default you get directed to if you run java on a freshly installed Catalina Mac (it shows up a dialog that asks you to download the JDK):

https://www.oracle.com/de/java/technologies/javase-downloads.html

After downgrading the JDK to 1.8 (as on my other machine), everything worked again. It seems as if there's a problem with JDK 15.

derwaldgeist avatar Oct 17 '20 23:10 derwaldgeist

What still confuses me: Unity is setup to use its own Open JDK, but this seems to be ignored by the resolver.

derwaldgeist avatar Oct 18 '20 00:10 derwaldgeist

In my case, Unity does not seem to be using the JDK / SDK that was installed with Unity, although the check mark is set. Another path was in the background (check mark not set). If I set this path to Unity's JDK / SDK then my project works.

2020-10-18 10_48_31-Zahlen - MainMenu - Android - Unity 2019 3 15f1 Personal DX11

Caution:

  • This path is then set for all projects on the computer!
  • Sometimes I have to uncheck JDK after starting the Unity editor and set it again so that the * .aab is created.

BerndBernd17 avatar Oct 18 '20 08:10 BerndBernd17

Hi,

I had this problem since yesterday (in IntelliJ, not Unity) and I managed to fix it by manually installing Gradle 6.7 from their website and unzipping it in a directory C:\Gradle. (which I manually added to my C-drive) I then reset my whole IntelliJ IDEA and restarted it (not sure if that was necessary) Next, I went to File < Settings < Gradle > use Gradle from. There, I selected 'Specific location', and chose the C-drive which was made earlier.

This resolved my error so maybe it van help with Unity.

Installation instructions from Gradle: https://gradle.org/install/

NickBevers avatar Oct 21 '20 19:10 NickBevers

Yes, this appears to be the case. You can work around this issue by setting the systemwide java install to OpenJDK java 1.8 (e.g. brew tap AdoptOpenJDK/openjdk; brew cask install adoptopenjdk8) However, @patm1987 please consider the issue at hand that at least on MacOS Catalina, during resolution EDM4U is not honoring the JAVA_HOME set in Unity external tools preferences, instead using systemwide Java, which is a genuine issue.

Had the same problem and I can confirm that deleting the system java and install OpenJDK fixed the problem.

Unity 2019.4.13f1
External Dependency Manager 1.2.161
Mac OS Catalina 10.15.6

sweatyc avatar Oct 23 '20 03:10 sweatyc

Hey folks, I uncheck JDK installed with Unity (recommended), use same path BUT change the last slash from \ to /, and worked.

Seems that Unity Editor or Windows not found JDK with , whatever.

leandersonralves avatar Oct 26 '20 14:10 leandersonralves

I have the same problem from time to time. What works for me I just uncheck JDK installed with Unity and other related check boxes, then check it again - and we are back to work.

stan-osipov avatar Nov 15 '20 10:11 stan-osipov

I have the same problem from time to time. What works for me I just uncheck JDK installed with Unity and other related check boxes, then check it again - and we are back to work.

This worked for me. Thanks!

haripriyaaithal avatar Nov 22 '20 15:11 haripriyaaithal