我的 Android Studio 从昨天开始就一直卡在加载屏幕。X_X
我已尝试过:
- 正在重新启动计算机。
- 清除垃圾文件和日志。
- 完全卸载然后重新安装 AndroidStudio。
- 遵循了许多不同的解决方案(例如:其中之一是这里)。但还是不起作用。解决方案摘录:
- 打开文件Android Studio安装目录/bin/idea.properties
- 添加
disable.android.first.run=true
至结尾 - 重启Android Studio
- 当我删除 SDK 时,它可以工作,但是当我再次让它下载 SDK 时,它会为该会话打开,然后在下一个会话中再次卡住。
好吧,我不想每次打开 Android Studio 时都要删除并重新下载 SDK。有没有人有解决方案?
谢谢
更多信息:
Android Studio 4.1
Build #AI-201.8743.12.41.6858069, built on September 23, 2020
Runtime version: 1.8.0_242-release-1644-b3-6222593 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.15.6
GC: ParNew, ConcurrentMarkSweep
Memory: 4029M
Cores: 8
Registry: ide.new.welcome.screen.force=true
Non-Bundled Plugins: org.jetbrains.kotlin, Dart, io.flutter
我的jave -version
openjdk version "14.0.1" 2020-04-14
OpenJDK Runtime Environment (build 14.0.1+14)
OpenJDK 64-Bit Server VM (build 14.0.1+14, mixed mode, sharing)
我的/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)
我的studio.vmoption
:
-Xms1G
-Xmx4G
-XX:MaxPermSize=1G
-XX:ReservedCodeCacheSize=512m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-XX:CICompilerCount=2
-Dsun.io.useCanonPrefixCache=false
-Djdk.http.auth.tunneling.disabledSchemes=""
-Djdk.attach.allowAttachSelf=true
-Dkotlinx.coroutines.debug=off
-Djdk.module.illegalAccess.silent=true
-Djna.nosys=true
-Djna.boot.library.path=
-Didea.vendor.name=Google
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-XX:ErrorFile=$USER_HOME/java_error_in_studio_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_studio.hprof
我的idea.properties
:
idea.max.intellisense.filesize=2500
idea.cycle.buffer.size=1024
sun.java2d.d3d=false
idea.dynamic.classpath=false
idea.no.launcher=false
idea.xdebug.key=-Xdebug
sun.java2d.uiScale.enabled=true
swing.bufferPerWindow=true
idea.fatal.error.notification=disabled
javax.swing.rebaseCssSizeMap=true
idea.max.content.load.filesize=20000
idea.popup.weight=heavy
sun.java2d.pmoffscreen=false
CVS_PASSFILE=~/.cvspass
com.apple.mrj.application.live-resize=false
java.endorsed.dirs=
idea.smooth.progress=false
apple.laf.useScreenMenuBar=true
apple.awt.fileDialogForDirectories=true
apple.awt.graphics.UseQuartz=true
apple.awt.fullscreencapturealldisplays=false
idea.jre.check=true
disable.android.first.run=true
答案1
找到答案https://stackoverflow.com/questions/54806995/android-studio-corrupt-installation/61701185#61701185
我只是删除了文件夹
MacOS:〜/资源库/应用程序支持/Google/AndroidStudio4.1
并且它有效。
答案2
从终端运行时,您可以看到导致其进入重启循环的错误。
我的解决方法是使用 JetBrains Toolbox 重新安装。
2021-04-09 17:47:38,379 [ 45709] ERROR - llij.ide.plugins.PluginManager - Android Studio 4.1.3 Build #AI-201.8743.12.41.7199119
2021-04-09 17:47:38,444 [ 45774] ERROR - rationStore.ComponentStoreImpl - Android Studio 4.1.3 Build #AI-201.8743.12.41.7199119
2021-04-09 17:47:38,444 [ 45774] ERROR - rationStore.ComponentStoreImpl - JDK: 1.8.0_242-release; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
2021-04-09 17:47:38,444 [ 45774] ERROR - rationStore.ComponentStoreImpl - OS: Mac OS X
2021-04-09 17:47:38,444 [ 45774] ERROR - llij.ide.plugins.PluginManager - JDK: 1.8.0_242-release; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
2021-04-09 17:47:38,445 [ 45775] ERROR - llij.ide.plugins.PluginManager - OS: Mac OS X
2021-04-09 17:47:38,444 [ 45774] ERROR - rationStore.ComponentStoreImpl - Last Action:
2021-04-09 17:47:38,445 [ 45775] ERROR - llij.ide.plugins.PluginManager - Last Action:
2021-04-09 17:47:38,445 [ 45775] ERROR - llij.ide.plugins.PluginManager - Could not initialize class com.intellij.internal.statistic.service.fus.collectors.FUCounterUsageLogger
java.lang.NoClassDefFoundError: Could not initialize class com.intellij.internal.statistic.service.fus.collectors.FUCounterUsageLogger
at com.intellij.featureStatistics.fusCollectors.LifecycleUsageTriggerCollector.onError(LifecycleUsageTriggerCollector.java:123)
at com.intellij.diagnostic.DefaultIdeaErrorLogger.canHandle(DefaultIdeaErrorLogger.java:62)
at com.intellij.diagnostic.DialogAppender.appendToLoggers(DialogAppender.java:85)
at com.intellij.diagnostic.DialogAppender.lambda$queueAppend$0(DialogAppender.java:58)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:974)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:847)
at com.intellij.ide.IdeEventQueue.lambda$null$8(IdeEventQueue.java:449)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:741)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:502)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
2021-04-09 17:47:38,446 [ 45776] ERROR - rationStore.ComponentStoreImpl - Conflicting component name 'UsagesStatistic': class com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent and class com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent (componentManager=Application (containerState=ACTIVE) )
java.lang.Throwable: Conflicting component name 'UsagesStatistic': class com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent and class com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent (componentManager=Application (containerState=ACTIVE) )
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:146)
...
at com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent.getInstance(UsageStatisticsPersistenceComponent.java:54)