4

I've always been able to use Android Studio. I upgraded to Gradle Version 2.9 and I keep getting errors while building. I get the following error:

Gradle:
FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type ScriptPluginFactory using 
BuildScopeServices.createScriptObjectConfigurerFactory().

* Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.

I've tried running it with --stacktrace and --infobut it doesn't seem to help much. Should I post it here to get help?

EDIT(My --debug output):

19:39:58.668 [DEBUG]   
[org.gradle.internal.nativeintegration.services.NativeServices]
Unable to initialize native-platform. 
Failure net.rubygrapefruit.platform.NativeException: Failed to load
native library 'libnative-platform.dylib' for Mac OS X x86_64.
caused by: java.io.FileNotFoundException:
/Users/Johnwon/.gradle/native/19/osx-amd64/libnative- platform.dylib.lock (Permission denied)
19:39:58.718 [DEBUG]  [org.gradle.internal.nativeintegration.filesystem.services.FileSystemServices] Native-platform file system integration is not available. Continuing with fallback.
19:39:58.721 [DEBUG] [org.gradle.internal.nativeintegration.filesystem.services.FileSystemServices] Using UnsupportedSymlink implementation.
19:39:58.723 [DEBUG] [org.gradle.internal.nativeintegration.filesystem.services.FileSystemServices] Using JDK 7 file service org.gradle.internal.nativeintegration.filesystem.jdk7.PosixJdk7FilePermissionHandler
19:39:59.522 [DEBUG] [org.gradle.internal.resource.transport.http.JavaSystemPropertiesProxySettings] Found java system property 'http.nonProxyHosts': local|*.local|169.254/16|*.169.254/16. Will ignore proxy settings for these hosts.
John Won
  • 55
  • 1
  • 8

3 Answers3

3

If nothing seems to work, then do this

Just delete your .gradle folder

Located here C:\Users\username.gradle (for Windows)

Community
  • 1
  • 1
johnrao07
  • 6,690
  • 4
  • 32
  • 55
2

In my case, this was caused by a 32-bit JVM installed on a 64-bit machine (I was using (jdk-8u92-linux-i586.tar.gz).

Switching to a x64 JDK install (jdk-8u92-linux-x64.tar.gz) fixed the problem.

Adam Adamaszek
  • 3,914
  • 1
  • 19
  • 24
0

In my case, it was being caused by lack of permission in the file-system. I just change the directory owner and it starts to work:

sudo chown -fR $(whoami):staff /opt/gradle-4.6
Wellington Souza
  • 2,200
  • 2
  • 22
  • 33