Home > Software engineering >  Flutter build failed due to Unhandled Exception: PlatformException(channel-error, Unable to establis
Flutter build failed due to Unhandled Exception: PlatformException(channel-error, Unable to establis

Time:07-07

Once i added the cloud_firestore: ^3.2.1 dependency, I started getting this error, I even removed this dependency, but I am still getting this error. When the dependency wasn't in my project and I was just using Firebase Auth, everything was fine.

 void main() async {

  WidgetsFlutterBinding.ensureInitialized();

  await Firebase.initializeApp();

  runApp(
    MultiProvider(
      providers: [
        ChangeNotifierProvider(create: (_) => QuestionSectionProvider()),
        ChangeNotifierProvider(create: (_) => UIHelperProvider()),
        ChangeNotifierProvider(create: (_) => UserProvider())
      ],
      child: const MedicPro()
    )
  );
}

CodePudding user response:

I was able to solve this issue using flutter clean

CodePudding user response:

Steps to resolve:

  1. Stop the project if the project is running.
  2. flutter clean
  3. flutter pub get.
  4. Run the project.
  • Related