Opened 6 years ago

Closed 6 years ago

#56768 closed defect (worksforme)

Gradle init fails

Reported by: l-g Owned by: amake (Aaron Madlon-Kay)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: gradle

Description

I am following the instructions here https://developers.google.com/drive/api/v3/quickstart/java

After installing Gradle MacPorts suggest that I set the GRADLE_HOME variable to

/opt/local/share/java/gradle

, which I did. I also added

/opt/local/share/java/gradle/bin/

to my PATH.

I then run

gradle init --type basic

as per the instructions on the linked page. The result is a failure:

$ gradle init --type basic
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().

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

I then tried running it as root since some googling indicated that gradle needs permission to write in the GRADLE_HOME directory but that also failed even though the error message was a bit different

$ sudo gradle init --type basic
Password:
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :wrapper FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Some problems were found with the configuration of task ':wrapper'.
> Cannot write to file '/opt/local/bin/gradle/wrapper/gradle-wrapper.jar' specified for property 'jarFile', as ancestor '/opt/local/bin/gradle' is not a directory.
> Cannot write to file '/opt/local/bin/gradle/wrapper/gradle-wrapper.properties' specified for property 'propertiesFile', as ancestor '/opt/local/bin/gradle' is not a directory.

* 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 2s
1 actionable task: 1 executed

Is the problem gradle or MacPorts? If the problem is with gradle, I still think the instructions showed at the end of the installation are wrong, they should mention that root is required.

Do you need some more information? Such as stacktraces or other debug information from the init process.

Change History (7)

comment:1 Changed 6 years ago by jmroot (Joshua Root)

Owner: set to amake
Status: newassigned

comment:2 Changed 6 years ago by amake (Aaron Madlon-Kay)

I am unable to reproduce.

The message about GRADLE_HOME in the portfile predates my involvement, and appears to be obsolete or incorrect—you don't need it (I don't have it set and gradle works fine for me).

Second, you don't need to add /opt/local/share/java/gradle/bin/ to your path, as the gradle binary there is symlinked to /opt/local/bin, which should already be on your path.

As for the error message you are getting, I once got a similar message when trying to run gradle a) in a directory that had a space in the path and b) on an external volume that was formatted with a case-sensitive filesystem. Does that at all describe your situation?

I ended up reformatting my disk to be case-insensitive, and I also removed the space from the path, so I can't remember which fixed it.

Another thing to note: You definitely should *not* be running gradle with sudo.

comment:3 Changed 6 years ago by l-g

I have removed both GRADLE_HOME and PATH but still get the same error.

None of your caveats apply, I run it from /Users/lg/ so no spaces and it is a laptop with just one drive APFS and according to Disk Utility "Is case-sensitive : No".

Here is the stacktrace

$ gradle init -s --type basic

FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.internal.service.ServiceCreationException: Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:816)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:767)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:571)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:628)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.assembleParameters(DefaultServiceRegistry.java:780)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:766)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:571)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:628)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.assembleParameters(DefaultServiceRegistry.java:780)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:766)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:571)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:628)
        at org.gradle.internal.service.DefaultServiceRegistry.find(DefaultServiceRegistry.java:295)
        at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:284)
        at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:279)
        at org.gradle.initialization.DefaultGradleLauncherFactory.doNewInstance(DefaultGradleLauncherFactory.java:176)
        at org.gradle.initialization.DefaultGradleLauncherFactory.newInstance(DefaultGradleLauncherFactory.java:104)
        at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:59)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:46)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:32)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:62)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:34)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
        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:59)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:46)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.internal.service.ServiceCreationException: Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:816)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:767)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:571)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:628)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.assembleParameters(DefaultServiceRegistry.java:780)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:766)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:571)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:628)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.assembleParameters(DefaultServiceRegistry.java:780)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:766)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:571)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:628)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.assembleParameters(DefaultServiceRegistry.java:780)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:766)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:571)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:628)
        at org.gradle.internal.service.DefaultServiceRegistry.find(DefaultServiceRegistry.java:295)
        at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:284)
        at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:279)
        at org.gradle.internal.service.scopes.BuildScopeServices.defaultScriptPluginFactory(BuildScopeServices.java:306)
        at org.gradle.internal.service.scopes.BuildScopeServices.createScriptPluginFactory(BuildScopeServices.java:298)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.internal.service.ReflectionBasedServiceMethod.invoke(ReflectionBasedServiceMethod.java:35)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:814)
        ... 62 more
