且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

android studio 无法解析符号“GradleException"

更新时间:2023-11-07 09:03:40

注意:此答案不再适用于较新版本的 Android Studio 和 Gradle.请参阅此答案.

Note: this answer is no longer up-to-date for newer versions of Android Studio and Gradle. See this answer instead.

Android Studio 似乎有各种我不明白为什么存在的问题,但是通过使缓存无效并重新启动(从文件菜单项)来修复它们.因为代码编译得很好,这似乎是缓存条目以某种方式结束的情况之一,我不确定具体发生了什么,但基本上是阻止它正常工作的东西.

Android Studio seems to have various problems that I cannot understand why exist, but they're fixed by invalidating the caches and restarting (from the file menu item). Because the code compiles fine, it seems that this is one of those cases, in which a cache entry somehow ends up, I'm not really sure what specifically happens, but essentially something that prevents it from working properly.

因此使缓存无效并重新启动可能会出现这样的问题,无论是使用 Gradle 还是使用 Java/Kotlin/Scala/.

So invalidating the caches and restarting may issues like this, whether it's with Gradle or with Java/Kotlin/Scala/<insert language here>.