为什么Android Studio 4.1无法启动?

时间:2020-11-08 17:45:30

标签: android android-studio

我尝试重新安装和删除AppData中所有与android studio相关的文件夹。我收到以下错误-

2020-11-08 22:53:27,162 [   1831]  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.configurationStore.ComponentStoreImpl.doAddComponent(ComponentStoreImpl.kt:352)
        at com.intellij.configurationStore.ComponentStoreImpl.initPersistenceStateComponent(ComponentStoreImpl.kt:137)
        at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:103)
        at com.intellij.configurationStore.ComponentStoreWithExtraComponents.initComponent(ComponentStoreWithExtraComponents.kt:50)
        at com.intellij.serviceContainer.ComponentManagerImpl.initializeComponent$intellij_platform_serviceContainer(ComponentManagerImpl.kt:358)
        at com.intellij.serviceContainer.ComponentManagerImpl.createLightService(ComponentManagerImpl.kt:598)
        at com.intellij.serviceContainer.ComponentManagerImpl.getOrCreateLightService(ComponentManagerImpl.kt:486)
        at com.intellij.serviceContainer.ComponentManagerImpl.getLightService$intellij_platform_serviceContainer(ComponentManagerImpl.kt:458)
        at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:401)
        at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:394)
        at com.intellij.openapi.components.ServiceManager.getService(ServiceManager.java:20)
        at com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent.getInstance(UsageStatisticsPersistenceComponent.java:54)
        at com.intellij.ide.gdpr.ConsentOptions.saveConfirmedConsents(ConsentOptions.java:238)
        at com.intellij.ide.gdpr.ConsentOptions.setSendingUsageStatsAllowed(ConsentOptions.java:138)
        at com.intellij.ide.gdpr.ConsentOptionsProviderImpl.setSendingUsageStatsAllowed(ConsentOptionsProviderImpl.java:14)
        at com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent.loadState(UsageStatisticsPersistenceComponent.java:74)

为什么会这样?

4 个答案:

答案 0 :(得分:4)

我通过编辑Android Studio安装文件夹中的idea.properties文件并在下面的行中未添加注释来解决此问题-

idea.config.path=${user.home}/.AndroidStudio/config

取消注释以上行后,Android Studio 4.1正常启动。

我浪费了太多时间解决此问题,因此在此处发布它可以为他人提供帮助。

答案 1 :(得分:2)

我在这里发现了错误:https://issuetracker.google.com/issues/171901414

这对我有用:

通过在 %%APPDATA%\Google\AndroidStudio4.1\options\usage.statistics.xml 中将 "allow" 设置为 false 解决

答案 2 :(得分:1)

Google 在其网站上将此列为已知问题,他们建议删除配置以恢复默认状态。

因此,如果您删除 %%AppData%%\Roaming\Google\AndroidStudio4.1,它应该可以正确启动,但您必须重新安装任何第三方插件。

https://developer.android.com/studio/known-issues#studio-config-directories

答案 3 :(得分:0)

我已经删除了以前安装时在不同文件夹中保留的 Android Studio 的所有设置。例如,在 Ubuntu 中,它位于 /home/username/android... 下。