Caused by: org.gradle.api.UncheckedIOException: java.io.FileNotFoundException: /opt/local/bin/.gradle/4.8.1/fileHashes/fileHashes.lock (Permission denied)
        at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:57)
        at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:40)
        at org.gradle.cache.internal.DefaultFileLockManager.lock(DefaultFileLockManager.java:103)
        at org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess.incrementLockCount(LockOnDemandCrossProcessCacheAccess.java:105)
        at org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess.acquireFileLock(LockOnDemandCrossProcessCacheAccess.java:161)
        at org.gradle.cache.internal.DefaultCacheAccess.onStartWork(DefaultCacheAccess.java:368)
        at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:213)
        at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:203)
        at org.gradle.cache.internal.DefaultCacheAccess.newCache(DefaultCacheAccess.java:298)
        at org.gradle.cache.internal.DefaultCacheAccess.newCache(DefaultCacheAccess.java:57)
        at org.gradle.cache.internal.DefaultPersistentDirectoryStore.createCache(DefaultPersistentDirectoryStore.java:148)
        at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.createCache(DefaultCacheFactory.java:177)
        at org.gradle.api.internal.changedetection.state.CrossBuildFileHashCache.createCache(CrossBuildFileHashCache.java:51)
        at org.gradle.api.internal.changedetection.state.CachingFileHasher.<init>(CachingFileHasher.java:44)
        at org.gradle.internal.service.scopes.BuildSessionScopeServices.createFileSnapshotter(BuildSessionScopeServices.java:159)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.internal.service.ReflectionBasedServiceMethod.invoke(ReflectionBasedServiceMethod.java:35)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:814)
        ... 85 more
Caused by: java.io.FileNotFoundException: /opt/local/bin/.gradle/4.8.1/fileHashes/fileHashes.lock (Permission denied)
        at org.gradle.cache.internal.filelock.LockFileAccess.<init>(LockFileAccess.java:33)
        at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.<init>(DefaultFileLockManager.java:149)
        at org.gradle.cache.internal.DefaultFileLockManager.lock(DefaultFileLockManager.java:100)
        ... 100 more


* Get more help at https://help.gradle.org

BUILD FAILED in 0s

(as you can see there is one warning about not having permission to read a specific file, hence my attempt to run it as root)

Debug output

