Интеллидж андроид проект. Gradle 5.2.1. Причина: java.util.ConcurrentModificationException - PullRequest
5 голосов
/ 08 марта 2019

Я запустил новый проект Android с Intellij IDEA и получил эту ошибку. Я только изменил версию gradle на 5.2.1 в gradle-wrapper.properties. Почему Intellij создает проект, который не работает? Я также попытался добавить этот проект Android в существующий проект в виде модуля с помощью скрипта gradle kts, и у меня та же ошибка.

Cause: java.util.ConcurrentModificationException
at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1134)
at com.android.ide.common.gradle.model.ModelCache.computeIfAbsent(ModelCache.java:29)
at com.android.ide.common.gradle.model.IdeProductFlavor.copyVectorDrawables(IdeProductFlavor.java:80)
at com.android.ide.common.gradle.model.IdeProductFlavor.<init>(IdeProductFlavor.java:56)
at com.android.ide.common.gradle.model.IdeProductFlavorContainer.lambda$new$0(IdeProductFlavorContainer.java:42)
at com.android.ide.common.gradle.model.ModelCache.lambda$computeIfAbsent$0(ModelCache.java:29)
at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1133)
at com.android.ide.common.gradle.model.ModelCache.computeIfAbsent(ModelCache.java:29)
at com.android.ide.common.gradle.model.IdeProductFlavorContainer.<init>(IdeProductFlavorContainer.java:40)
at com.android.ide.common.gradle.model.IdeAndroidProjectImpl.lambda$new$0(IdeAndroidProjectImpl.java:86)
at com.android.ide.common.gradle.model.ModelCache.lambda$computeIfAbsent$0(ModelCache.java:29)
at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1133)
at com.android.ide.common.gradle.model.ModelCache.computeIfAbsent(ModelCache.java:29)
at com.android.ide.common.gradle.model.IdeAndroidProjectImpl.<init>(IdeAndroidProjectImpl.java:84)
at com.android.ide.common.gradle.model.IdeAndroidProjectImpl.<init>(IdeAndroidProjectImpl.java:68)
at com.android.tools.idea.gradle.project.model.AndroidModuleModel.<init>(AndroidModuleModel.java:134)
at com.android.tools.idea.gradle.project.model.AndroidModuleModel.<init>(AndroidModuleModel.java:125)
at com.android.tools.idea.gradle.project.sync.idea.AndroidGradleProjectResolver.populateModuleContentRoots(AndroidGradleProjectResolver.java:213)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.populateModuleContentRoots(AbstractProjectResolverExtension.java:96)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.populateModuleContentRoots(AbstractProjectResolverExtension.java:96)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.populateModuleContentRoots(AbstractProjectResolverExtension.java:96)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.populateModuleContentRoots(AbstractProjectResolverExtension.java:96)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.populateModuleContentRoots(AbstractProjectResolverExtension.java:96)
at org.jetbrains.kotlin.android.configure.KotlinAndroidMPPGradleProjectResolver.populateModuleContentRoots(KotlinAndroidMPPGradleProjectResolver.kt:51)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.populateModuleContentRoots(AbstractProjectResolverExtension.java:96)
at org.jetbrains.plugins.gradle.service.project.TracedProjectResolverExtension.populateModuleContentRoots(TracedProjectResolverExtension.java:62)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.doResolveProjectInfo(GradleProjectResolver.java:380)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.access$200(GradleProjectResolver.java:73)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:737)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:720)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:224)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:138)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:73)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.lambda$resolveProjectInfo$0(RemoteExternalSystemProjectResolverImpl.java:36)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:57)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:36)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:44)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:99)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:165)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:151)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.executeImpl(ExternalSystemUtil.java:559)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.lambda$execute$0(ExternalSystemUtil.java:399)
at com.intellij.openapi.project.DumbServiceImpl.suspendIndexingAndRun(DumbServiceImpl.java:146)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:399)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$5.run(ExternalSystemUtil.java:664)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:731)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:586)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:86)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:403)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:311)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

Ответы [ 2 ]

1 голос
/ 08 марта 2019

Это известная проблема . В качестве обходного пути используйте IntelliJ IDEA с JetBrains Runtime 8 вместо 11 (который все еще экспериментален).

0 голосов
/ 18 мая 2019

Просто установите JetBrains Toolbox и нажмите «Установить IntelliJ IDEA Community / Ultimate без« + JBR11 ». Работал для меня в Manjaro Linux.Теперь моя сборка Gradle для моего проекта Android проходит.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...