0

I think my issue is because of Cloudfirestore that I am using inside my application. Some devices crash and some not.( S7 samsung verizon android 8.0 crashed, A5 samsung android 6.0 did not crash...). I used logcat to get the logs that are causing the crash and this is the error:

java.lang.RuntimeException: Internal error in Firestore (0.6.6-dev).
        at com.google.firebase.firestore.obfuscated.zzgf.zzb(com.google.firebase:firebase-firestore@@17.1.1:377)
        at com.google.firebase.firestore.obfuscated.zzgk.run(com.google.firebase:firebase-firestore@@17.1.1)
        at android.os.Handler.handleCallback(Handler.java:725)
        at android.os.Handler.dispatchMessage(Handler.java:92)
        at android.os.Looper.loop(Looper.java:176)
        at android.app.ActivityThread.main(ActivityThread.java:5302)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
        at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.RuntimeException: io.grpc.ManagedChannelProvider$ProviderNotFoundException: No functional channel service provider found. Try adding a dependency on the grpc-okhttp or grpc-netty artifact
        at com.google.firebase.firestore.obfuscated.zzgf.zza(com.google.firebase:firebase-firestore@@17.1.1:288)
        at com.google.firebase.firestore.obfuscated.zzgi.run(com.google.firebase:firebase-firestore@@17.1.1)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
        at java.util.concurrent.FutureTask.run(FutureTask.java:234)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:153)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
        at com.google.firebase.firestore.obfuscated.zzgf$zza.run(com.google.firebase:firebase-firestore@@17.1.1:203)
        at java.lang.Thread.run(Thread.java:856)
     Caused by: io.grpc.ManagedChannelProvider$ProviderNotFoundException: No functional channel service provider found. Try adding a dependency on the grpc-okhttp or grpc-netty artifact
        at io.grpc.ManagedChannelProvider.provider(ManagedChannelProvider.java:60)
        at io.grpc.ManagedChannelBuilder.forTarget(ManagedChannelBuilder.java:70)
        at com.google.firebase.firestore.obfuscated.zzfk.<init>(com.google.firebase:firebase-firestore@@17.1.1:101)
        at com.google.firebase.firestore.obfuscated.zzm.zza(com.google.firebase:firebase-firestore@@17.1.1:1216)
        at com.google.firebase.firestore.obfuscated.zzt.run(com.google.firebase:firebase-firestore@@17.1.1)
        at com.google.firebase.firestore.obfuscated.zzgf.zzc(com.google.firebase:firebase-firestore@@17.1.1:309)
        at com.google.firebase.firestore.obfuscated.zzgj.call(com.google.firebase:firebase-firestore@@17.1.1)
        at com.google.firebase.firestore.obfuscated.zzgf.zza(com.google.firebase:firebase-firestore@@17.1.1:285)
        at com.google.firebase.firestore.obfuscated.zzgi.run(com.google.firebase:firebase-firestore@@17.1.1) 
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:234) 
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:153) 
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
        at com.google.firebase.firestore.obfuscated.zzgf$zza.run(com.google.firebase:firebase-firestore@@17.1.1:203) 
        at java.lang.Thread.run(Thread.java:856) 

so how to resolve such an error in flutter ??

4
  • Update your Gradle dependencies. Firestore is at 17.1.5 now and I bet others are outdated too. Commented Jan 11, 2019 at 20:12
  • Make sure you have registered the release API key
    – Barns
    Commented Jan 11, 2019 at 20:19
  • @TheWanderer I know that I should update it but where to update it? Commented Jan 11, 2019 at 20:22
  • @Brans I jave registered my key but I want to update my gradle.how to do so ? Commented Jan 11, 2019 at 20:24

2 Answers 2

4

Had the same issue with some phones like Samsung S5. The app started crashing when I tried to open it. Here is a fix that worked for me:

defaultConfig {
    ...
    multiDexEnabled true
    ndk {
        abiFilters 'x86', 'armeabi-v7a'
    }
}

Had to add ndk in android/app/build.gradle file and it worked like a charm.

I hope this can help someone.

0
0

you should check first if you have installed the latest cloud_firestore package (0.8.2+3) in your pubspec.yaml

you can upgrade the google services under <yourapp>/android/build.gradle (current version 4.2.0). But be aware that you maybe need to upgrade the other plugins as well to the newest version there.

5
  • Do you have a list that show the gradle version and its corresponding compatible google plugin Commented Jan 11, 2019 at 23:05
  • I already have the latest version of cloud firestore but the problem still persists, can this be because of grpc error appearing in the logcat I have provided up Commented Jan 11, 2019 at 23:09
  • Try adding a dependency on the grpc-okhttp or grpc-netty artifact , maybe this Commented Jan 11, 2019 at 23:10
  • where have you added the dependency for grpc? into your gradle file under android or android/app/ ?
    – Knupper
    Commented Jan 11, 2019 at 23:14
  • I did not add it anywhere. Where should I add it? Commented Jan 12, 2019 at 12:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.