问题描述
最近重启的计算机并打开了现有项目,并且Android Studio对所有android和java类都显示红色".
Recently restarted computer and opened up existing project and Android Studio shows "red" for all android and java classes.
构建良好-详情如下. (甚至引入了编译错误,该错误会在构建过程中正常检测;还原并构建就可以了.)
Builds fine - details below. (Even introduced a compilation error which the build detects just fine; restore and builds OK.)
尝试过(无效)
- 重新启动
- 使缓存无效/重启
- 打开了另一个过去的项目,该项目很好并且存在相同的错误.
- 尝试使用菜单文件|设置"没有响应.
感谢任何想法...
Starting Gradle Daemon...
Gradle Daemon started in 1 s 15 ms
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:mergeDebugResources UP-TO-DATE
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:extractDeepLinksDebug UP-TO-DATE
> Task :app:processDebugManifest
> Task :app:processDebugResources
> Task :app:compileDebugJavaWithJavac UP-TO-DATE
> Task :app:compileDebugSources UP-TO-DATE
> Task :app:mergeDebugShaders UP-TO-DATE
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :app:mergeDebugAssets UP-TO-DATE
> Task :app:processDebugJavaRes NO-SOURCE
> Task :app:mergeDebugJavaResource UP-TO-DATE
> Task :app:checkDebugDuplicateClasses UP-TO-DATE
> Task :app:dexBuilderDebug
> Task :app:mergeLibDexDebug
> Task :app:mergeDebugJniLibFolders UP-TO-DATE
> Task :app:mergeDebugNativeLibs UP-TO-DATE
> Task :app:stripDebugDebugSymbols NO-SOURCE
> Task :app:validateSigningDebug UP-TO-DATE
> Task :app:mergeProjectDexDebug
> Task :app:mergeExtDexDebug
> Task :app:packageDebug
> Task :app:assembleDebug
BUILD SUCCESSFUL in 10s
21 actionable tasks: 7 executed, 14 up-to-date
1000个编辑器无法解析符号"中的1个:
1 of 1000s of editor "Cannot resolve symbol":
推荐答案
结果显示插件更新可能会导致Studio无法正确初始化. idea.log
文件(位于<user folder>/.AndroidStudio4.0/system/log
中,显示该错误不断重复,并且可能阻止Studio继续进行:
Turns out a plugin update can cause Studio to not initialize properly. The idea.log
file (located in <user folder>/.AndroidStudio4.0/system/log
shows the error repeating continuously and likely prevented Studio to continue:
2020-06-17 20:07:22,043 [ 97867] ERROR - nsions.impl.ExtensionPointImpl - Android Studio 4.0 Build #AI-193.6911.18.40.6514223
2020-06-17 20:07:22,043 [ 97867] ERROR - nsions.impl.ExtensionPointImpl - JDK: 1.8.0_242-release; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
2020-06-17 20:07:22,044 [ 97868] ERROR - nsions.impl.ExtensionPointImpl - OS: Windows 10
2020-06-17 20:07:22,044 [ 97868] ERROR - nsions.impl.ExtensionPointImpl - Plugin to blame: CSV Plugin version: 2.12.0
2020-06-17 20:07:22,044 [ 97868] ERROR - nsions.impl.ExtensionPointImpl - Last Action: CheckForUpdate
2020-06-17 20:07:22,044 [ 97868] ERROR - nsions.impl.ExtensionPointImpl - While loading class net.seesharpsoft.intellij.plugins.csv.CsvFileTypeOverrider: net/seesharpsoft/intellij/plugins/csv/CsvFileTypeOverrider has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0 [Plugin: net.seesharpsoft.intellij.plugins.csv]
com.intellij.diagnostic.PluginException: While loading class net.seesharpsoft.intellij.plugins.csv.CsvFileTypeOverrider: net/seesharpsoft/intellij/plugins/csv/CsvFileTypeOverrider has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0 [Plugin: net.seesharpsoft.intellij.plugins.csv]
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:223)
at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.java:167)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:75)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
有问题的插件是CSV插件版本2.12.0 ,并且显然是为不支持的更高版本的JDK编译的.
The offending plugin is CSV Plugin version 2.12.0 and evidently is compiled for a later version JDK which can't be supported.
从以下位置删除插件文件夹:
Deleting the plugin folder from:
<user>/.AndroidStudio4.0/config/plugins/<offending plugin folder>
解决了这个问题.
该错误连续记录到idea.log中,并导致日志轮换,每个日志文件为10MB.根本不知道这是在后台发生的-唯一可见的症状是红色",而设置..."之类的东西不起作用.
The error is logged to the idea.log continuously and results a log rotation and each log file is 10MB. It is not at all obvious this is happening in the background - the only visible symptom is the "red" and things like "Settings..." does not work.
这篇关于在PC重新启动时,Android Studio(4.0)会显示所有“红色"图标.适用于所有android/java类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!