- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这真的让我很烦,我已经安装并重新安装了 JDK、ADK、Android Studio 和 Gradle 好几次,而且顺序各不相同,但我无法让这个错误消失。要么我卸载时删除的内容不够多,要么与 OS X Yosemite 不兼容。也有可能我没有将 Android Studio 指向正确的 JDK 或 ADK……基本上,不知道发生了什么。任何帮助将不胜感激。
这是 gradle 堆栈跟踪:
org.gradle.internal.service.ServiceCreationException: Could not create service of type DefaultClassLoaderRegistry using GlobalScopeServices.createClassLoaderRegistry().
at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:643)
at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:597)
at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectProvider.getInstance(DefaultServiceRegistry.java:439)
at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:479)
at org.gradle.internal.service.DefaultServiceRegistry.findConfigureMethod(DefaultServiceRegistry.java:145)
at org.gradle.internal.service.DefaultServiceRegistry.findProviderMethods(DefaultServiceRegistry.java:119)
at org.gradle.internal.service.DefaultServiceRegistry.addProvider(DefaultServiceRegistry.java:227)
at org.gradle.internal.service.ServiceRegistryBuilder.build(ServiceRegistryBuilder.java:52)
at org.gradle.launcher.cli.BuildActionsFactory.runBuildInProcess(BuildActionsFactory.java:167)
at org.gradle.launcher.cli.BuildActionsFactory.createAction(BuildActionsFactory.java:137)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.createAction(CommandLineActionFactory.java:242)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:232)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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)
Caused by: org.gradle.internal.service.UnknownServiceException: Could not find meta-data resource 'META-INF/services/javax.xml.datatype.DatatypeFactory' for service 'javax.xml.datatype.DatatypeFactory'.
at org.gradle.internal.service.ServiceLocator.getFactory(ServiceLocator.java:56)
at org.gradle.internal.classloader.DefaultClassLoaderFactory.makeServiceVisible(DefaultClassLoaderFactory.java:104)
at org.gradle.internal.classloader.DefaultClassLoaderFactory.createFilteringClassLoader(DefaultClassLoaderFactory.java:76)
at org.gradle.initialization.DefaultClassLoaderRegistry.restrictToGradleApi(DefaultClassLoaderRegistry.java:50)
at org.gradle.initialization.DefaultClassLoaderRegistry.<init>(DefaultClassLoaderRegistry.java:40)
at org.gradle.internal.service.scopes.GlobalScopeServices.createClassLoaderRegistry(GlobalScopeServices.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
at org.gradle.internal.service.DefaultServiceRegistry.invoke(DefaultServiceRegistry.java:328)
at org.gradle.internal.service.DefaultServiceRegistry.access$1200(DefaultServiceRegistry.java:58)
at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:641)
... 27 more
最佳答案
我遇到了同样的问题,看了gradle的full stack trace,发现少了一个jar。其他丢失的 jar(如果有)将列在完整 堆栈跟踪中。
有问题的 jar 是 gradle 需要的 commons-lang3.jar。我在下面的步骤中安装了 jar
sudo apt-get install libcommons-lang3-java
然后我再次运行 gradle,它工作正常。
关于java - 由于 Gradle 失败 : Could not find javax. xml.datatype.DatatypeFactory,无法编译任何 Android 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26371301/
在 java 中有一个 javax.xml.datatype.DatatypeFactory 可用于导入和导出 xml 日期,如下所示。 String xmlDateIn = "1900-01-0
给定一个以毫秒为单位的时间,我们可以使用以下代码片段创建 XMLGregorianCalendar。 GregorianCalendar greCal = new GregorianCalendar(
Enviornment - AS@wildfly-9.0.2.Final, BuildingTool@ant, JDK@jdk1.8.0_66 从我的 java 代码访问以下类,这导致了错误。 jav
这真的让我很烦,我已经安装并重新安装了 JDK、ADK、Android Studio 和 Gradle 好几次,而且顺序各不相同,但我无法让这个错误消失。要么我卸载时删除的内容不够多,要么与 OS X
我是一名优秀的程序员,十分优秀!