Closed cyberpwnn closed 2 years ago
There are a lot of issues with flutterfire im having but this one will prevent me from being able to continue development, It happened all of the sudden without any changes to the project over a span of a few days.
@cyberpwnn
Looking at the error log you shared:
For This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
, Please see this related discussion thread.
For [cloud_firestore/unavailable] The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff.
, see this discussion thread.
Regarding Stream closed with status: Status{code=INTERNAL, description=error in frame handler, cause=java.lang.NoSuchMethodError: No interface method getBuffer()Lokio/Buffer; in class Lokio/BufferedSource; or its super classes (declaration of 'okio.BufferedSource' appears in /data/app/~~562CMs3V8mJAW5W-e8eBRQ==/care.mpm.app.myguide-vSZFTwtxrkRSO-SPz3Pd5g==/base.apk!classes5.dex) W/Firestore( 5850): at io.grpc.okhttp.OkHttpClientTransport$ClientFrameHandler.data(OkHttpClientTransport.java:1144)
these logs, it seems to be coming from okio libraray : https://square.github.io/okio/ and https://github.com/grpc/grpc-java/blob/master/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java
So I doubt if this is related to flutterfire's cloud_firestore
plugin. I suggest you to reach out to firebase support on this and see what they about this.
Well given that IOS & Web continue to work as they have on the same network at the same time using the same project & given i can use the android device to download files load web pages etc, It's either a flutterfire package or firebase itself, however given the majority of android-native firebase projects havent posted this im assuming it has to do with the recent flutterfire update.
Any help on this, very frustrating: W/Firestore( 7266): (24.1.1) [WatchStream]: (a29ad0c) Stream closed with status: Status{code=INTERNAL, description=error in frame handler, cause=java.lang.NoSuchMethodError: No interface method getBuffer()Lokio/Buffer; at io.grpc.okhttp.OkHttpClientTransport$ClientFrameHandler.data(OkHttpClientTransport.java:1144)
Yeah @darshankawar this is a sudden change after updating packages, its not a firebase thing, I don't know if it is specifically cloud_functions but it's one of the packages.
Older packages doesnt seem to fix it anymore, cleaning doesnt fix it. Can we please get an actual fix instead of questioning the internet connection or blaming it on another google project please?
Glad I'm not the only one! A fix/explanation/workaround would be very welcome indeed.
This prevents me from using firebase, need this fixed, wasnt a problem 5 days ago
I reached out to firebase support, though i've done this before, there's usually no reply.
See also this insight from from okio: https://github.com/square/okio/discussions/1114 Could be a version/packaging problem...
In android/app/build.gradle I have:
implementation platform('com.google.firebase:firebase-bom:29.3.1')
as per the documentation: https://firebase.google.com/docs/android/setup#add-sdks
As far as I can tell (not very far) from: https://mvnrepository.com/artifact/com.google.firebase/firebase-bom/29.3.1
the dependency chain goes like this:
com.google.firebase/firebase-bom: 29.3.1 => com.google.firebase/firebase-firestore: 24.1.1 => io.grpc/grpc-okhttp: 1.44.1 => com.squareup.okhttp/okhttp: 2.7.4 => com.squareup.okio/okio: 1.6.0
I did notice one dependency inequality (okhttp 2.7.4 <> 2.7.5): com.google.firebase/firebase-bom: 29.3.1 => com.squareup.okhttp/okhttp: 2.7.5 => com.squareup.okio/okio: 1.6.0
No idea. I'm hoping the flutterfire devs - or someone much smarter than me - will be able to help us out...
I used to do a lot of java dev with gradle, there's a way to basically force all transitive okio deps to be a specific version, but its dirty and im not even sure what eversion its supposed to be using. That and the flutterfire plugins use platform dependencies outside of the build.gradle so whatever solution we come up with will be changing things that shouldnt be changed. If they could just fix the problem that would be great lol.
Ok i've figured out a temporary solution. But this is a problem with firebase or flutterfire. They really need to fix their dependencies. Basically we're just changing the dependency versions as they get resolved even if the dependencies are in a subproject (say a firebase plugin)
configurations.all {
resolutionStrategy {
force 'com.squareup.okhttp:okhttp:2.7.5'
force 'com.squareup.okio:okio:1.17.5'
}
}
Note: Its not a good idea to lock dependencies like this but it should work for a while.
Firebase / Flutterfire devs: Please update your okio version to what GPRC uses (1.17.5)
Thanks for the update. Keeping it open and labeling it for further insights from the team.
/cc @russellwheatley
This needs to be resolved upstream at the level of the firebase-android-sdk. We didn't make any changes to Firestore in the last release, except for a dependency change to the latest firebase_core package which contains an update to the latest android firebase BOM.
I am facing the same problem since last few days.
I was facing the same issue because I was using older versions of firebase packages. Try updating your dependencies it worked for me.
We recently bumped android sdk to BOM version30.0.0
which might explain why this issue is resolved. @AbderraoufKhodja - can you confirm with the latest firebase_core
version this problem has been resolved?
@russellwheatley I have updated firebase_core package to it's latest version. Still facing the same issue. Disabling minifyEnabled and shrinkResources seems to temporarily solve the problem. It's worth noting that the issue started only after I added a video streaming SDK which increased the package size significantly. Before that, it was working fine with minifyEnabled and shrinkResources enabled.
The fix suggested by cyberpwnn does work
The temporary fix from @cyberpwnn worked. But flutter devs needs to fix this asap
Hey @cyberpwnn. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Still facing this issue.
Facing this issue
Hey @cyberpwnn. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
I was able to resolve this issue by removing another package (google_ml_vision: ^0.0.7) which was causing a dependency conflict and forcing firestore to use outdated networking code.
Hey @cyberpwnn. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Since there haven't been any recent updates here, I am going to close this issue.
@cyberpwnn if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.
Ok i've figured out a temporary solution. But this is a problem with firebase or flutterfire. They really need to fix their dependencies. Basically we're just changing the dependency versions as they get resolved even if the dependencies are in a subproject (say a firebase plugin)
- Open your app/build.gradle (the inner one)
- Add this block above your dependencies block
configurations.all { resolutionStrategy { force 'com.squareup.okhttp:okhttp:2.7.5' force 'com.squareup.okio:okio:1.17.5' } }
Note: Its not a good idea to lock dependencies like this but it should work for a while.
Firebase / Flutterfire devs: Please update your okio version to what GPRC uses (1.17.5)
it's realy help me, thanks for saving my 3 days debuging time.
Please. Open error persists.
Bug report
Describe the bug
This started happening yesterday for me, updating firebase packages did not help.
Then later after the above error happens enough times to trigger offline
Steps to reproduce
Steps to reproduce the behavior:
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
``` [β] Flutter (Channel stable, 2.10.4, on macOS 12.3.1 21E258 darwin-arm, locale en-US) β’ Flutter version 2.10.4 at /Users/danielmills/development/flutter β’ Upstream repository https://github.com/flutter/flutter.git β’ Framework revision c860cba910 (4 weeks ago), 2022-03-25 00:23:12 -0500 β’ Engine revision 57d3bac3dd β’ Dart version 2.16.2 β’ DevTools version 2.9.2 [β] Android toolchain - develop for Android devices (Android SDK version 32.0.0) β’ Android SDK at /Users/danielmills/Library/Android/sdk β’ Platform android-32, build-tools 32.0.0 β’ Java binary at: /Users/danielmills/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/211.7628.21.2111.8309675/Android Studio.app/Contents/jre/Contents/Home/bin/java β’ Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763) β’ All Android licenses accepted. [β] Xcode - develop for iOS and macOS (Xcode 13.3) β’ Xcode at /Applications/Xcode.app/Contents/Developer β’ CocoaPods version 1.11.3 [β] Chrome - develop for the web β’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [β] Android Studio (version 2020.3) β’ Android Studio at /Applications/Android Studio.app/Contents β’ Flutter plugin can be installed from: π¨ https://plugins.jetbrains.com/plugin/9212-flutter β’ Dart plugin can be installed from: π¨ https://plugins.jetbrains.com/plugin/6351-dart β’ Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189) [β] Android Studio (version 2021.1) β’ Android Studio at /Users/danielmills/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/211.7628.21.2111.8309675/Android Studio.app/Contents β’ Flutter plugin can be installed from: π¨ https://plugins.jetbrains.com/plugin/9212-flutter β’ Dart plugin can be installed from: π¨ https://plugins.jetbrains.com/plugin/6351-dart β’ Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763) [β] Android Studio (version 2021.1) β’ Android Studio at /Users/danielmills/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/211.7628.21.2111.8193401/Android Studio.app/Contents β’ Flutter plugin can be installed from: π¨ https://plugins.jetbrains.com/plugin/9212-flutter β’ Dart plugin can be installed from: π¨ https://plugins.jetbrains.com/plugin/6351-dart β’ Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763) [β] IntelliJ IDEA Ultimate Edition (version 2022.1) β’ IntelliJ at /Users/danielmills/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app β’ Flutter plugin version 66.0.4 β’ Dart plugin version 221.5480 [β] IntelliJ IDEA Ultimate Edition (version 2022.1) β’ IntelliJ at /Users/danielmills/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/221.5080.210/IntelliJ IDEA 2022.1 EAP.app β’ Flutter plugin can be installed from: π¨ https://plugins.jetbrains.com/plugin/9212-flutter β’ Dart plugin can be installed from: π¨ https://plugins.jetbrains.com/plugin/6351-dart [β] IntelliJ IDEA Ultimate Edition (version 2021.3.3) β’ IntelliJ at /Users/danielmills/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/213.7172.25/IntelliJ IDEA.app β’ Flutter plugin can be installed from: π¨ https://plugins.jetbrains.com/plugin/9212-flutter β’ Dart plugin can be installed from: π¨ https://plugins.jetbrains.com/plugin/6351-dart [β] VS Code (version 1.66.2) β’ VS Code at /Applications/Visual Studio Code.app/Contents β’ Flutter extension version 3.38.1 [β] Connected device (3 available) β’ IN2017 (mobile) β’ 2e01d742 β’ android-arm64 β’ Android 11 (API 30) β’ Danβs Phone (mobile) β’ 00008101-001818940228001E β’ ios β’ iOS 15.4.1 19E258 β’ Chrome (web) β’ chrome β’ web-javascript β’ Google Chrome 100.0.4896.127 ! Error: Danβs Phone is busy: Fetching debug symbols for Danβs Phone. Xcode will continue when Danβs Phone is finished. (code -10) [β] HTTP Host Availability β’ All required HTTP hosts are available β’ No issues found! ```Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
``` firebase_core: ^1.15.0 firebase_storage: ^10.2.13 firebase_crashlytics: ^2.6.3 firebase_database: ^9.0.12 firebase_messaging: ^11.2.14 firebase_remote_config: ^2.0.5 firebase_performance: ^0.8.0+10 firebase_analytics: ^9.1.6 firebase_auth: ^3.3.15 cloud_functions: ^3.2.13 cloud_firestore: ^3.1.13 ```