简体   繁体   中英

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.

Are you saying this happen after creating signed apk?

Then try to add SHA1 or SHA256 of your signed app in firebase console

and if you using objects to get data and using minifyEnabled true in gradle

then change your proguard file

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.

I had the same issue, ever since I updated my firestore dependency to be over v16 . It only happens on my release builds, specifically where debuggable has to be set to false .

I can confirm that the selected solution (of adding the following to the proguard config) did solve the crashes through.

-keep class io.grpc.** {*;}

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.

Good Luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM