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

查看:34
本文介绍了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没有报错,Android Studio 3.2各种canary版本在更新到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)

编辑 2:

最新版本的 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天全站免登陆