21

Code that I have written for Admin Login:

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

class FirebaseServices {
  static Future<DocumentSnapshot> adminSignIn(id) async {
    var res =
        await FirebaseFirestore.instance.collection("admin").doc(id).get();
    return res;
  }
}

I am getting errors are given below:

+ ChromeProxyService: Failed to evaluate expression 
 'handlePrimaryPointer':InternalError: No frame with index 45.
+ ChromeProxyService: Failed to evaluate expression
 'postAcceptSlopTolerance': InternalError: No frame with index 45.
+ ChromeProxyService: Failed to evaluate expression 'FirebaseFirestore':    
  InternalError: No frame with index 32.
+ ChromeProxyService: Failed to evaluate expression 'DocumentSnapshot':    
  InternalError: No frame with index 32.
+ ChromeProxyService: Failed to evaluate expression 'Future': 
  InternalError: No frame with index 32.
+ ChromeProxyService: Failed to evaluate expression 'catch': 
  InternalError: No frame with index 32.

You can also visit the repository of the project.

I tried to run flutter doctor -v. And then:

[√] Flutter (Channel stable, 3.0.1, on Microsoft Windows [Version 10.0.19044.1706], locale en-US)
    • Flutter version 3.0.1 at C:\flutter_windows_2.2.3-stable\flutter      
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision fb57da5f94 (2 weeks ago), 2022-05-19 15:50:29 -0700
    • Engine revision caaafc5604
    • Dart version 2.17.1
    • DevTools version 2.12.2

[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\Ali_ijaz\AppData\Local\Android\sdk
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components      

[√] Android Studio (version 2020.3)
    • Android Studio at C:\Program Files\Android\Android Studio2
    • 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 4.1)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • 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
    X Unable to determine bundled Java version.
    • Try updating or re-installing Android Studio.

[√] VS Code (version 1.67.2)
    • VS Code at C:\Users\Ali_ijaz\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.42.0

[√] Connected device (4 available)
    • SM G955F (mobile) • 192.168.39.10:5555 • android-arm64  • Android 7.0 (API 24)
    • Windows (desktop) • windows            • windows-x64    • Microsoft Windows [Version 10.0.19044.1706]
    • Chrome (web)      • chrome             • web-javascript • Google Chrome 102.0.5005.63
    • Edge (web)        • edge               • web-javascript • Microsoft Edge 102.0.1245.30

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 3 categories.
double-beep
  • 5,031
  • 17
  • 33
  • 41
Ali ijaz
  • 321
  • 1
  • 2
  • 10

9 Answers9

11

If you are unable to add debug break-points and view the state of variables in the debugger, this is caused by a recent Flutter bug and you can apply the fixes down one paragraph.

If debugging works just fine, keep in mind that ChromeProxyService error messages are expected after your program was paused on a break point or unhandled exception if Async code was still executing at the time. It tells us Async code tried and of course failed to talk to the paused main thread after a debug break point or crash occurred first (Async task failed successfully). The resulting ChromeProxyService errors are a red herring. Your VSCode debugger shows a red pop-up over functions that result in an unhandled exception, that's your next clue.

If debugging break points are broken: Upgrade to Flutter v3.0.0 or downgrade to v2.10.4 using the workaround further down.

Flutter 3 upgrade:

Run flutter channel stable followed by flutter upgrade --force

For older versions of Flutter, a workaround is documented here https://github.com/flutter/flutter/issues/101224#issuecomment-1092324782:

flutter downgrade v2.10.4

(Find Flutter install dir using: flutter doctor -v)

cd <path to flutter install dir>/flutter/packages/flutter_tools

update dwds constraint in packages/flutter_tools/pubspec.yaml to 11.5.2

run flutter pub get in packages/flutter_tools directory

remove your cache: rm -rf ../../bin/cache

rebuild flutter: flutter pub get in packages/flutter_tools directory (it triggers the flutter rebuild)

This issue caused VS Code to show no local variables when debugging my Flutter project using the web-javascript renderer. I was not able to view the error message until switching the debug option to "Debug my code + packages".

Downgrading Google Chrome to version 99.0.4844.74 also works around the issue.

