fri*_*mle 9 linux android gradle android-studio
更新到Android Studio 3.2 Beta 1之后,我开始针对两个不同的项目收到以下错误:
Gradle sync failed: Already disposed!
Run Code Online (Sandbox Code Playgroud)
Android Studio 3.1.3没有错误,并且各种Canary版本的Android Studio 3.2也没有错误,然后更新为Beta 1。
我已经尝试过我能想到的所有内容(例如,彻底清理项目,包括所有生成的.gradle / .iml / .idea文件/文件夹,以及完全无效的缓存并重新启动Android Studio),但均未成功。使用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
Run Code Online (Sandbox Code Playgroud)
在“ IDE致命错误”窗口中,我看到以下异常:
'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)
Run Code Online (Sandbox Code Playgroud)
编辑2:
较新版本的Android Studio 3.2出现相同问题。
fri*_*mle 14
事实证明,问题在于我试图打开一个项目目录,该目录是到实际位置(在同一分区上)的符号链接。Gradle(在命令行上)从符号链接位置构建项目没有问题,但是,在Android Studio中打开它会导致上述晦涩且无用的错误。
简单的解决方案
1.Delete module folder and modules.xml file under .idea folder.
2.Close Android Studio
3.Reopen and sync
Run Code Online (Sandbox Code Playgroud)