Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Firestore] Could not reach Cloud Firestore backend over Wifi on physical device. #2753

Closed
mlemos opened this issue Jun 12, 2020 · 38 comments
Closed
Labels
plugin: cloud_firestore resolution: user This was a user issue, e.g. invalid configuration or code. type: bug Something isn't working

Comments

@mlemos
Copy link

mlemos commented Jun 12, 2020

Describe the bug
When trying to get a document from Firestore, if the device is connected through Wifi the connection fails with the following error message:

W/Firestore( 4903): (21.4.3) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds
W/Firestore( 4903): 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.

To Reproduce

Usually, the error happens when running in a Physical device.
I created a small app to be able to reproduce the errors with minimal interference from the rest my code. See the code below.

When you hit run on the debugger (I'm using VSCode) and then I click on the (+) button to make the request to Firestore, it stays trying for a few seconds (you'll see the progress indicator no the test app) and then the call snapshot = await docRef.get() fails with the following error message:

PlatformException(Error performing get, Failed to get document because the client is offline., null)

Then, if you turn the wifi off, the request works perfectly. And the content of the document retrieved from Firestore is present in the screen:

Now if you turn the wifi again, the request works. Sometimes the data is retrieved from the server and other from the cache.

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Firestore Network Bug',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  bool _loading = false;
  Map<String, dynamic> _firebaseDocument;
  String _firebaseError;
  String _source;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Firestore Network Bug"),
      ),
      body: Padding(
        padding: const EdgeInsets.all(24),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          children: <Widget>[
            Text('Tap the (+) button to try to read from Firestore...',
                style: TextStyle(fontSize: 20)),
            _showProgress(),
            _showResults(),
            _showErrors(),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _readFromFirebase,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }

  Widget _showProgress() {
    return Padding(
      padding: const EdgeInsets.only(top: 12.0),
      child: Container(
        height: 6.0,
        child: (_loading) ? LinearProgressIndicator() : Container(),
      ),
    );
  }

  Widget _showResults() {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        SizedBox(height: 12.0),
        Text("Result:"),
        Container(
          height: 150,
          padding: const EdgeInsets.all(16),
          color: Colors.blue[100],
          child: (_firebaseDocument != null)
              ? Text("From $_source: \n\n" + _firebaseDocument?.toString(),
                  style: TextStyle(fontSize: 16))
              : Container(),
        ),
      ],
    );
  }

  Widget _showErrors() {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        SizedBox(height: 12.0),
        Text("Errors:"),
        Container(
          height: 150,
          padding: const EdgeInsets.all(16),
          color: Colors.red[100],
          child: (_firebaseError != null)
              ? Text(_firebaseError?.toString(), style: TextStyle(fontSize: 16))
              : Container(),
        ),
      ],
    );
  }

  void _readFromFirebase() async {
    setState(() {
      _loading = true;
      _firebaseDocument = null;
      _firebaseError = null;
    });
    DocumentReference docRef =
        Firestore.instance.document("myCollection/myDocument");

    DocumentSnapshot snapshot = await docRef.get().catchError(
      (onError) {
        setState(() {
          _loading = false;
          _firebaseDocument = null;
          _firebaseError = onError.toString();
        });
      },
    );
    if (_firebaseError != null) return;

    _source = (snapshot.metadata.isFromCache) ? "cache" : "server";

    if (snapshot.exists) {
      setState(() {
        _loading = false;
        _firebaseDocument = snapshot.data;
      });
      print("Document found!");
      print("- ${_firebaseDocument.toString()}");
    } else {
      print("Document not found!");
    }
  }
}

Expected behavior
Since the device has perfect connectivity over wifi, it was excepted that the request worked fine and the document was retrieved from the server.

Additional context
On the emulator, everything works perfectly.
I tested in the following emulator configurations: Pixel 4 API 29, Pixel 5 API 25, Pixel 3 API 29.

The physical devices I used to test (both failed identically) where: Pixel 4XL (Android 10 QQ3Q.200605.001) and Pixel 3XL (Android 10 QQ2A.200305.002).

Flutter doctor

[✓] Flutter (Channel stable, v1.17.3, on Mac OS X 10.15.4 19E287, locale en-US)
    • Flutter version 1.17.3 at /Users/mlemos/Documents/flutter
    • Framework revision b041144f83 (8 days ago), 2020-06-04 09:26:11 -0700
    • Engine revision ee76268252
    • Dart version 2.8.4

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/mlemos/Library/Android/sdk
    • Platform android-30, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.5, Build version 11E608c
    • CocoaPods version 1.9.1

[!] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.46.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.11.0

[✓] Connected device (2 available)
    • Pixel 4 XL                • 99201FFBA000KF • android-arm64 • Android 10 (API 29)
    • Android SDK built for x86 • emulator-5554  • android-x86   • Android 7.1.1 (API 25) (emulator)

! Doctor found issues in 1 category.

pubspec.yaml

name: firestore_network_bug
description: A new Flutter project.
publish_to: 'none' 
version: 1.0.0+1
environment:
  sdk: ">=2.7.0 <3.0.0"
dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^0.1.3
  firebase_analytics: ^5.0.14
  cloud_firestore: ^0.13.6
dev_dependencies:
  flutter_test:
    sdk: flutter
flutter:
  uses-material-design: true

/build.gradle

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // Application specific configuration (dependencies)
        classpath 'com.google.gms:google-services:4.3.3'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

/app/build.gradle

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
// Application specific configuration (plugins)
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'


