Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.RuntimeException: Internal error in Firestore (0.6.6-dev)

I am using FireStore in my application. and their version is implementation 'com.google.firebase:firebase-firestore:17.0.1'

I am using database of Firestore and offline feature of firestore to get data.

this is working fine but when i sign the application that time i am getting below bug.

   E/AndroidRuntime: FATAL EXCEPTION: main
   Process: com.firestoretest.videostatus, PID: 13763
   java.lang.RuntimeException: Internal error in Firestore (0.6.6-dev).
       at bov.b(Unknown Source:19)
       at box.run(Unknown Source:2)
       at android.os.Handler.handleCallback(Handler.java:789)
       at android.os.Handler.dispatchMessage(Handler.java:98)
       at android.os.Looper.loop(Looper.java:172)
       at android.app.ActivityThread.main(ActivityThread.java:6637)
       at java.lang.reflect.Method.invoke(Native Method)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
    Caused by: java.lang.ExceptionInInitializerError
       at cbh.<clinit>(Unknown Source:20)
       at ced.b(Unknown Source:0)
       at cee.b(Unknown Source:0)
       at cee.a(Unknown Source:0)
       at car.a(Unknown Source:4)
       at bod.<init>(Unknown Source:22)
       at bjo.a(Unknown Source:87)
       at bjq.run(Unknown Source:8)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
       at bov$a.run(Unknown Source:15)
       at java.lang.Thread.run(Thread.java:764)
    Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Package.getImplementationVersion()' on a null object reference
       at cco.b(Unknown Source:6)
       at cco.<clinit>(Unknown Source:137)
       at cbh.<clinit>(Unknown Source:20) 
       at ced.b(Unknown Source:0) 
       at cee.b(Unknown Source:0) 
       at cee.a(Unknown Source:0) 
       at car.a(Unknown Source:4) 
       at bod.<init>(Unknown Source:22) 
       at bjo.a(Unknown Source:87) 
       at bjq.run(Unknown Source:8) 
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457) 
       at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) 
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 
       at bov$a.run(Unknown Source:15) 
       at java.lang.Thread.run(Thread.java:764)

Please anyone have any idea about this error then please inform me. Thanks in Advance.

like image 948
ankur bhut Avatar asked Jan 27 '23 23:01

ankur bhut


2 Answers

Try to add -keep class io.grpc.** {*;} to your proguard configuration. It should work. There haven't been any crashes since I added it. Will be testing further.

like image 60
Alexey Avatar answered Jan 31 '23 20:01

Alexey


Note Am Using Flutter, So this should work for Both Java/Kotlin Android and Flutter

After spending several hours, I fix it by

1

check if proguard-android.txt or proguard-rules.pro exist in Path yourproject/Android/app

2

If they exist, copy below config, If they do not, create seperate files for them including that same name (proguard-android.txt and proguard-rules.pro) at the Path i mentioned

3 (Config lines)

   -keep class io.grpc.** {*;}
-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

Paste that above code inside the two files.

4 (Let your myproject/Android/app/build.gradle see them by adding this line)

 buildTypes {
    release {
        // TODO: Add your own signing config for the release build.
        // Signing with the debug keys for now, so `flutter run --release` works.
        signingConfig signingConfigs.release //If in debug, change release to debug

        minifyEnabled true
        useProguard true
        shrinkResources true

        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' //I add this line...
    }
}

Clean your project and run or generate your APK.

like image 29
SilenceCodder Avatar answered Jan 31 '23 19:01

SilenceCodder