Android Studio-Gradle同步失败:已处置 [英] Android Studio - Gradle sync failed: Already disposed

查看:428
本文介绍了Android Studio-Gradle同步失败:已处置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新为 Android Studio 3.2 Beta 1 后,我开始针对两个不同的项目收到以下错误消息:

After updating to Android Studio 3.2 Beta 1, I started getting the following error for two different projects:

Gradle sync failed: Already disposed!

Android Studio 3.1.3没有错误,并且各种Canary版本的Android Studio 3.2也没有错误,然后更新为Beta 1.

There is no error with Android Studio 3.1.3, and there was no error with various canary versions of Android Studio 3.2 before updating to beta 1.

我已经尝试了我能想到的所有方法(例如,彻底清理项目,包括所有生成的.gradle/.iml/.idea文件/文件夹,以及完全无效的缓存并重新启动Android Studio),但均未成功.使用Gradle可以从命令行按预期的方式进行构建.

I already tried everything I can think of (e.g. complete cleaning of project, including all generated .gradle/.iml/.idea files/folders, as well as a complete invalidate cache and restart of Android Studio) without success. The build works as expected from command line using Gradle.

这不是不是 Android Studio Gradle的副本处置模块

编辑

事件日志正在显示

Unable to save plugin settings: The plugin org.jetbrains.android failed to save settings and has been disabled. Please restart Android Studio

在"IDE致命错误"窗口中,看到以下异常:

In the "IDE Fatal Errors" window, I am seeing the following exception:

'Gradle: backport-util-concurrent:backport-util-concurrent:3.1@jar' already disposed: --------------Creation trace: 
java.lang.Throwable
    at com.intellij.openapi.util.TraceableDisposable.<init>(TraceableDisposable.java:45)
    at com.intellij.openapi.roots.impl.libraries.LibraryImpl.<init>(LibraryImpl.java:103)
    at com.intellij.openapi.roots.impl.libraries.LibraryImpl.<init>(LibraryImpl.java:69)
    at com.intellij.openapi.roots.impl.libraries.LibraryTableBase$LibraryModel.readExternal(LibraryTableBase.java:327)
    at com.intellij.openapi.roots.impl.libraries.LibraryTableBase.loadState(LibraryTableBase.java:64)
    at com.intellij.openapi.roots.impl.libraries.LibraryTableBase.loadState(LibraryTableBase.java:30)
    at com.intellij.configurationStore.ComponentStoreImpl.doInitComponent(ComponentStoreImpl.kt:375)
    at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:331)
    at com.intellij.configurationStore.ComponentStoreImpl.initPersistenceStateComponent(ComponentStoreImpl.kt:121)
    at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:96)
    at com.intellij.openapi.components.impl.PlatformComponentManagerImpl.initializeComponent(PlatformComponentManagerImpl.java:54)

最新版本的Android Studio 3.2出现相同的问题.

More recent version of Android Studio 3.2 are having the same issue.

推荐答案

事实证明,问题是我试图打开一个指向实际位置的符号链接的项目目录(在同一分区上). Gradle(在命令行上)从符号链接位置构建项目没有问题,但是,在Android Studio中打开它会导致上述晦涩且无用的错误.

As it turned out, the problem was that I was trying to open a project directory that was a symlink to the actual location (on the same partition). Gradle (on command line) had no issues building the project from the symlinked location, however, opening it in Android Studio resulted in the obscure and non helpful error described above.

这篇关于Android Studio-Gradle同步失败:已处置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