android {
    compileSdkVersion 28

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        applicationId "com.example.firestore_network_bug"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        // Application specific configuration (multidex)
        multiDexEnabled true

    }

    buildTypes {
        release {
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

    // Application specific configuration (dependencies)
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.google.firebase:firebase-analytics:17.2.2'
    implementation 'com.google.firebase:firebase-crashlytics:17.0.0'
    implementation 'com.google.firebase:firebase-firestore:21.4.3'
}
@mlemos
Copy link
Author

mlemos commented Jun 12, 2020

Here is the debug console output:

Over Wifi - When the error happens

Please note that, over Wifi, Crashlytics also fails.

Launching lib/main.dart on Pixel 4 XL in debug mode...
✓ Built build/app/outputs/apk/debug/app-debug.apk.
Connecting to VM Service at ws://127.0.0.1:54122/cahgKkWqnBU=/ws
E/FirebaseCrashlytics(22411): Settings request failed.
E/FirebaseCrashlytics(22411): java.io.InterruptedIOException: timeout
E/FirebaseCrashlytics(22411): 	at okhttp3.RealCall.timeoutExit(RealCall.java:107)
E/FirebaseCrashlytics(22411): 	at okhttp3.RealCall.execute(RealCall.java:96)
E/FirebaseCrashlytics(22411): 	at com.google.firebase.crashlytics.internal.network.HttpRequest.execute(com.google.firebase:firebase-crashlytics@@17.0.0:129)
E/FirebaseCrashlytics(22411): 	at com.google.firebase.crashlytics.internal.settings.network.DefaultSettingsSpiCall.invoke(com.google.firebase:firebase-crashlytics@@17.0.0:86)
E/FirebaseCrashlytics(22411): 	at com.google.firebase.crashlytics.internal.settings.SettingsController$1.then(com.google.firebase:firebase-crashlytics@@17.0.0:200)
E/FirebaseCrashlytics(22411): 	at com.google.firebase.crashlytics.internal.settings.SettingsController$1.then(com.google.firebase:firebase-crashlytics@@17.0.0:193)
E/FirebaseCrashlytics(22411): 	at com.google.android.gms.tasks.zzp.run(Unknown Source:2)
E/FirebaseCrashlytics(22411): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/FirebaseCrashlytics(22411): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FirebaseCrashlytics(22411): 	at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(com.google.firebase:firebase-crashlytics@@17.0.0:60)
E/FirebaseCrashlytics(22411): 	at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(com.google.firebase:firebase-crashlytics@@17.0.0:27)
E/FirebaseCrashlytics(22411): 	at java.lang.Thread.run(Thread.java:919)
E/FirebaseCrashlytics(22411): Caused by: java.io.IOException: Canceled
E/FirebaseCrashlytics(22411): 	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
E/FirebaseCrashlytics(22411): 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
E/FirebaseCrashlytics(22411): 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
E/FirebaseCrashlytics(22411): 	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254)
E/FirebaseCrashlytics(22411): 	at okhttp3.RealCall.execute(RealCall.java:92)
E/FirebaseCrashlytics(22411): 	... 10 more
W/DynamiteModule(22411): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(22411): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(22411): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
I/ore_network_bu(22411): The ClassLoaderContext is a special shared library.
I/chatty  (22411): uid=10227(com.example.firestore_network_bug) AsyncTask #1 identical 1 line
I/ore_network_bu(22411): The ClassLoaderContext is a special shared library.
W/ore_network_bu(22411): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(22411): Accessing hidden method Lsun/misc/Unsafe;->arrayBaseOffset(Ljava/lang/Class;)I (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(22411): Accessing hidden method Lsun/misc/Unsafe;->copyMemory(JJJ)V (greylist, linking, allowed)
W/ore_network_bu(22411): Accessing hidden method Lsun/misc/Unsafe;->objectFieldOffset(Ljava/lang/reflect/Field;)J (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(22411): Accessing hidden method Lsun/misc/Unsafe;->getByte(J)B (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(22411): Accessing hidden method Lsun/misc/Unsafe;->getByte(Ljava/lang/Object;J)B (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(22411): Accessing hidden method Lsun/misc/Unsafe;->getLong(J)J (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(22411): Accessing hidden method Lsun/misc/Unsafe;->putByte(JB)V (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(22411): Accessing hidden method Lsun/misc/Unsafe;->putByte(Ljava/lang/Object;JB)V (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(22411): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
W/ore_network_bu(22411): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
W/ore_network_bu(22411): Accessing hidden field Ljava/nio/Buffer;->address:J (greylist, reflection, allowed)
V/NativeCrypto(22411): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 286 native methods...
W/ore_network_bu(22411): Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (greylist, reflection, allowed)
I/ProviderInstaller(22411): Installed default security provider GmsCore_OpenSSL
W/Firestore(22411): (21.4.3) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds
W/Firestore(22411):
W/Firestore(22411): 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.
W/DynamiteModule(22411): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(22411): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(22411): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
W/DynamiteModule(22411): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(22411): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(22411): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
W/DynamiteModule(22411): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(22411): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(22411): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
W/DynamiteModule(22411): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(22411): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(22411): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
W/DynamiteModule(22411): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(22411): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(22411): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
W/DynamiteModule(22411): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(22411): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(22411): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.

Over LTE - When things work fine

Launching lib/main.dart on Pixel 4 XL in debug mode...
✓ Built build/app/outputs/apk/debug/app-debug.apk.
Connecting to VM Service at ws://127.0.0.1:54345/egB1v0JRe6c=/ws
W/DynamiteModule(23529): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(23529): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(23529): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
I/ore_network_bu(23529): The ClassLoaderContext is a special shared library.
I/chatty  (23529): uid=10227(com.example.firestore_network_bug) AsyncTask #1 identical 1 line
I/ore_network_bu(23529): The ClassLoaderContext is a special shared library.
W/ore_network_bu(23529): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(23529): Accessing hidden method Lsun/misc/Unsafe;->arrayBaseOffset(Ljava/lang/Class;)I (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(23529): Accessing hidden method Lsun/misc/Unsafe;->copyMemory(JJJ)V (greylist, linking, allowed)
W/ore_network_bu(23529): Accessing hidden method Lsun/misc/Unsafe;->objectFieldOffset(Ljava/lang/reflect/Field;)J (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(23529): Accessing hidden method Lsun/misc/Unsafe;->getByte(J)B (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(23529): Accessing hidden method Lsun/misc/Unsafe;->getByte(Ljava/lang/Object;J)B (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(23529): Accessing hidden method Lsun/misc/Unsafe;->getLong(J)J (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(23529): Accessing hidden method Lsun/misc/Unsafe;->putByte(JB)V (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(23529): Accessing hidden method Lsun/misc/Unsafe;->putByte(Ljava/lang/Object;JB)V (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(23529): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
W/ore_network_bu(23529): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
W/ore_network_bu(23529): Accessing hidden field Ljava/nio/Buffer;->address:J (greylist, reflection, allowed)
V/NativeCrypto(23529): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 286 native methods...
W/ore_network_bu(23529): Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (greylist, reflection, allowed)
I/ProviderInstaller(23529): Installed default security provider GmsCore_OpenSSL
W/ore_network_bu(23529): Accessing hidden field Ljava/net/Socket;->impl:Ljava/net/SocketImpl; (greylist, reflection, allowed)
W/ore_network_bu(23529): Accessing hidden field Ljava/io/FileDescriptor;->descriptor:I (greylist, JNI, allowed)
W/ore_network_bu(23529): Accessing hidden method Ljava/security/spec/ECParameterSpec;->setCurveName(Ljava/lang/String;)V (greylist, reflection, allowed)
W/ore_network_bu(23529): Accessing hidden method Ldalvik/system/BlockGuard;->getThreadPolicy()Ldalvik/system/BlockGuard$Policy; (greylist,core-platform-api, linking, allowed)
W/ore_network_bu(23529): Accessing hidden method Ldalvik/system/BlockGuard$Policy;->onNetwork()V (greylist, linking, allowed)
I/flutter (23529): Document found!
I/flutter (23529): - {date: Timestamp(seconds=1590980400, nanoseconds=0), published: true, title: Hello World!, body: Firebase rocks and Firestore rocks also (when it works).}

@Ehesp
Copy link
Member

Ehesp commented Jun 15, 2020

I highly doubt this is an issue with FlutterFire, since it has no impact on how the native SDKs handle online/offline state.

@TahaTesser
Copy link

Hi @mlemos
I followed your steps and code sample, it loads document initially with no issues.
Please try another device or emulator and device know

flutter_01

flutter doctor -v
[✓] Flutter (Channel dev, 1.20.0-0.0.pre, on Mac OS X 10.15.5 19F101, locale
    en-GB)
    • Flutter version 1.20.0-0.0.pre at /Users/tahatesser/Code/flutter_dev
    • Framework revision d9653445f4 (6 days ago), 2020-06-09 18:43:03 -0400
    • Engine revision e8c13aa012
    • Dart version 2.9.0 (build 2.9.0-14.0.dev 5c1376615e)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
    • Android SDK at /Users/tahatesser/Code/sdk
    • Platform android-30, build-tools 30.0.0
    • ANDROID_HOME = /Users/tahatesser/Code/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.5, Build version 11E608c
    • CocoaPods version 1.9.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 46.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.46.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.11.0

[✓] Connected device (5 available)
    • SM M305F      • 32003c30dc19668f          • android-arm64  • Android 10 (API 29)
    • Taha’s iPhone • 00008020-001059882212002E • ios            • iOS 13.5.1
    • macOS         • macOS                     • darwin-x64     • Mac OS X 10.15.5 19F101
    • Web Server    • web-server                • web-javascript • Flutter Tools
    • Chrome        • chrome                    • web-javascript • Google Chrome 83.0.4103.97

• No issues found!

Thank you

@TahaTesser TahaTesser added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Jun 15, 2020
@dhuma1981
Copy link

I am also facing the similar issue, in my case, it reaches to the cloud_firestore but returns null in _data with real iOS device when connected to WiFi.

@TahaTesser TahaTesser added plugin: cloud_firestore type: bug Something isn't working and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Jun 17, 2020
@mlemos
Copy link
Author

mlemos commented Jun 20, 2020

HI @TahaTesser , I just performed a "reset to factory defaults" on my Pixel 3XL and the problem persisted. It happens on both my Pixel 4XL and Pixel 3XL. I'll grab another device today and perform more testing.

What is interesting is that both Firestore and Crashlytics provide error messages while running over wifi. It seems that the firebase plugin is not correctly identifying the connectivity status and is assuming that it is not connected over wifi in those circumstances.

Probably a shared code between Crashlytics and Firestore causing the error on both packages.

Crashlytics error:

E/FirebaseCrashlytics(22411): Settings request failed.
E/FirebaseCrashlytics(22411): java.io.InterruptedIOException: timeout
E/FirebaseCrashlytics(22411): 	at okhttp3.RealCall.timeoutExit(RealCall.java:107)
E/FirebaseCrashlytics(22411): 	at okhttp3.RealCall.execute(RealCall.java:96)

Firestore Error:

W/Firestore(22411): (21.4.3) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds
W/Firestore(22411):
W/Firestore(22411): 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.

@mlemos
Copy link
Author

mlemos commented Jun 20, 2020

Hi @TahaTesser, I finally put my hands in another device and the results were the same.

I have also updated my Flutter environment and all libraries.

The key error messages are:

...
D/NetworkManagementSocketTagger(29981): tagSocket(62) with statsTag=0xffffffff, statsUid=-1
E/FirebaseInstanceId(29981): binding to the service failed
...
/FirebaseCrashlytics(29981): Settings request failed.
E/FirebaseCrashlytics(29981): java.io.InterruptedIOException: timeout
E/FirebaseCrashlytics(29981): 	at okhttp3.RealCall.timeoutExit(RealCall.java:107)
E/FirebaseCrashlytics(29981): 	at okhttp3.RealCall.execute(RealCall.java:96)
...
D/ConnectivityManager(29981): requestNetwork; CallingUid : 10263, CallingPid : 29981
W/DynamiteModule(29981): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(29981): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(29981): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
I/ject.spread_de(29981): The ClassLoaderContext is a special shared library.
I/chatty  (29981): uid=10263(net.spreadproject.spread_dev) AsyncTask #2 identical 1 line
I/ject.spread_de(29981): The ClassLoaderContext is a special shared library.
V/NativeCrypto(29981): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 286 native methods...
W/ject.spread_de(29981): Accessing hidden field Ljava/nio/Buffer;->address:J (light greylist, reflection)
W/ject.spread_de(29981): Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (light greylist, reflection)
I/ject.spread_de(29981): Waiting for a blocking GC ClassLinker
I/ject.spread_de(29981): Background concurrent copying GC freed 53995(2MB) AllocSpace objects, 62(2MB) LOS objects, 67% free, 2MB/8MB, paused 281us total 107.391ms
I/ject.spread_de(29981): WaitForGcToComplete blocked ClassLinker on ClassLinker for 58.302ms
I/ProviderInstaller(29981): Installed default security provider GmsCore_OpenSSL
D/ConnectivityManager(29981): requestNetwork; CallingUid : 10263, CallingPid : 29981
D/NetworkManagementSocketTagger(29981): tagSocket(116) with statsTag=0xffffffff, statsUid=-1
W/Firestore(29981): (21.4.3) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds
W/Firestore(29981):
W/Firestore(29981): 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.
I/flutter (29981):   [2020-06-20 17:39:09.303984] DashNavigationBar >> healthStatus is: unknown
D/ConnectivityManager(29981): unregisterNetworkCallback; CallingUid : 10263, CallingPid : 29981
W/DynamiteModule(29981): Local module descriptor class for providerinstaller not found.

Flutter Doctor -v is:

[✓] Flutter (Channel stable, v1.17.4, on Mac OS X 10.15.5 19F101, locale en-US)
    • Flutter version 1.17.4 at /Users/mlemos/Documents/flutter
    • Framework revision 1ad9baa8b9 (3 days ago), 2020-06-17 14:41:16 -0700
    • Engine revision ee76268252
    • Dart version 2.8.4

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/mlemos/Library/Android/sdk
    • Platform android-30, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.5, Build version 11E608c
    • CocoaPods version 1.9.1

[!] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.46.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.11.0

[✓] Connected device (1 available)
    • SM J415G • 1abf0307 • android-arm • Android 9 (API 28)

! Doctor found issues in 1 category.

@mlemos
Copy link
Author

mlemos commented Jun 20, 2020

Strangely, now the tests are like this:

  • Samsung Phone => Works on Wifi and 3G.
  • Pixel 3XL => Fails on Wifi & Works on 3G.
  • Pixel 4XL => Fails on Wifi & Works on 3G.

All of them using the same Wifi and same 3G network.

@TahaTesser TahaTesser added the impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) label Jun 25, 2020
@emostar
Copy link

emostar commented Jul 3, 2020

@mlemos Are you able to access the firestore hostname from a browser on the devices that are not working?

@Salakar Salakar added resolution: user This was a user issue, e.g. invalid configuration or code. and removed plugin: cloud_firestore impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) labels Jul 7, 2020
@dhuma1981
Copy link

dhuma1981 commented Jul 31, 2020

For me I have 1 Mi-A2(Android Phone) and 1 iPhoneXR here are the test results.

  • Mi-A2 => Works on Wifi 1, Wifi 2 and 4G
  • iPhone XR => Fails on Wifi 2, Works on Wifi 1 & Works on 4G

So I have a bit different configuration of WiFi.

Wifi 1 = Main Wifi given by the service provider (with DHCP enable)
Wifi 2 = New network created from Wifi 1 and it has its own DHCP enable

So when I connect my iPhoneXR on Wifi 2 it start throwing the exception mentioned. But I connect to Wifi 1 it works perfectly.

If I disable the DHCP of wifi 2 and use it as a switch and keep the DHCP enable of Wifi 1 then also it works perfectly.

So I think there is some issue with dynamic IP and network connection and that's why it is causing the exception(Thinking loud)

I hope this will help to resolve this issue.

@anushavenkatesh1
Copy link

I am facing a similar issue. any solution so far
Any physical device - fails on wifi and works on 4G

I got a new broadband connection yesterday and saw a few firebase package update in the package.json. Could these be related?
Any suggestion soon appreciated

@ashokdamani
Copy link

hi, I am also facing the same issue, for me it doesn't work on Airtel 4G network but it works on Idea 4G network, though both are good network providers, also I tested on WIFI, it works fine, I get same results across the devices. Please help

@devoverse
Copy link

I have the same issue, doesn't work my device Redmi Note 8 Pro - on Airtel 4G but works on Airtel 2G and also on Wifi (Airtel Broadband).
Also, not working on Samsung galaxy s8+ - Vodafone 4G.
Working on other devices I have tested till now.
But there surely is a problem with fireflutter - how can firstore say slow connection on 4G(Ookla SpeedTest - 30Mbps) but not on 2G?

@Ehesp
Copy link
Member

Ehesp commented Sep 19, 2020

FlutterFire just sends some data from Dart, which hits the native Firebase SDKs, and sends the data back once they return some data. There isn't anything to debug on our end since it's a Firebase/SDK/location problem.

Have you raised a ticket directly with Firebase?

@mlemos
Copy link
Author

mlemos commented Sep 20, 2020

Hi All, after trying many different approaches to this error I was not able to systematically reproduce it.
Also, I noted that the errors I was getting at the time I opened this issue were related to one of the WiFi networks in my home. In other words, it worked fine in one WiFi network and not in another.

The networks are very very similar, same ISP, same configurations, same hardware, and I was not able to identify any differences between them that could be linked to the error. On my side, I quit trying to solve the issue.

However, there is definitely something here... and we need a better way to understand such basic and critical issues like network issues with Flutter and Firebase as those are key for reliability in the apps being developed.

@njustin
Copy link

njustin commented Sep 30, 2020

Hello!

I am also facing the same issue here with Crashlytics.

Using a physical tablet (ProDVX 22") Crashlytics does not initialise correctly with the error:

D/FirebaseCrashlytics: Reports are being sent.
D/FirebaseCrashlytics: Requesting settings from https://firebase-settings.crashlytics.com/spi/v2/platforms/android/gmp/1:XXXXXXX:android:XXXXXXX/settings
D/FirebaseCrashlytics: Settings query params were: {instance=XXXXXXXXXX, build_version=1, display_version=1.0.0, source=1}
E/FirebaseCrashlytics: Settings request failed.
    java.io.InterruptedIOException: timeout
        at okhttp3.RealCall.timeoutExit(RealCall.java:107)
        at okhttp3.RealCall.execute(RealCall.java:96)
        at com.google.firebase.crashlytics.internal.network.HttpRequest.execute(com.google.firebase:firebase-crashlytics@@17.0.0:129)
        at com.google.firebase.crashlytics.internal.settings.network.DefaultSettingsSpiCall.invoke(com.google.firebase:firebase-crashlytics@@17.0.0:86)
        at com.google.firebase.crashlytics.internal.settings.SettingsController$1.then(com.google.firebase:firebase-crashlytics@@17.0.0:200)
        at com.google.firebase.crashlytics.internal.settings.SettingsController$1.then(com.google.firebase:firebase-crashlytics@@17.0.0:193)
        at com.google.android.gms.tasks.zzp.run(Unknown Source:2)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(com.google.firebase:firebase-crashlytics@@17.0.0:60)
        at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(com.google.firebase:firebase-crashlytics@@17.0.0:27)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: java.io.IOException: Canceled
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254)
        at okhttp3.RealCall.execute(RealCall.java:92)
        at com.google.firebase.crashlytics.internal.network.HttpRequest.execute(com.google.firebase:firebase-crashlytics@@17.0.0:129) 
        at com.google.firebase.crashlytics.internal.settings.network.DefaultSettingsSpiCall.invoke(com.google.firebase:firebase-crashlytics@@17.0.0:86) 
        at com.google.firebase.crashlytics.internal.settings.SettingsController$1.then(com.google.firebase:firebase-crashlytics@@17.0.0:200) 
        at com.google.firebase.crashlytics.internal.settings.SettingsController$1.then(com.google.firebase:firebase-crashlytics@@17.0.0:193) 
        at com.google.android.gms.tasks.zzp.run(Unknown Source:2) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 
        at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(com.google.firebase:firebase-crashlytics@@17.0.0:60) 
        at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(com.google.firebase:firebase-crashlytics@@17.0.0:27) 
        at java.lang.Thread.run(Thread.java:764) 

But with the emulator it works fine:

D/FirebaseCrashlytics: Requesting settings from https://firebase-settings.crashlytics.com/spi/v2/platforms/android/gmp/XXXXXXXX/settings
D/FirebaseCrashlytics: Settings query params were: {instance=XXXXXXXXXXX, build_version=1, display_version=1.0.0, source=1}
D/FirebaseCrashlytics: Settings request ID: null
D/FirebaseCrashlytics: Settings result was: 200
D/FirebaseCrashlytics: Writing settings to cache file...
D/FirebaseCrashlytics: Loaded settings: {"settings_version":3,"cache_duration":86400,"features":{"collect_logged_exceptions":true,"collect_reports":true,"collect_analytics":false,"prompt_enabled":false,"push_enabled":false,"firebase_crashlytics_enabled":false},"app":{"status":"activated","update_required":false,"report_upload_variant":1,"native_report_upload_variant":1},"fabric":{"org_id":"XXXXXXXXXX","bundle_id":"XXXXXX"},"expires_at":1601540531383}
D/FirebaseCrashlytics: Send via DataTransport disabled. Removing DataTransport reports.
D/FirebaseCrashlytics: Starting report processing in 1.0 second(s)…

Both are on the same Wifi network. Running the exact same app.

Going to the settings URL displayed in the log is working fine on the tablet with Chrome and also on my laptop. And the result is displayed in less than 1 second.

Official Google/Firebase support ask me to fill the issue here, since they don't address Firebase/Flutter related API.

@ElaineSchwner
Copy link

ElaineSchwner commented Nov 14, 2020

Hello. I have the same issue, but for Samsung J6 and J4.

I have some Flutter applications, everything works fine in every device, but Samsung.
Users have complained about the app not getting any data when connected on wifi.

I bought a Samsung J6, just for testing, and I installed one of my apps from the play Store and it was completely blank. After 3 minutes, just staring the screen, the data showed.

Detail: I have other app pubished but with SQL database. This one worked well. So I think it is something related to Firebase.

Antoher detail: the same code from Web works.

I think the problem is it takes a long time to get wi-fi connection from Samsung.

One detail: this device only connects in wi-fi 2.4ghz

With the debub app and completely connected in wi-fi, we get this:

W/Firestore(32621): (21.3.0) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds
W/Firestore(32621):
W/Firestore(32621): 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.

After 3 minutes, it finally shows data.

I put the installed apk from Play Store for debugger and I think this verbose may be important:

2020-11-13 13:59:38.721 28883-25297/? W/NetworkScheduler: Error inserting flex_time=3534000 job_id=-1 period=7069000 source=16 requires_charging=0 preferred_network_type=1 target_class=com.google.android.gms.measurement.PackageMeasurementTaskService user_id=0 target_package=com.google.android.gms tag=Measurement.PackageMeasurementTaskService.UPLOAD_TASK_TAG task_type=0 required_idleness_state=0 service_kind=0 source_version=203915000 persistence_level=1 preferred_charging_state=1 required_network_type=0 runtime=1605286778713 retry_strategy={"maximum_backoff_seconds":{"3600":0},"initial_backoff_seconds":{"30":0},"retry_policy":{"0":0}} last_runtime=0, error message: UNIQUE constraint failed: pending_ops.tag, pending_ops.target_class, pending_ops.target_package, pending_ops.user_id (code 2067 SQLITE_CONSTRAINT_UNIQUE[2067]) [CONTEXT service_id=218 ]

I get the following erros from the published app:

2020-11-13 13:54:09.753 3300-3534/? E/NetdEventListenerService: handleMessage: { when=0 what=10001 obj=com.android.server.connectivity.NetdEventListenerService$DnsResultParams@c36a3bb target=com.android.server.connectivity.NetdEventListenerService$DnsEventHandler }
2020-11-13 13:54:12.569 3816-5647/? E/#IMSCR: 11-13 13:54:12 0x12060000:N,REFR:0
2020-11-13 13:54:12.605 3816-5647/? E/#IMSCR: 11-13 13:54:12 0x12060001:N,REFR:FOUND:0
2020-11-13 13:54:12.898 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: Start
2020-11-13 13:54:12.898 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: timeout = 1000 mIsAcquired = 0 mTagName : SurfaceFlinger
2020-11-13 13:54:12.900 2893-4382/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::requestGPU()
2020-11-13 13:54:12.901 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: End
2020-11-13 13:54:13.414 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: Start
2020-11-13 13:54:13.414 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: timeout = 1000 mIsAcquired = 1 mTagName : SurfaceFlinger
2020-11-13 13:54:13.414 2893-4382/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::requestGPU()
2020-11-13 13:54:13.414 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: End
2020-11-13 13:54:14.415 2893-4381/? E/NativeSemDvfsGpuManager: release:: Start
2020-11-13 13:54:14.415 2893-4381/? E/NativeSemDvfsGpuManager: release():: mIsAcquired = 1 , mName = GPU , mTagName : SurfaceFlinger
2020-11-13 13:54:14.416 2893-4381/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::releaseGPU()
2020-11-13 13:54:14.417 2893-4381/? E/NativeSemDvfsGpuManager: release:: End
2020-11-13 13:54:14.577 22613-22613/? E/Zygote: isWhitelistProcess - Process is Whitelisted
2020-11-13 13:54:14.578 22613-22613/? E/Zygote: accessInfo : 1
2020-11-13 13:54:14.595 22613-22613/? E/d.mobileservic: Not starting debugger since process cannot load the jdwp agent.
2020-11-13 13:54:14.817 22632-22632/? E/Zygote: isWhitelistProcess - Process is Whitelisted
2020-11-13 13:54:14.818 22632-22632/? E/Zygote: accessInfo : 1
2020-11-13 13:54:14.827 22632-22632/? E/android:drmSer: Not starting debugger since process cannot load the jdwp agent.
2020-11-13 13:54:14.989 22613-22613/? E/SEMS:DataAdapterLog_11.1.0: [SEMS][2][GroupDBHelper] Instance null
2020-11-13 13:54:17.905 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: Start
2020-11-13 13:54:17.905 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: timeout = 1000 mIsAcquired = 0 mTagName : SurfaceFlinger
2020-11-13 13:54:17.908 2893-4382/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::requestGPU()
2020-11-13 13:54:17.908 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: End
2020-11-13 13:54:18.420 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: Start
2020-11-13 13:54:18.421 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: timeout = 1000 mIsAcquired = 1 mTagName : SurfaceFlinger
2020-11-13 13:54:18.422 2893-4382/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::requestGPU()
2020-11-13 13:54:18.422 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: End
2020-11-13 13:54:19.423 2893-4381/? E/NativeSemDvfsGpuManager: release:: Start
2020-11-13 13:54:19.423 2893-4381/? E/NativeSemDvfsGpuManager: release():: mIsAcquired = 1 , mName = GPU , mTagName : SurfaceFlinger
2020-11-13 13:54:19.425 2893-4381/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::releaseGPU()
2020-11-13 13:54:19.425 2893-4381/? E/NativeSemDvfsGpuManager: release:: End
2020-11-13 13:54:22.894 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: Start
2020-11-13 13:54:22.894 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: timeout = 1000 mIsAcquired = 0 mTagName : SurfaceFlinger
2020-11-13 13:54:22.896 2893-4382/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::requestGPU()
2020-11-13 13:54:22.896 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: End
2020-11-13 13:54:23.410 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: Start
2020-11-13 13:54:23.410 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: timeout = 1000 mIsAcquired = 1 mTagName : SurfaceFlinger
2020-11-13 13:54:23.411 2893-4382/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::requestGPU()
2020-11-13 13:54:23.411 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: End
2020-11-13 13:54:24.412 2893-4381/? E/NativeSemDvfsGpuManager: release:: Start
2020-11-13 13:54:24.412 2893-4381/? E/NativeSemDvfsGpuManager: release():: mIsAcquired = 1 , mName = GPU , mTagName : SurfaceFlinger
2020-11-13 13:54:24.414 2893-4381/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::releaseGPU()
2020-11-13 13:54:24.414 2893-4381/? E/NativeSemDvfsGpuManager: release:: End
2020-11-13 13:54:27.901 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: Start
2020-11-13 13:54:27.901 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: timeout = 1000 mIsAcquired = 0 mTagName : SurfaceFlinger
2020-11-13 13:54:27.903 2893-4382/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::requestGPU()
2020-11-13 13:54:27.903 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: End
2020-11-13 13:54:28.417 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: Start
2020-11-13 13:54:28.417 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: timeout = 1000 mIsAcquired = 1 mTagName : SurfaceFlinger
2020-11-13 13:54:28.417 2893-4382/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::requestGPU()
2020-11-13 13:54:28.417 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: End
2020-11-13 13:54:29.418 2893-4381/? E/NativeSemDvfsGpuManager: release:: Start
2020-11-13 13:54:29.418 2893-4381/? E/NativeSemDvfsGpuManager: release():: mIsAcquired = 1 , mName = GPU , mTagName : SurfaceFlinger
2020-11-13 13:54:29.420 2893-4381/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::releaseGPU()
2020-11-13 13:54:29.420 2893-4381/? E/NativeSemDvfsGpuManager: release:: End
2020-11-13 13:54:30.855 3300-3324/? E/Watchdog: !@sync 198 [2020-11-13 13:54:30.855] FD count : 520, wdog_way : softdog
2020-11-13 13:54:32.907 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: Start
2020-11-13 13:54:32.907 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: timeout = 1000 mIsAcquired = 0 mTagName : SurfaceFlinger
2020-11-13 13:54:32.910 2893-4382/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::requestGPU()
2020-11-13 13:54:32.910 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: End
2020-11-13 13:54:33.423 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: Start
2020-11-13 13:54:33.423 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: timeout = 1000 mIsAcquired = 1 mTagName : SurfaceFlinger
2020-11-13 13:54:33.425 2893-4382/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::requestGPU()
2020-11-13 13:54:33.425 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: End
2020-11-13 13:54:34.426 2893-4381/? E/NativeSemDvfsGpuManager: release:: Start
2020-11-13 13:54:34.426 2893-4381/? E/NativeSemDvfsGpuManager: release():: mIsAcquired = 1 , mName = GPU , mTagName : SurfaceFlinger
2020-11-13 13:54:34.428 2893-4381/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::releaseGPU()
2020-11-13 13:54:34.428 2893-4381/? E/NativeSemDvfsGpuManager: release:: End
2020-11-13 13:54:34.729 7825-22606/? E/InternalPeopleServiceGrpcClient: Error making Grpc request.
clxm: DEADLINE_EXCEEDED: deadline exceeded after 24.969990846s. [buffered_nanos=24970205597, waiting_for_connection]
at clxl.c(:com.google.android.gms@203915035@20.39.15 (120306-335085812):3)
at snn.a(:com.google.android.gms@203915035@20.39.15 (120306-335085812):65)
at apeo.a(:com.google.android.gms@203915035@20.39.15 (120306-335085812):34)
at apeq.a(:com.google.android.gms@203915035@20.39.15 (120306-335085812):18)
at aper.run(:com.google.android.gms@203915035@20.39.15 (120306-335085812):2)
at java.lang.Thread.run(Thread.java:919)
2020-11-13 13:54:34.729 7825-22606/? E/FSA2_GroupSyncGrpc: getGroups() failed
clxm: DEADLINE_EXCEEDED: deadline exceeded after 24.969990846s. [buffered_nanos=24970205597, waiting_for_connection]
at clxl.c(:com.google.android.gms@203915035@20.39.15 (120306-335085812):3)
at snn.a(:com.google.android.gms@203915035@20.39.15 (120306-335085812):65)
at apeo.a(:com.google.android.gms@203915035@20.39.15 (120306-335085812):34)
at apeq.a(:com.google.android.gms@203915035@20.39.15 (120306-335085812):18)
at aper.run(:com.google.android.gms@203915035@20.39.15 (120306-335085812):2)
at java.lang.Thread.run(Thread.java:919)
2020-11-13 13:54:37.897 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: Start
2020-11-13 13:54:37.897 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: timeout = 1000 mIsAcquired = 0 mTagName : SurfaceFlinger
2020-11-13 13:54:37.899 2893-4382/? E/NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::requestGPU()
2020-11-13 13:54:37.899 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: End
2020-11-13 13:54:38.413 2893-4382/? E/NativeSemDvfsGpuManager: acquire:: Start

There is this error too:

There is this error:

2020-11-13 14:57:22.263 14098-14115/com.oneplanet.historiasparadormir E/MediaHTTPConnection: java.lang.NullPointerException: Attempt to invoke virtual method 'java.net.URLConnection java.net.URL.openConnection()' on a null object reference
at android.media.MediaHTTPConnection.seekTo(MediaHTTPConnection.java:256)
at android.media.MediaHTTPConnection.getMIMEType(MediaHTTPConnection.java:475)
at android.media.IMediaHTTPConnection$Stub.onTransact(IMediaHTTPConnection.java:159)
at android.os.Binder.execTransactInternal(Binder.java:1056)
at android.os.Binder.execTransact(Binder.java:1029)
2020-11-13 14:57:22.265 14098-14115/com.oneplanet.historiasparadormir E/MediaHTTPConnection: java.lang.NullPointerException: Attempt to invoke virtual method 'java.net.URLConnection java.net.URL.openConnection()' on a null object reference
at android.media.MediaHTTPConnection.seekTo(MediaHTTPConnection.java:256)
at android.media.MediaHTTPConnection.getSize(MediaHTTPConnection.java:461)
at android.media.IMediaHTTPConnection$Stub.onTransact(IMediaHTTPConnection.java:151)
at android.os.Binder.execTransactInternal(Binder.java:1056)
at android.os.Binder.execTransact(Binder.java:1029)

@ElaineSchwner
Copy link

This is really urgent! The apps are blank in some devices!!
Help, please.

@njustin
Copy link

njustin commented Nov 19, 2020

I also reproduced this issue on another out of the box tablet through a working wifi connection:

E/FirebaseCrashlytics( 5971): Settings request failed.
E/FirebaseCrashlytics( 5971): java.io.InterruptedIOException: timeout
E/FirebaseCrashlytics( 5971): 	at okhttp3.RealCall.timeoutExit(RealCall.java:107)
E/FirebaseCrashlytics( 5971): 	at okhttp3.RealCall.execute(RealCall.java:96)
E/FirebaseCrashlytics( 5971): 	at com.google.firebase.crashlytics.internal.network.HttpRequest.execute(com.google.firebase:firebase-crashlytics@@17.0.0:129)
E/FirebaseCrashlytics( 5971): 	at com.google.firebase.crashlytics.internal.settings.network.DefaultSettingsSpiCall.invoke(com.google.firebase:firebase-crashlytics@@17.0.0:86)
E/FirebaseCrashlytics( 5971): 	at com.google.firebase.crashlytics.internal.settings.SettingsController$1.then(com.google.firebase:firebase-crashlytics@@17.0.0:200)
E/FirebaseCrashlytics( 5971): 	at com.google.firebase.crashlytics.internal.settings.SettingsController$1.then(com.google.firebase:firebase-crashlytics@@17.0.0:193)
E/FirebaseCrashlytics( 5971): 	at com.google.android.gms.tasks.zzp.run(Unknown Source:2)
E/FirebaseCrashlytics( 5971): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
E/FirebaseCrashlytics( 5971): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
E/FirebaseCrashlytics( 5971): 	at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(com.google.firebase:firebase-crashlytics@@17.0.0:60)
E/FirebaseCrashlytics( 5971): 	at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(com.google.firebase:firebase-crashlytics@@17.0.0:27)
E/FirebaseCrashlytics( 5971): 	at java.lang.Thread.run(Thread.java:764)
E/FirebaseCrashlytics( 5971): Caused by: java.io.IOException: Canceled
E/FirebaseCrashlytics( 5971): 	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
E/FirebaseCrashlytics( 5971): 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
E/FirebaseCrashlytics( 5971): 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
E/FirebaseCrashlytics( 5971): 	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254)
E/FirebaseCrashlytics( 5971): 	at okhttp3.RealCall.execute(RealCall.java:92)
E/FirebaseCrashlytics( 5971): 	... 10 more

Maybe there is something obvious to solve this issue, but in the meantime our app can't send analytics or crash report...

@ElaineSchwner
Copy link

ElaineSchwner commented Nov 23, 2020

It is not possible to use Firebase due to this error.
It's critical!
The apps are blank in some devices.

@ElaineSchwner
Copy link

Another log:

E/flutter (25716): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: [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.
E/flutter (25716): #0 MethodChannelDocumentReference.get (package:cloud_firestore_platform_interface/src/method_channel/method_channel_document_reference.dart:80:7)
E/flutter (25716):
E/flutter (25716): #1 DocumentReference.get (package:cloud_firestore/src/document_reference.dart:63:20)
E/flutter (25716):
E/flutter (25716): #2 _MyHomePageState.initState.. (package:scalifra/main.dart)
E/flutter (25716):
E/flutter (25716):
D/ConnectivityManager(25716): unregisterNetworkCallback; CallingUid : 10238, CallingPid : 25716
W/Firestore(25716): (21.7.1) [WatchStream]: (7cbc8be) Stream closed with status: Status{code=UNAVAILABLE, description=Channel shutdownNow invoked, cause=null}.

@Donneto
Copy link

Donneto commented Nov 24, 2020

Has anyone found a workaround for this issue?

@njustin
Copy link

njustin commented Nov 24, 2020

Nope... It doesn't work on some device model, sadly this is the model which should go to production, we will not be able to monitor crash and analytics for this application...
Every day, for at least 2 months I have the same error.
Maybe the fix is simple or may depend on an OS setting, but for now this is a major issue for us.

@ElaineSchwner
Copy link

ElaineSchwner commented Nov 24, 2020

@jdimond Do you think you could help us here?

The message comes from onlinestatetracker. If you check in the code there is a comment:

The weird part is that onlinestatetracker is in ios/Pods? but the message occurs when we use Android.

Or am I wrong?

// To deal with transient failures, we allow multiple stream attempts before
// giving up and transitioning from OnlineState Unknown to Offline.
// TODO(mikelehen): This used to be set to 2 as a mitigation for b/66228394.
// @jdimond thinks that bug is sufficiently fixed so that we can set this back
// to 1. If that works okay, we could potentially remove this logic entirely.
const int kMaxWatchStreamFailures = 1;

@mdalihusain
Copy link

I also encountered this problem, but the issue has been resolved a few days back on one of my devices.
@Ehesp I would like to confirm that this issue was not limited to FlutterFire, native Android Firebase Apps were not working as well.
I was in contact with Firebase Support, they told me that there are some issues with ISPs on which they are working to get them resolved.
For me, things are working fine now, but once in a couple of weeks, I still face this issue for 5-10 mins. And, I have noticed that when this issue occurs, even YouTube takes a long time in loading.

@ElaineSchwner
Copy link

ElaineSchwner commented Nov 24, 2020

Here, it happens all the time in some devices in wi-fi. The same app is working fine in one device, and it doesn't work in other.

@mdalihusain
Copy link

Here, it happens in some devices. The same app is working fine in one device, and it doesn't work in other.

@ElaineSchwner What I found after hours of testing that the problem isn't with the device, but the network. On the devices in which the app isn't working, try using a network different than you are using on that device.

@ElaineSchwner
Copy link

ElaineSchwner commented Nov 24, 2020

Here, it happens in some devices. The same app is working fine in one device, and it doesn't work in other.

@ElaineSchwner What I found after hours of testing that the problem isn't with the device, but the network. On the devices in which the app isn't working, try using a network different than you are using on that device.

Yes, it doesn't work if the network is connecting in wi-fi through a 2.4 Mhz router. But some devices, like Samsung J6, only connect in 2.4Mhz, it doesn't connect in a 5.0 Mhz.
I know this because, after so many complaints I bought a Samsung J6 and here I have two routers, one 2.4 and the other 5.0.

But how can we tell the users that our app doesn't work on wi-fi?

It is an issue that needs to be corrected.

@mdalihusain
Copy link

Yes, absolutely there is no way to tell the users that our app doesn't work on wi-fi.
This issue needs to be corrected ASAP, because it makes releasing an app impossible when about 20% users can't use it.
But, what I think is all the people here should directly raise request with firebase rather than flutter fire, because the root of this issue is present in firebase and not flutterfire.

@Donneto
Copy link

Donneto commented Nov 24, 2020

i have a case where im testing on a simulator ( iphone ) and the app works on a version of the device but not in another. Connected to the same network ( wifi ) but different results.

@njustin
Copy link

njustin commented Nov 24, 2020

Same here, on the same network it works on the simulator but not on two devices, all of them can connect to the Internet.

Firebase support did not want to address the issue, since FlutterFire is not supported.

@ElaineSchwner
Copy link

ElaineSchwner commented Nov 24, 2020

Yes, absolutely there is no way to tell the users that our app doesn't work on wi-fi.
This issue needs to be corrected ASAP, because it makes releasing an app impossible when about 20% users can't use it.
But, what I think is all the people here should directly raise request with firebase rather than flutter fire, because the root of this issue is present in firebase and not flutterfire.

I just created a native app (kotlin) and made a simple list connecting with Firebase for testing purpose. It worked fine, on the same device that doesn't work with FlutterFire.

So I think it is problem with this package not with Firebase.

@ElaineSchwner
Copy link

I downgraded to cloud_firestore: 0.13.6

And it started working.

@JustoSenka
Copy link

JustoSenka commented Dec 10, 2020

I have the same problem on emulator. It worked fine when I was connected to a VPN in Switzerland. Once I turned off the VPN (I'm in Lithuania) and it started failing to get the data from firestore. Haven't tested on physical device yet.

cloud_firestore: 0.14.3+1

@trantan97
Copy link

I have the same issue 😭

@riterrani
Copy link

I am seeing this issue in production, this is a very critical issue, users can't access their data.

@Vilmir
Copy link

Vilmir commented Jan 26, 2021

I do not understand why this bug is not tagged with impact:critical. It is a show stopper for 100% of the apps wanting to integrate Flutterfire.
I encounter the issue on my Pixel 4a 5G and on both my wifi routers using 5GHZ. It is not reproducing at 100%, but when it is, every single call to Firebase APIs either times out, or resolves in more than 2min. Restarting the router, or the phone has no impact on the issue and the phone can fetch other type of data from the web with 0 problem.
I have to stop the integration of Firebase for my app and consider alternatives...

@kestasb
Copy link

kestasb commented Apr 1, 2021

We have a similar issue in our app and we're receiving many reports from users that data sometimes stops syncing. One of the users reported that the issue occurs only when he is connected via WiFi, but works correctly via mobile data.
Firestore throws the following exception:

PlatformException(firebase_firestore, UNAVAILABLE: Unable to resolve host firestore.googleapis.com, {code: unavailable, message: The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff.}, null)

We were finally able to reproduce it on Android physical device.

Steps to reproduce

Steps to reproduce the behavior:

  1. Build cloud_firestore example app from flutterfire on a physical Android device.
_onLike method was modified to include timeout
_onLike(int current) async {
    // Increment the "like" count straight away to show feedback to the user.
    setState(() {
      _likes = current + 1;
    });

    try {
      // Return and set the updated "likes" count from the transaction
      int newLikes = await FirebaseFirestore.instance
          .runTransaction<int>((transaction) async {
        DocumentSnapshot txSnapshot = await transaction.get(widget.reference);

        if (!txSnapshot.exists) {
          throw Exception("Document does not exist!");
        }

        int updatedLikes = (txSnapshot.data()['likes'] ?? 0) + 1;
        transaction.update(widget.reference, {'likes': updatedLikes});
        return updatedLikes;
      }).timeout(const Duration(seconds: 5), onTimeout: () {
        print("onTimeout");
        throw Exception("onTimeout!");
      });

      // Update with the real count once the transaction has completed.
      setState(() {
        _likes = newLikes;
      });
    } catch (e, s) {
      print(s);
      print("Failed to update likes for document! $e");

      // If the transaction fails, revert back to the old count
      setState(() {
        _likes = current;
      });
    }
  }
  1. When the app is opened, toggle the internet connection several times from WiFi to mobile data and vice versa. The most reliable way to reproduce the problem is by finishing the toggling process with the following sequence: turn off WiFi, turn on mobile data, turn on WiFi and turn off mobile data. (It may take several attempts)
  2. Try to tap on a heart icon to add a like, it should fail and the following stack trace should appear:
W/Firestore(15363): (22.0.1) [WatchStream]: (48de14) Stream closed with status: Status{code=UNAVAILABLE, description=Unable to resolve host firestore.googleapis.com, cause=java.lang.RuntimeException: java.net.UnknownHostException: Unable to resolve host "firestore.googleapis.com": No address associated with hostname
W/Firestore(15363): 	at io.grpc.internal.DnsNameResolver.resolveAll(DnsNameResolver.java:436)
W/Firestore(15363): 	at io.grpc.internal.DnsNameResolver$Resolve.resolveInternal(DnsNameResolver.java:272)
W/Firestore(15363): 	at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:228)
W/Firestore(15363): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/Firestore(15363): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/Firestore(15363): 	at java.lang.Thread.run(Thread.java:923)
W/Firestore(15363): Caused by: java.net.UnknownHostException: Unable to resolve host "firestore.googleapis.com": No address associated with hostname
W/Firestore(15363): 	at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:124)
W/Firestore(15363): 	at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
W/Firestore(15363): 	at java.net.InetAddress.getAllByName(InetAddress.java:1152)
W/Firestore(15363): 	at io.grpc.internal.DnsNameResolver$JdkAddressResolver.resolveAddress(DnsNameResolver.java:646)
W/Firestore(15363): 	at io.grpc.internal.DnsNameResolver.resolveAll(DnsNameResolver.java:404)
W/Firestore(15363): 	... 5 more
W/Firestore(15363): }.
I/ViewRootImpl@6e3fdd0[FlutterActivity](15363): ViewPostIme pointer 0
I/ViewRootImpl(15363): updatePointerIcon pointerType = 1002, calling pid = 15363
D/InputManager(15363): setPointerIconType iconId = 1002, callingPid = 15363
I/ViewRootImpl@6e3fdd0[FlutterActivity](15363): ViewPostIme pointer 1
I/flutter (15363): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:581:7)
I/flutter (15363): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18)
I/flutter (15363): <asynchronous suspension>
I/flutter (15363): #2      MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:358:43)
I/flutter (15363): <asynchronous suspension>
I/flutter (15363): #3      MethodChannelTransaction.get (package:cloud_firestore_platform_interface/src/method_channel/method_channel_transaction.dart:45:41)
I/flutter (15363): <asynchronous suspension>
I/flutter (15363): #4      Transaction.get (package:cloud_firestore/src/transaction.dart:26:9)
I/flutter (15363): <asynchronous suspension>
I/flutter (15363): #5      _Likes._onLike.<anonymous closure> (package:cloud_firestore_example/main.dart:318:39)
I/flutter (15363): <asynchronous suspension>
I/flutter (15363): #6      FirebaseFirestore.runTransaction.<anonymous closure> (package:cloud_firestore/src/firestore.dart:167:16)
I/flutter (15363): <asynchronous suspension>
I/flutter (15363): #7      MethodChannelFirebaseFirestore.runTransaction.<anonymous closure> (package:cloud_firestore_platform_interface/src/method_channel/method_channel
I/flutter (15363): Failed to update likes for document! PlatformException(firebase_firestore, UNAVAILABLE: Unable to resolve host firestore.googleapis.com, {code: unavailable, message: The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff.}, null)
I/ViewRootImpl(15363): updatePointerIcon pointerType = 1002, calling pid = 15363
D/InputManager(15363): setPointerIconType iconId = 1002, callingPid = 15363
W/Firestore(15363): (22.0.1) [WatchStream]: (48de14) Stream closed with status: Status{code=UNAVAILABLE, description=Unable to resolve host firestore.googleapis.com, cause=java.lang.RuntimeException: java.net.UnknownHostException: Unable to resolve host "firestore.googleapis.com": No address associated with hostname
W/Firestore(15363): 	at io.grpc.internal.DnsNameResolver.resolveAll(DnsNameResolver.java:436)
W/Firestore(15363): 	at io.grpc.internal.DnsNameResolver$Resolve.resolveInternal(DnsNameResolver.java:272)
W/Firestore(15363): 	at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:228)
W/Firestore(15363): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/Firestore(15363): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/Firestore(15363): 	at java.lang.Thread.run(Thread.java:923)
W/Firestore(15363): Caused by: java.net.UnknownHostException: Unable to resolve host "firestore.googleapis.com": No address associated with hostname
W/Firestore(15363): 	at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:124)
W/Firestore(15363): 	at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
W/Firestore(15363): 	at java.net.InetAddress.getAllByName(InetAddress.java:1152)
W/Firestore(15363): 	at io.grpc.internal.DnsNameResolver$JdkAddressResolver.resolveAddress(DnsNameResolver.java:646)
W/Firestore(15363): 	at io.grpc.internal.DnsNameResolver.resolveAll(DnsNameResolver.java:404)
W/Firestore(15363): 	... 5 more
W/Firestore(15363): }.
  1. All the following attempts to add a like results in a timeout:
Failed to update likes for document! Exception: onTimeout!

For some reason, sort actions which fetch data from Firestore still work. To make everything work again just turn the internet connection off/on.

Expected behavior

Firestore connection status should update according to the internet connection status.


Additional context

We managed to reproduce this issue on Samsung Galaxy S10e device with Android 11.


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
[✓] Flutter (Channel stable, 1.22.6, on macOS 11.2.1 20D74 darwin-x64, locale en-LT)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
[✓] Android Studio (version 4.1)
[✓] Connected device (1 available)
• No issues found!

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand
Dart SDK 2.12.0-259.16.beta
Flutter SDK 1.26.0-17.8.pre
cloud_firestore_example 0.0.0

dependencies:
- cloud_firestore 0.16.0+1 [flutter meta quiver firebase_core firebase_core_platform_interface cloud_firestore_platform_interface cloud_firestore_web]
- firebase_core 0.7.0 [firebase_core_platform_interface flutter quiver meta firebase_core_web]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]

dev dependencies:
- drive 0.0.1-6.0.pre [test_api flutter_test flutter_driver cli_util stack_trace universal_platform source_map_stack_trace flutter]
- flutter_driver 0.0.0 [file meta path vm_service webdriver flutter flutter_test fuchsia_remote_debug_protocol archive args async boolean_selector characters charcode clock collection convert crypto fake_async matcher platform process source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math]
- pedantic 1.11.0
- test 1.16.5 [analyzer async boolean_selector coverage http_multi_server io js node_preamble package_config path pedantic pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core]

dependency overrides:
- cloud_firestore_platform_interface 3.0.2 [flutter meta collection firebase_core plugin_platform_interface]
- firebase_core 0.7.0 [firebase_core_platform_interface flutter quiver meta firebase_core_web]

transitive dependencies:
- _fe_analyzer_shared 14.0.0 [meta]
- analyzer 0.41.2 [_fe_analyzer_shared args cli_util collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- archive 2.0.13 [crypto args path]
- args 1.6.0
- async 2.5.0 [collection]
- boolean_selector 2.1.0 [source_span string_scanner]
- characters 1.1.0
- charcode 1.2.0
- cli_util 0.1.4 [path]
- clock 1.1.0
- cloud_firestore_web 0.3.0+2 [flutter flutter_web_plugins http_parser meta firebase_core firebase_core_web cloud_firestore_platform_interface js]
- collection 1.15.0
- convert 2.1.1 [charcode typed_data]
- coverage 0.15.2 [args logging package_config path source_maps stack_trace vm_service]
- crypto 2.1.5 [collection convert typed_data]
- fake_async 1.2.0 [clock collection]
- file 6.0.0 [meta path]
- firebase_core_platform_interface 3.0.1 [flutter meta plugin_platform_interface quiver]
- firebase_core_web 0.2.1+3 [firebase_core_platform_interface flutter flutter_web_plugins meta js]
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]
- flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math]
- fuchsia_remote_debug_protocol 0.0.0 [process vm_service file meta path platform]
- glob 2.0.0 [async collection file path pedantic string_scanner]
- http_multi_server 3.0.0 [async]
- http_parser 3.1.4 [charcode collection source_span string_scanner typed_data]
- io 1.0.0 [meta path string_scanner]
- js 0.6.3
- logging 1.0.0
- matcher 0.12.10 [stack_trace]
- meta 1.3.0
- mime 1.0.0
- node_preamble 1.4.13
- package_config 1.9.3 [path charcode]
- path 1.8.0
- platform 3.0.0
- plugin_platform_interface 1.0.3 [meta]
- pool 1.5.0 [async stack_trace]
- process 4.0.0 [file path platform]
- pub_semver 2.0.0 [collection]
- quiver 2.1.5 [matcher meta]
- shelf 0.7.9 [async collection http_parser path stack_trace stream_channel]
- shelf_packages_handler 2.0.1 [path shelf shelf_static]
- shelf_static 0.2.9+2 [convert http_parser mime path shelf]
- shelf_web_socket 0.2.4+1 [shelf stream_channel web_socket_channel]
- sky_engine 0.0.99
- source_map_stack_trace 2.1.0 [path stack_trace source_maps]
- source_maps 0.10.10 [source_span]
- source_span 1.8.0 [charcode collection path term_glyph]
- stack_trace 1.10.0 [path]
- stream_channel 2.1.0 [async]
- string_scanner 1.1.0 [charcode source_span]
- sync_http 0.2.0
- term_glyph 1.2.0
- test_api 0.2.19 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
- test_core 0.3.15 [analyzer async args boolean_selector collection coverage glob io meta package_config path pedantic pool source_map_stack_trace source_maps source_span stack_trace stream_channel vm_service yaml matcher test_api]
- typed_data 1.3.0 [collection]
- universal_platform 0.1.3
- vector_math 2.1.0
- vm_service 5.5.0 [meta]
- watcher 1.0.0 [async path pedantic]
- web_socket_channel 1.2.0 [async crypto stream_channel]
- webdriver 2.1.2 [archive matcher path stack_trace sync_http]
- webkit_inspection_protocol 1.0.0 [logging]
- yaml 3.1.0 [collection source_span string_scanner]

@Salakar
Copy link
Member

Salakar commented Apr 1, 2021

This will need to reporting to Firebase support directly, there is not much FlutterFire can do here, we're just a wrapper to the underlying native SDKs - so if you haven't already then please raise a support ticket with Firebase support, or directly on the Firebase Android SDK repositories.

I'm going to move this to a discussion as it's not something we can 'resolve' as I mentioned.

@Salakar Salakar closed this as completed Apr 1, 2021
@firebase firebase locked and limited conversation to collaborators Apr 1, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
plugin: cloud_firestore resolution: user This was a user issue, e.g. invalid configuration or code. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests