Home > front end >  Connecting Firebase to my Flutter App ChromeProxyService: Failed to evaluate expression 'FireBa
Connecting Firebase to my Flutter App ChromeProxyService: Failed to evaluate expression 'FireBa

Time:08-04

I have connected my firebase project successfully because it was running and then I added other screens and changed navigation to namedRoute and now my app won't run I have received this error: "ChromeProxyService: Failed to evaluate expression 'callback': InternalError: No frame with index 14." please help

Below is my Source Code:

My main.dart file

import 'dart:ui';

import 'package:essentials/constants.dart';
// import 'package:essentials/firebase_options.dart';
import 'package:essentials/routes.dart';
import 'package:essentials/screens/splash/splash_screen.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';

import 'screens/forgot_password/forgot_password_screen.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
      // options: DefaultFirebaseOptions.currentPlatform,
      );
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Essentials_App',
      theme: ThemeData(
        scaffoldBackgroundColor: Colors.white,
        fontFamily: "muli",
        textTheme: const TextTheme(
          bodyText1: TextStyle(color: kTextColor),
          bodyText2: TextStyle(color: kTextColor),
        ),
        visualDensity: VisualDensity.adaptivePlatformDensity,
        primarySwatch: Colors.blue,
      ),
      // home: SplashScreen(),
      initialRoute: SplashScreen.routeName,
      routes: routes,
    );
  }
}

Then my routes.dart and this is where i want to access my routes

import 'package:essentials/screens/signin/signin_screen.dart';
import 'package:flutter/widgets.dart';
import 'package:essentials/screens/forgot_password/forgot_password_screen.dart';
import 'package:essentials/screens/home/home_screen.dart';
import 'package:essentials/screens/login_success/login_success_screen.dart';
import 'package:essentials/screens/splash/splash_screen.dart';
import 'package:essentials/screens/signup/sign_up_screen.dart';

// All our routes will be accessed here
final Map<String, WidgetBuilder> routes = {
  SplashScreen.routeName: (context) => SplashScreen(),
  SignInScreen.routeName: (context) => SignInScreen(),
  ForgotPasswordScreen.routeName: (context) => ForgotPasswordScreen(),
  LoginSuccessScreen.routeName: (context) => LoginSuccessScreen(),
  SignUpScreen.routeName: (context) => SignUpScreen(),
  HomeScreen.routeName: (context) => HomeScreen(),
};

My main. dart file is where I have initialized firebase and it is where the debug is paused and it points to the initialization line of code

I tried researching about the error I found that someone had asked before and he was not answered follow this link to see his question: ChromeProxyService: Failed to evaluate expression 'FireBase.initializeApp': InternalError: No frame with index 39

CodePudding user response:

If you are running it in emulator may be change the emulator.

CodePudding user response:

can you try initialize in this way and run in web ? 

await Firebase.initializeApp(
  options: const FirebaseOptions(
  apiKey: "***", // Your apiKey
  appId: "***", // Your appId
  messagingSenderId: "***", // Your messagingSenderId
  projectId: "***", //
  storageBucket: "***", // Your projectId
 ),
);
  • Related