FindBugs IDEA - ClassNotFoundException com.google.wireless.android.sdk.stats.IntellijIndexingStats
Asked Answered
S

9

78

FindBugs IDEA v1.0.1 Android Studio 3.4

I get this error when running FindBugs. I don't use com.google.wireless.android.sdk anywhere in the app.

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:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at com.intellij.util.indexing.counters.IndexCounters.<clinit>(IndexCounters.java:34)
    at com.intellij.util.indexing.impl.MapReduceIndex.<init>(MapReduceIndex.java:86)
    at org.jetbrains.jps.backwardRefs.index.CompilerReferenceIndex$CompilerMapReduceIndex.<init>(CompilerReferenceIndex.java:214)
    at org.jetbrains.jps.backwardRefs.index.CompilerReferenceIndex.<init>(CompilerReferenceIndex.java:73)
    at org.jetbrains.jps.backwardRefs.JavaCompilerBackwardReferenceIndex.<init>(JavaCompilerBackwardReferenceIndex.java:12)
    at org.jetbrains.jps.backwardRefs.JavaBackwardReferenceIndexWriter.initialize(JavaBackwardReferenceIndexWriter.java:74)
    at org.jetbrains.jps.backwardRefs.JavaBackwardReferenceIndexBuilder.buildStarted(JavaBackwardReferenceIndexBuilder.java:40)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:358)
    at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:178)
    at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138)
    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:229)
    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:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Shawndashawnee answered 25/4, 2019 at 7:34 Comment(7)
@Carlton Yes, I switched to spotbugs.Shawndashawnee
think it's this plugin; there's at least com.google.wireless.android.sdk.stats involved.Sheepdip
This error occurred for me after upgrading to Android Studio 3.4. Did you have a similar experience?Kelcie
The bug appeared when i switched to Android Studio 3.4Sensillum
related github issuesSullins
github.com/mapbox/store-locator-android/issues/27Sullins
github.com/spotbugs/spotbugs/issues/931Sullins
S
8

I think this may be the answer.

SpotBugs is the spiritual successor of FindBugs, carrying on from the point where it left off with support of its community.

The FindBugs Plugin

Since FindBugs is unmaintained and does not support bytecode compiled for Java 9 and above, the FindBugs plugin has been deprecated and is scheduled to be removed in Gradle 6.0. Please consider using the SpotBugs plugin instead.

You should have at least 512 MB of memory to use SpotBugs. To analyze very large projects, more memory may be needed.

Very important issue Unable to use Spotbugs in Android application.

Shawndashawnee answered 1/5, 2019 at 12:13 Comment(1)
I tried searching for SpotBugs in the Marketplace inside the settings dialog and nothing came back.Professed
B
43

To Solve this problem in Android Studio go to:

File
-> Settings
-> Build, Execution, Deployment
-> Compiler -> Java Compiler

Change javac to eclipse, and apply.

Biafra answered 31/12, 2019 at 19:42 Comment(4)
any explanation about that ?Ec
This is no longer an option on ASMurray
I tried this option in AS 4.0.1, the error gone but other appears: Error:Module 'MyModule' production: java.lang.NoClassDefFoundError: com/android/resources/ResourceFolderTypeDesiccator
on MacOS it's under Android Studio -> PreferencesBodnar
C
17

For what it's worth i got this exact error by importing a project started with IntelliJ Pro and imported into Android Studio - deleting the .idea directory at the root of the project and re-importing the project with Android Studio cleared it.

Cynde answered 28/10, 2019 at 14:44 Comment(0)
S
8

I think this may be the answer.

SpotBugs is the spiritual successor of FindBugs, carrying on from the point where it left off with support of its community.

The FindBugs Plugin

Since FindBugs is unmaintained and does not support bytecode compiled for Java 9 and above, the FindBugs plugin has been deprecated and is scheduled to be removed in Gradle 6.0. Please consider using the SpotBugs plugin instead.

You should have at least 512 MB of memory to use SpotBugs. To analyze very large projects, more memory may be needed.

Very important issue Unable to use Spotbugs in Android application.

Shawndashawnee answered 1/5, 2019 at 12:13 Comment(1)
I tried searching for SpotBugs in the Marketplace inside the settings dialog and nothing came back.Professed
R
4

open the FindBugs setting, click General,then close the "Compile affected files before analyze". It works for me with Android Studio 3.5

Reitz answered 20/9, 2019 at 2:23 Comment(0)
B
2

I got this error in Android Studio without running FindBugs.

I initially saw an IntelliJ post suggesting I disable compiler-based indexing in the IntelliJ registry to stop the error:

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)

However, I didn't want to settle for losing compiler-based indexing, after doing an Invalidate Caches / Restart..., I saw the following message:

Internal caches are corrupted or have outdated format, forcing project rebuild

That message led me to pdinklag's answer, which I modified slightly for Android Studio

I shut down Android Studio, then ran:

rm -rf ~/.android
rm -rf <PROJECT_ROOT>/.idea

Then restarted Android Studio, and things worked.

Balboa answered 28/10, 2019 at 22:5 Comment(0)
W
1

This removed the error for me:

File/Settings/Build, Execution, Deployment/Compiler

uncheck: Make project automatically

Waler answered 14/10, 2019 at 3:13 Comment(1)
Its worked for me, thanks. I'm use Android Studio 4.0National
D
0

Seems that FindBugs is not able to compile the files before analyze.

In Android Studio, go to FindBugs settings (found under File > Settings > Other Settings), and UNCHECK "Compile affected files before analyze".

When you do this, then you need to compile files yourself (by building and running the app, for example), or FindBugs analyze uses old file data (from the previous build).

Demisec answered 7/11, 2019 at 9:46 Comment(0)
S
-2

This solution is based on the assumption that You use Android Studio for Flutter and Android both. Each time I close Flutter project and open up Android project I need to configure android Sdk else it gives me this error:

Error:Internal error: (java.lang.ClassNotFoundException) 
com.google.wireless.android.sdk.stats.IntellijIndexingStats$Index

Simply go to the LogCat and Click on the "Please configure Android SDK" and select the latest Build Tools Version 28.0.3 I guess( or whatever is your latest build version) from the dropdown.

Sensillum answered 5/5, 2019 at 4:19 Comment(1)
This is weird: I found a page explaining Android Studio "Logcat" (developer.android.com/studio/debug/am-logcat) but it's not listed in View > Tool Windows > LogcatProfessed
C
-2

I faced similar error with JDK 1.8. The error was caused by a missing keystore file. Try generating new keystore using a keytool from JDK 12. This worked for me.

Also add some dependencies and maven repositories according to yout gradle version may be also need to AndroidAnnotations version:

4.3.1

Android compile SDK version:

25

Chaney answered 27/9, 2019 at 10:11 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.