2

I tried generating signed apk for my Flutter application using Android Studio in Windows and got the error:

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)

But I can create signed apk for my native(Java) android app without any errors. I then tried generating the apk using linux and it worked perfectly. What is causing this error?

bimsina
  • 414
  • 5
  • 12

3 Answers3

1

It got the same issue, I tried to use firebase_messaging but after that I decided to not use firebase_messaging so I removed the plugins and all but I forgot to remove it from gradle file at that time I got the same issue .. which I fixed like this...

Cross check all the services your are using with the one added in gradle... And remove the unused lines or dependencies .... This might solve the issue.

R P S Naik
  • 11
  • 1
  • 1
    I tried everything you said yet the error won't go away. But I found a way to generate signed apk from command prompt. – bimsina Jul 24 '19 at 07:15
  • 1
    @ÁlvaroAgüero I followed this tutorial : flutter.dev/docs/deployment/android and paste your .jks inside /android/app/ and in place of storeFile in key.properties just enter your key_name.jks – bimsina Jul 29 '19 at 06:18
  • @bimsina thanks I was able to get the bundle but not the apk, I feel that they have to fix many things even on flutter – Álvaro Agüero Jul 29 '19 at 13:27
0

Try to check your key.properties file if it has correct key credentials and path

For Example

storePassword=pass
keyPassword=pass
keyAlias=key0
storeFile=A:\\{Your Path}\\BongoFlix\\key.jks

and then from Build>Flutter>Build APK it will generate a signed APK

Read more here about release versions https://flutter.dev/docs/deployment/android to setup your gradle correctly

James Christian Kaguo
  • 1,251
  • 15
  • 14
-2

android studio is a total DIASTER since it moved to IntelliJ... this tools is totally untested junk

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

all the time

  • Please do not answer with a comment/question. Understandably, your rep is too low to comment, but that still does not mean answers should be used to make comments as an alternative. It would be preferable if you deleted this. – Dodge Jul 24 '19 at 03:28