简体   繁体   English

java.lang.RuntimeException:Firestore 中的内部错误 (0.6.6-dev)

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

I am using FireStore in my application.我在我的应用程序中使用 FireStore。 and their version is implementation 'com.google.firebase:firebase-firestore:17.0.1'他们的版本是implementation 'com.google.firebase:firebase-firestore:17.0.1'

I am using database of Firestore and offline feature of firestore to get data.我正在使用Firestore数据库和Firestore offline feature of firestore来获取数据。

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?您是说在创建签名的 apk 后会发生这种情况吗?

Then try to add SHA1 or SHA256 of your signed app in firebase console然后尝试在 firebase 控制台中添加已签名应用的 SHA1 或 SHA256

and if you using objects to get data and using minifyEnabled true in gradle如果您使用对象获取数据并在 gradle 中使用 minifyEnabled true

then change your proguard file然后更改您的 proguard 文件

Try to add -keep class io.grpc.** {*;} to your proguard configuration.尝试将-keep class io.grpc.** {*;}到您的 proguard 配置中。 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 .我遇到了同样的问题,自从我将我的firestore依赖更新为超过 v16 It only happens on my release builds, specifically where debuggable has to be set to false .它只发生在我的发布版本中,特别是在debuggable必须设置为false 的情况下

I can confirm that the selected solution (of adding the following to the proguard config) did solve the crashes through.我可以确认所选的解决方案(将以下内容添加到 proguard 配置中)确实解决了崩溃问题。

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

Note Am Using Flutter, So this should work for Both Java/Kotlin Android and Flutter注意我正在使用 Flutter,所以这应该适用于 Java/Kotlin Android 和 Flutter

After spending several hours, I fix it by花了几个小时后,我修复了它

1 1

check if proguard-android.txt or proguard-rules.pro exist in Path yourproject/Android/app检查路径 yourproject/Android/app 中是否存在 proguard-android.txt 或 proguard-rules.pro

2 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如果它们存在,请复制下面的配置,如果它们不存在,请在我提到的路径中为它们创建包含相同名称(proguard-android.txt 和 proguard-rules.pro)的单独文件

3 (Config lines) 3(配置行)

   -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) 4(通过添加这一行让你的 myproject/Android/app/build.gradle 看到它们)

 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.清理您的项目并运行或生成您的 APK。

Good Luck!祝你好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.RuntimeException:更新Firestore版本后,Firestore(0.6.6-dev)中出现内部错误 - java.lang.RuntimeException: Internal error in Firestore (0.6.6-dev) after updating Firestore version Java.Lang.RuntimeException:Firestore (0.6.6-dev) 中的内部错误,无法在我的应用程序和 Firestore 项目之间连接 - Java.Lang.RuntimeException: Internal error in Firestore (0.6.6-dev), can't connect between my app and firestore project 尝试更新文档时 Firestore (0.6.6-dev) 中的内部错误 - Internal error in Firestore (0.6.6-dev) when trying to update document 由于GRPC和R8,Firestore(0.6.6-dev)中的内部错误 - Internal error in Firestore (0.6.6-dev) because of GRPC and R8 Firebase 应用内消息传递导致 java.lang.RuntimeException:Cloud Firestore 中的内部错误 (21.4.1) - Firebase In-App Messaging cause java.lang.RuntimeException: Internal error in Cloud Firestore (21.4.1) 如何解决“ java.lang.RuntimeException”错误 - how to resolve “java.lang.RuntimeException” error Android 应用程序 java.lang.RuntimeException 错误 - Android app java.lang.RuntimeException error Android:错误:java.lang.RuntimeException - Android: Error: java.lang.RuntimeException Jsoup 出现 java.lang.RuntimeException 错误 - java.lang.RuntimeException error with Jsoup Android java.lang.RuntimeException错误 - Android java.lang.RuntimeException error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM