Visible to All Users IDEA-221848 Created by David Blanc 4 months ago Updated by Quinton Hoole 3 months ago
When I try to see code coverage, Android Studio fails with an exception

When I try to see code coverage, Android Studio fails with an exception

1

When I run my Unit Tests in Intellij IDEA CE 2019.1 or Android Studio 3.5 to check my code coverage, when the tests end and the coverage report is about to be displayed, I get a popup telling me that my project class files are out of date and project needs recompiling. Canceling closes the coverage view. On IntelliJ, the popup shows a second time if I accept it and no coverage data is displayed. On Android Studio, accepting leads to the report. But when clicking on one of the classes in the report to see the actual coverage in the file, a stacktrace appears in the message console:

Error:Internal error: (java.lang.ClassNotFoundException) com.google.wireless.android.sdk.stats.IntellijIndexingStats$Index
java.lang.ClassNotFoundException: com.google.wireless.android.sdk.stats.IntellijIndexingStats$Index
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.intellij.util.indexing.counters.IndexCounters.(IndexCounters.java:34)
at com.intellij.util.indexing.impl.MapReduceIndex.(MapReduceIndex.java:85)
at org.jetbrains.jps.backwardRefs.index.CompilerReferenceIndex$CompilerMapReduceIndex.(CompilerReferenceIndex.java:232)
at org.jetbrains.jps.backwardRefs.index.CompilerReferenceIndex.(CompilerReferenceIndex.java:79)
at org.jetbrains.jps.backwardRefs.JavaCompilerBackwardReferenceIndex.(JavaCompilerBackwardReferenceIndex.java:12)
at org.jetbrains.jps.backwardRefs.JavaBackwardReferenceIndexWriter.initialize(JavaBackwardReferenceIndexWriter.java:79)
at org.jetbrains.jps.incremental.java.JavaBuilder.buildStarted(JavaBuilder.java:148)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:363)
at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:178)
at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:139)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:302)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:135)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:228)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42)
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:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

And I can't visualize what is covered or not.

My project is available on github: https://github.com/speekha/httpmocker. Tests are in the "tests" module.

Activity settings
Quinton Hoole commented 10 Sep 2019 04:01

Never mind. I located the Registry (cmd+alt+shit+/ on mac), set compiler.ref.index = false to disable indexing, and am able to proceed now. Thanks Dmitry.

Quinton Hoole commented 10 Sep 2019 03:48

I get the same exception whenever starting up Android Studio 3.5. During the indexing phase (which happens automatically on startup) that exception is thrown.
@Dmitry.Antipov.Batkovich it's not clear to me how to find the Registry you refer to. I'm on a Mac.

David Blanc commented 9 Sep 2019 14:57

I just tried that in intellij and in Android studio, but I'm not convinced it made much of a difference.

Dmitry Batkovich commented 5 Sep 2019 11:56

@David Blanc as a workaround for the exception you may set compiler.ref.index = false in Registry (ctrl+alt-shift+/ or via "find action by name" action)

Dmitry Batkovich commented 5 Sep 2019 10:57

@Dmitry Avdeev AS has modified source code of MapReduceIndex. And now this exception is thrown everywhere where indexes is used outside FileBasedIndex scope.

Dmitry Batkovich commented 5 Sep 2019 10:55

@Anna Kozlova don't look at the exception above. It doesn't related to IJ, only for AS.

Project IntelliJ IDEA
Priority Normal N
Type Bug
State Submitted
Assignee Anna Kozlova
Subsystem Java. Code Coverage
Fixed in builds No Fixed in build
Fix versions No Fix versions
Affected versions No Affected versions
Spent time ?
Tester No tester
Verified No
Triaged Yes
User Agreement