$ gradle init --debug --type basic
20:23:22.372 [INFO] [org.gradle.internal.nativeintegration.services.NativeServices] Initialized native services in: /Users/lg/.gradle/native
20:23:22.551 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClient] Executing build 0b9ae9aa-76eb-4b3d-9af0-9c12c619b0f6 in daemon client {pid=34781}
20:23:22.559 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface utun3
20:23:22.559 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
20:23:22.559 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? true
20:23:22.560 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:7913:9707:acba:bf17%utun3
20:23:22.560 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote multicast interface utun3
20:23:22.560 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface utun2
20:23:22.560 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
20:23:22.560 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? true
20:23:22.560 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:3572:c03c:18eb:19af%utun2
20:23:22.560 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote multicast interface utun2
20:23:22.560 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface utun1
20:23:22.561 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
20:23:22.561 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? true
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:a217:ce31:60d7:4f5a%utun1
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote multicast interface utun1
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface utun0
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? true
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fda5:4273:635f:20c6:4890:d907:3928:335
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:4890:d907:3928:335%utun0
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote multicast interface utun0
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface awdl0
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? true
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:46c:b5ff:fe89:7694%awdl0
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote multicast interface awdl0
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface en0
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? true
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:880:4324:1ef:349a%en0
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /192.168.1.127
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote multicast interface en0
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface lo0
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? true
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? true
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Ignoring remote address on loopback interface /fe80:0:0:0:0:0:0:1%lo0
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /0:0:0:0:0:0:0:1
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /127.0.0.1
20:23:22.562 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback multicast interface lo0
20:23:22.569 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
20:23:22.570 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
20:23:22.573 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
20:23:22.575 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpOutgoingConnector] Attempting to connect to [1dbd6499-7d7c-4a52-8bf0-a96bd2a298d5 port:52208, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]].
20:23:22.575 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpOutgoingConnector] Trying to connect to address /0:0:0:0:0:0:0:1.
20:23:22.586 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpOutgoingConnector] Connected to address /0:0:0:0:0:0:0:1:52208.
20:23:22.597 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClient] Connected to daemon DaemonInfo{pid=34492, address=[1dbd6499-7d7c-4a52-8bf0-a96bd2a298d5 port:52208, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], state=Idle, lastBusy=1530728557709, context=DefaultDaemonContext[uid=18f40db9-e3cd-413a-bbbf-6015a3faddea,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home,daemonRegistryDir=/Users/lg/.gradle/daemon,pid=34492,idleTimeout=10800000,daemonOpts=-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]}. Dispatching request Build{id=0b9ae9aa-76eb-4b3d-9af0-9c12c619b0f6, currentDir=/opt/local/bin}.
20:23:22.597 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: dispatching class org.gradle.launcher.daemon.protocol.Build
20:23:22.604 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClient] Received result org.gradle.launcher.daemon.protocol.BuildStarted@411f53a0 from daemon DaemonInfo{pid=34492, address=[1dbd6499-7d7c-4a52-8bf0-a96bd2a298d5 port:52208, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], state=Idle, lastBusy=1530728557709, context=DefaultDaemonContext[uid=18f40db9-e3cd-413a-bbbf-6015a3faddea,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home,daemonRegistryDir=/Users/lg/.gradle/daemon,pid=34492,idleTimeout=10800000,daemonOpts=-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be starting).
20:23:22.603 [INFO] [org.gradle.launcher.daemon.server.exec.LogToClient] The client will now receive all logging from the daemon (pid: 34492). The daemon log file: /Users/lg/.gradle/daemon/4.8.1/daemon-34492.out.log
20:23:22.604 [INFO] [org.gradle.launcher.daemon.server.exec.LogAndCheckHealth] Starting 5th build in daemon [uptime: 12 mins 8.632 secs, performance: 98%, no major garbage collections]
20:23:22.604 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has started executing the build.
20:23:22.604 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] Executing build with daemon context: DefaultDaemonContext[uid=18f40db9-e3cd-413a-bbbf-6015a3faddea,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home,daemonRegistryDir=/Users/lg/.gradle/daemon,pid=34492,idleTimeout=10800000,daemonOpts=-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
20:23:22.605 [INFO] [org.gradle.internal.work.DefaultWorkerLeaseService] Using 8 worker leases.
20:23:22.606 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Creating new cache for fileHashes, path /opt/local/bin/.gradle/4.8.1/fileHashes/fileHashes.bin, access org.gradle.cache.internal.DefaultCacheAccess@60fd8ac9
20:23:22.607 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Acquiring file lock for file hash cache (/opt/local/bin/.gradle/4.8.1/fileHashes)
20:23:22.608 [DEBUG] [org.gradle.deployment.internal.DefaultDeploymentRegistry] Stopping 0 deployment handles
20:23:22.608 [DEBUG] [org.gradle.deployment.internal.DefaultDeploymentRegistry] Stopped deployment handles
20:23:22.608 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Cache file hash cache (/opt/local/bin/.gradle/4.8.1/fileHashes) was closed 0 times.
20:23:22.609 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
20:23:22.609 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
20:23:22.609 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
20:23:22.609 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
20:23:22.609 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
20:23:22.610 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().
20:23:22.610 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
20:23:22.610 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
20:23:22.610 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.  Run with --scan to get full insights.
20:23:22.610 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
20:23:22.610 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
20:23:22.610 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] 
20:23:22.610 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 0s
20:23:22.610 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has finished executing the build.
20:23:22.650 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientInputForwarder] Dispatching close input message: org.gradle.launcher.daemon.protocol.CloseInput@50dc9016
20:23:22.650 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 14: dispatching class org.gradle.launcher.daemon.protocol.CloseInput
20:23:22.651 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClient] Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().] from daemon DaemonInfo{pid=34492, address=[1dbd6499-7d7c-4a52-8bf0-a96bd2a298d5 port:52208, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], state=Idle, lastBusy=1530728557709, context=DefaultDaemonContext[uid=18f40db9-e3cd-413a-bbbf-6015a3faddea,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home,daemonRegistryDir=/Users/lg/.gradle/daemon,pid=34492,idleTimeout=10800000,daemonOpts=-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be done).
20:23:22.651 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: dispatching class org.gradle.launcher.daemon.protocol.Finished
20:23:22.651 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: connection stop

Scan doesn't add any information.

Any ideas?

$ uname -a
Darwin 15 17.5.0 Darwin Kernel Version 17.5.0: Fri Apr 13 19:32:32 PDT 2018; root:xnu-4570.51.2~1/RELEASE_X86_64 x86_64

comment:4 Changed 6 years ago by amake (Aaron Madlon-Kay)

The currentDir at the end of this line looks suspect:

20:23:22.597 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClient] Connected to daemon DaemonInfo{pid=34492, address=[1dbd6499-7d7c-4a52-8bf0-a96bd2a298d5 port:52208, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], state=Idle, lastBusy=1530728557709, context=DefaultDaemonContext[uid=18f40db9-e3cd-413a-bbbf-6015a3faddea,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home,daemonRegistryDir=/Users/lg/.gradle/daemon,pid=34492,idleTimeout=10800000,daemonOpts=-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]}. Dispatching request Build{id=0b9ae9aa-76eb-4b3d-9af0-9c12c619b0f6, currentDir=/opt/local/bin}.

What is your pwd when you run the gradle command? Are you trying to run gradle from /opt/local/bin? Because you should be running it from the root of your project.

comment:5 Changed 6 years ago by amake (Aaron Madlon-Kay)

Sorry, I had missed that you said you run it from your home. I can also reproduce it from there.

Don't do that. Run it from the root of your project. gradle init is like git init; you usually make a dir for your project, cd into it, and then run it from there.

comment:6 Changed 6 years ago by l-g

Aah, thank you.

Just for future reference: creating a new directory and moving the client_secret.json into that directory, cd into this new directory and then running gradle init fixed this issue.

comment:7 Changed 6 years ago by amake (Aaron Madlon-Kay)

Resolution: worksforme
Status: assignedclosed
Note: See TracTickets for help on using tickets.