我一直都可以使用 Android Studio 。我升级到 Gradle 版本 2.9 ,我在构建时遇到错误。 我收到以下错误:
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.
我已尝试使用 - stacktrace 和 - info 运行它,但它似乎没有多大帮助。 我应该在这里发帖以获得帮助吗?
编辑(我的 - 调试输出):
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.
答案 0 :(得分:2)
如果似乎没有任何效果,请执行此操作
只需删除.gradle文件夹
即可位于此处C:\ Users \ username.gradle( for Windows )
答案 1 :(得分:2)
在我的情况下,这是由64位计算机上安装的32位JVM引起的(我正在使用(jdk-8u92-linux- i586 .tar.gz)。
切换到x64 JDK安装(jdk-8u92-linux- x64 .tar.gz)修复了问题。
答案 2 :(得分:0)
就我而言,这是由于文件系统缺乏权限造成的。 我只是更改目录所有者,它开始工作:
sudo chown -fR $(whoami):staff /opt/gradle-4.6