使用HomeBrew和Offical Zip文件安装gradle版本2.10。
尝试运行命令:gradle --version(或任何其他命令)
获取错误:
FAILURE: Build failed with an exception.
* What went wrong:
org.slf4j.impl.Log4jLoggerFactory cannot be cast to org.gradle.logging.internal.slf4j.OutputEventListenerBackedLoggerContext
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
堆栈跟踪:
FAILURE: Build failed with an exception.
* What went wrong:
org.slf4j.impl.Log4jLoggerFactory cannot be cast to org.gradle.logging.internal.slf4j.OutputEventListenerBackedLoggerContext
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
java.lang.ClassCastException: org.slf4j.impl.Log4jLoggerFactory cannot be cast to org.gradle.logging.internal.slf4j.OutputEventListenerBackedLoggerContext
at org.gradle.logging.internal.slf4j.Slf4jLoggingConfigurer.configure(Slf4jLoggingConfigurer.java:42)
at org.gradle.logging.internal.DefaultLoggingConfigurer.configure(DefaultLoggingConfigurer.java:34)
at org.gradle.logging.internal.LoggingSystemAdapter.setLevel(LoggingSystemAdapter.java:55)
at org.gradle.logging.internal.LoggingSystemAdapter.on(LoggingSystemAdapter.java:42)
at org.gradle.logging.internal.DefaultLoggingManager$StartableLoggingSystem.start(DefaultLoggingManager.java:191)
at org.gradle.logging.internal.DefaultLoggingManager.start(DefaultLoggingManager.java:60)
at org.gradle.logging.internal.DefaultLoggingManager.start(DefaultLoggingManager.java:31)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:201)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)