Gradle and build Android Studio fails

I could always use Android Studio . I upgraded to Gradle Version 2.9 and I continue to receive errors while creating. 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 tried to run it using the - stacktrace and - information , but it doesn't seem to help much. Do I have to post it here to get help?

EDIT (Mine is debugging ):

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.
+4
source share
4 answers

GRADLE_USER_HOME , . .

: , "gradle clean" .

Gradle 2.3.

-stacktrace , ".gradle" Gradle ( Gradle ), /some/location/where/gradle/ OR some/path/location/xxx/yyy, , Gradle , ( /).

. , Jenkins , touch/mkdir ( Gradle , , .gradle).

, GRADLE_USER_HOME ENVIRONMENT Variable. , , .

:

GRADLE_USER_HOME = ~/gradle_2_3_cache/.gradle .

~/.gradle. (gradle_2_3_cache). , , , Gradle 2.5 , , .gradle 2.3 2.5/x .

+4

,

.gradle

C:\Users\username.gradle( Windows)

+2

32- JVM, 64- ( (jdk-8u92-linux- i586.tar.gz).

Switching to the x64 JDK installation (jdk-8u92-linux- x64 .tar.gz) fixes the problem.

+2
source

In my case, this was caused by a lack of permission on the file system. I just change the owner of the directory and start working:

sudo chown -fR $(whoami):staff /opt/gradle-4.6
0
source

Source: https://habr.com/ru/post/1619615/


All Articles