Benno
  • 169
  • 8
  • 2
    It does'nt work for me! Any other solution? – Ali ijaz Apr 24 '22 at 00:16
  • In my case, version 2.10.5 does not fix it. – Dabbel May 12 '22 at 12:40
  • 1
    @Dabbel The issue re-appeared on v2.10.5 for me yesterday after the latests Chrome update. Downgrading to Flutter v2.10.4 and re-applying the work-around fixed the issue for me. Today I upgraded to Flutter v3.0.0 and also working fine. – Benno May 12 '22 at 14:46
  • @Benno it is not working for me – Ali ijaz Jun 01 '22 at 17:37
  • @Aliijaz Can you post the output of `flutter doctor -v` for more context please? – Benno Jun 03 '22 at 08:54
  • @Benno Now Check question again i have made some edits – Ali ijaz Jun 04 '22 at 22:28
  • @Aliijaz the `ChromeProxyService` error message you referred to will always appear in the debug console when your program is paused on a break point or unhandled exception while other Async code is still executing in the background. If you are able to add debug break-points and view variables in the debugger, the `ChromeProxyService` error is a red herring for sure. – Benno Jun 10 '22 at 07:39
  • fix for me: flutter clean, flutter pub get – Gerry Mar 23 '23 at 16:38
3

This issue was addressed in the hotfix v2.10.5 of the stable branch

https://github.com/flutter/flutter/wiki/Hotfixes-to-the-Stable-Channel#2105-april-18-2022

https://twitter.com/FlutterReleases/status/1516140054183387140?t=ljVpMAzd2-VfYhYeB1S52w&s=19

So flutter upgrade should work

Djai
  • 188
  • 10
2

For others searching for this issue and coming across this page: I was hitting a similar error, unrelated to Firebase, and the solution was what's captured in Benno's answer above but a bit buried in the details.

This error message was a red herring in my case. What was actually happening is that I had another error (did not set up CORS policy correctly), which caused the main thread to crash and then causing an async call to not get captured. Once I fixed the other error, all was working as expected.

I missed that detail originally in Benno's response and hope to save time for others (and thank you Benno!).

Mr. Oak
  • 179
  • 9
1

Try upgrading your flutter project to a higher version, this seems like a flutter problem than your code.

I have seen some funny errors like this, if flutter clean+ restart doesn't work then I upgrade the project.

1

I had a similar error debugging flutter for web in chrome. ChromeProxyService: Failed to evaluate expression '...':InternalError: No frame with index ...

Turns out I was parsing a string incorrectly and an exception was being thrown in an async method. For whatever reason my IDE was breaking in browser_client.dart with this obscure message.

Running the same code as a windows desktop app revealed the actual error immediately.

chanban
  • 480
  • 1
  • 4
  • 19
1

Updated from 3.3.2 to 3.3.3 and it strarted working for windows app but not for chrome.

1

For me it worked after doing the following:

  1. flutter doctor - to check if everything is ok there (no prob for me)
  2. flutter upgrade and restart. Didn't help.
  3. flutter clean
  4. flutter pub get

Tadaa! It worked.

I also found a change in my env.dart file regarding feature flags that I didn't do manually.

Now running on version 3.3.9, channel stable.

Battleaxe
  • 64
  • 1
  • 7
0

Run flutter channel stable followed by flutter upgrade --force

Yakup
  • 28
  • 4
0

I upgraded to 3.7.12 from 3.7.8. No change. I have an initAsync in main and a check of Platform.iOS || Platform.Android so that I can prompt for file storage and photo permissions.

Returning from initAsync before checking Platform.iOS prevented the bug. So I added the code for a web check:

import 'package:flutter/foundation.dart' show kIsWeb;

and then do if (kIsWeb) return; before looking at Platform.iOS. That fixed it.

So before with the problem:

 @override
  void initState() {
    super.initState();
    initAsync();
  }

  Future<void> initAsync() async {
    PackageInfo packageInfo = await PackageInfo.fromPlatform();

    setState(() {
      _version = packageInfo.version;
      _buildNumber = packageInfo.buildNumber;      
    });

    if (Platform.isIOS || Platform.isAndroid) { etc...

and after with the fix:

 @override
  void initState() {
    super.initState();
    initAsync();
  }

  Future<void> initAsync() async {
    PackageInfo packageInfo = await PackageInfo.fromPlatform();

    setState(() {
      _version = packageInfo.version;
      _buildNumber = packageInfo.buildNumber;      
    });

    if (kIsWeb) return;

    if (Platform.isIOS || Platform.isAndroid) {
Matt H
  • 6,422
  • 2
  • 28
  • 32