Android Studio 3.0 Kotlin не работает должным образом

Недавно я установил Android Studio 3.0 и начал новый проект с использованием Kotlin. Плагин kotlin с подсветкой и завершением кода работал отлично, так как я начал проект. Тем не менее, пару дней назад я закрыл Android Studio впервые с момента запуска этого проекта, и теперь, когда я его снова открыл, завершение кода и выделение прекратились, и Android Studio показывает мне следующее исключение:

2017-11-05 19:38:03,424 [ thread 19] ERROR - on.CompletionProgressIndicator - Resolver for 'completion/highlighting in org.jetbrains.kotlin.idea.caches.resolve.NotUnderContentRootModuleInfo@3a2816ac for files GameMainActivity.kt for platform JVM' does not know how to resolve ModuleProductionSourceInfo(module=Module: 'app') java.lang.AssertionError: Resolver for 'completion/highlighting in org.jetbrains.kotlin.idea.caches.resolve.NotUnderContentRootModuleInfo@3a2816ac for files GameMainActivity.kt for platform JVM' does not know how to resolve ModuleProductionSourceInfo(module=Module: 'app') at org.jetbrains.kotlin.analyzer.ResolverForProjectImpl.descriptorForModule(AnalyzerFacade.kt:168) at org.jetbrains.kotlin.analyzer.ResolverForProjectImpl.descriptorForModule(AnalyzerFacade.kt:77) at org.jetbrains.kotlin.analyzer.ResolverForProject.resolverForModule(AnalyzerFacade.kt:56) at org.jetbrains.kotlin.idea.caches.resolve.ProjectResolutionFacade.resolverForModuleInfo(ProjectResolutionFacade.kt:73) at org.jetbrains.kotlin.idea.caches.resolve.ResolutionFacadeImpl.tryGetFrontendService(ResolutionFacadeImpl.kt:87) at org.jetbrains.kotlin.idea.caches.resolve.JavaResolutionUtils.getJavaDescriptorResolver(JavaResolveExtension.kt:109) at org.jetbrains.kotlin.idea.caches.resolve.JavaResolutionUtils.getJavaClassDescriptor(JavaResolveExtension.kt:55) at org.jetbrains.kotlin.idea.caches.resolve.JavaResolutionUtils.resolveToDescriptor(JavaResolveExtension.kt:103) at org.jetbrains.kotlin.idea.caches.resolve.JavaResolutionUtils.resolveToDescriptor$default(JavaResolveExtension.kt:95) at org.jetbrains.kotlin.idea.completion.BasicCompletionSession$ALL$1$completeNonImported$6.invoke(BasicCompletionSession.kt:379) at org.jetbrains.kotlin.idea.completion.BasicCompletionSession$ALL$1$completeNonImported$6.invoke(BasicCompletionSession.kt:182) at org.jetbrains.kotlin.idea.completion.AllClassesCompletion$addAdaptedJavaCompletion$1.consume(AllClassesCompletion.kt:100) at org.jetbrains.kotlin.idea.completion.AllClassesCompletion$addAdaptedJavaCompletion$1.consume(AllClassesCompletion.kt:41) at com.intellij.codeInsight.completion.LimitedAccessibleClassPreprocessor.process(LimitedAccessibleClassPreprocessor.java:80) at com.intellij.codeInsight.completion.LimitedAccessibleClassPreprocessor.process(LimitedAccessibleClassPreprocessor.java:32) at com.intellij.psi.impl.search.AllClassesSearchExecutor.processClassesByNames(AllClassesSearchExecutor.java:84) at com.intellij.codeInsight.completion.AllClassesGetter.processJavaClasses(AllClassesGetter.java:157) at com.intellij.codeInsight.completion.AllClassesGetter.processJavaClasses(AllClassesGetter.java:143) at org.jetbrains.kotlin.idea.completion.AllClassesCompletion.addAdaptedJavaCompletion(AllClassesCompletion.kt:89) at org.jetbrains.kotlin.idea.completion.AllClassesCompletion.collect(AllClassesCompletion.kt:72) at org.jetbrains.kotlin.idea.completion.BasicCompletionSession$ALL$1.completeNonImported(BasicCompletionSession.kt:379) at org.jetbrains.kotlin.idea.completion.BasicCompletionSession$ALL$1.access$completeNonImported(BasicCompletionSession.kt:182) at org.jetbrains.kotlin.idea.completion.BasicCompletionSession$ALL$1$doComplete$4.invoke(BasicCompletionSession.kt:304) at org.jetbrains.kotlin.idea.completion.BasicCompletionSession$ALL$1$doComplete$4.invoke(BasicCompletionSession.kt:182) at org.jetbrains.kotlin.idea.completion.CompletionSession.withContextVariablesProvider(CompletionSession.kt:385) at org.jetbrains.kotlin.idea.completion.BasicCompletionSession$ALL$1.doComplete(BasicCompletionSession.kt:274) at org.jetbrains.kotlin.idea.completion.BasicCompletionSession.doComplete(BasicCompletionSession.kt:154) at org.jetbrains.kotlin.idea.completion.CompletionSession._complete(CompletionSession.kt:233) at org.jetbrains.kotlin.idea.completion.CompletionSession.complete(CompletionSession.kt:208) at org.jetbrains.kotlin.idea.completion.KotlinCompletionContributor.doComplete(KotlinCompletionContributor.kt:301) at org.jetbrains.kotlin.idea.completion.KotlinCompletionContributor.doComplete$default(KotlinCompletionContributor.kt:262) at org.jetbrains.kotlin.idea.completion.KotlinCompletionContributor.performCompletion(KotlinCompletionContributor.kt:255) at org.jetbrains.kotlin.idea.completion.KotlinCompletionContributor.access$performCompletion(KotlinCompletionContributor.kt:47) at org.jetbrains.kotlin.idea.completion.KotlinCompletionContributor$provider$1.addCompletions(KotlinCompletionContributor.kt:58) at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36) at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:151) at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81) at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:138) at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:131) at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$2.addCompletions(LiveTemplateCompletionContributor.java:88) at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36) at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:151) at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:81) at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:110) at com.intellij.codeInsight.completion.CompletionProgressIndicator.calculateItems(CompletionProgressIndicator.java:831) at com.intellij.codeInsight.completion.CompletionProgressIndicator.access$600(CompletionProgressIndicator.java:93) at com.intellij.codeInsight.completion.CompletionProgressIndicator$1CalculateItems.run(CompletionProgressIndicator.java:813) at com.intellij.codeInsight.completion.AsyncCompletion.lambda$null$0(CompletionThreading.java:108) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:931) at com.intellij.codeInsight.completion.AsyncCompletion.lambda$null$1(CompletionThreading.java:105) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:176) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:556) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163) at com.intellij.codeInsight.completion.AsyncCompletion.lambda$startThread$2(CompletionThreading.java:103) at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 2017-11-05 19:38:03,425 [ thread 19] ERROR - on.CompletionProgressIndicator - Android Studio 3.0 Build #AI-171.4408382 2017-11-05 19:38:03,425 [ thread 19] ERROR - on.CompletionProgressIndicator - JDK: 1.8.0_152-release 2017-11-05 19:38:03,425 [ thread 19] ERROR - on.CompletionProgressIndicator - VM: OpenJDK 64-Bit Server VM 2017-11-05 19:38:03,425 [ thread 19] ERROR - on.CompletionProgressIndicator - Vendor: JetBrains sro 2017-11-05 19:38:03,425 [ thread 19] ERROR - on.CompletionProgressIndicator - OS: Mac OS X 2017-11-05 19:38:03,425 [ thread 19] ERROR - on.CompletionProgressIndicator - Last Action: EditorBackSpace 2017-11-05 19:38:04,922 [ thread 19] ERROR - on.CompletionProgressIndicator - Resolver for 'completion/highlighting in org.jetbrains.kotlin.idea.caches.resolve.NotUnderContentRootModuleInfo@3a2816ac for files GameMainActivity.kt for platform JVM' does not know how to resolve ModuleProductionSourceInfo(module=Module: 'app') 

Я уже вызвал ошибку, которая, кажется, была отправлена ​​на JetBrains из Android Studio, однако я задаюсь вопросом, прошел ли кто-нибудь еще через это и нашел обходное решение, которое я могу попытаться на своем конце, чтобы мгновенно преодолеть эту ошибку, пока она не будет решена от JetBrains.

Эта ошибка, о которой вы сообщаете, была решена почти год назад, и это повлияло на старую версию плагина Kotlin: https://youtrack.jetbrains.com/issue/KT-12264

Попробуйте сделать недействительным кеш AS и перезагрузите его (File -> Invalidate Caches / Restart -> Invalidate Caches и Restart).

Проблема возникла из-за того, что я переименовал app / src / main / java в app / src / main / kotlin (поскольку Android Studio не делает этого сам, даже если проект был настроен на включение поддержки kotlin с нуля), а последний не был отмечен как исходная папка. Как только он был помечен как исходная папка, проблема немедленно устранена.