Error: Member not found: 'FirebaseAppPlatform.verifyExtends'
#1
I've encountered an issue where I am getting a 'FirebaseAppPlatform.verifyExtends' error while trying to run my Flutter application. I've already tried the common steps to resolve Flutter errors, including cleaning the project, fetching the packages again, and updating iOS pods. However, these steps did not resolve the issue. I suspect there might be a problem in the configuration of my Firebase initialization or there could be a version mismatch with the Firebase plugins I am using. Here's the sequence of commands I've run:

Code:
cd ios
pod install

However, I keep encountering the same error. This is preventing my app from compiling and running on an iOS device. I'm using a number of Firebase services, such as Firestore, Auth, and Cloud Messaging. Perhaps there's an issue with how I'm setting them up. I'll share the relevant code below for initializing Firebase:

Code:
void main() async {
    WidgetsFlutterBinding.ensureInitialized();
    await Firebase.initializeApp();
    runApp(MyApp());
}

I'm including my pubspec.yaml file dependencies here for reference:

Code:
dependencies:
    flutter:
    sdk: flutter
firebase_core: ^ 1.3 .0
firebase_auth: ^ 3.1 .1
cloud_firestore: ^ 2.5 .1
firebase_messaging: ^ 10.0 .3

Any insights into what could be causing this 'FirebaseAppPlatform.verifyExtends' error would be helpful.
Reply
#2
This error may indicate that the Firebase plugins are not correctly installed or there is a version conflict. Can you try updating to the latest versions of each Firebase plugin to see if that resolves the issue? Also, make sure that your Firebase project is correctly configured in your Flutter project, including the GoogleService-Info.plist file for iOS.
Reply
#3
Indeed, upgrading the plugins to their latest stable versions might help, as OliviaSmith mentioned. Additionally, errors like this can also be a result of improper plugin initialization. Make sure you're waiting for Firebase to initialize before calling `runApp()`. Can you also show us how you've configured your firebase options in `Firebase.initializeApp()` like so?

Code:
);

Make sure to replace the placeholders with your actual Firebase project settings, and then try to initialize Firebase with these options:

Reply
#4
If the previous suggestions don't work, there's another potential source of the problem to look into. Have you checked the compatibility between your Flutter SDK version and the Firebase plugin versions you're using? Incompatibility there could cause such initialization errors. To ensure that you have compatible versions, you might want to upgrade your Flutter SDK to the latest stable version and then update the Firebase plugins accordingly.
Here's how you can get and set the Flutter version:


And then run `flutter pub upgrade` to update the plugins. Also, have you checked the iOS deployment target? Make sure it's set to at least 10.0 in your Podfile:


Let's update the initial code with the fixes suggested by codegenie48 and include proper import statements for clarity:

Code:
void main() async {
    WidgetsFlutterBinding.ensureInitialized();
    final FirebaseOptions firebaseOptions = FirebaseOptions(
        apiKey: 'your-api-key',
        appId: 'your-app-id',
        messagingSenderId: 'your-sender-id',
        projectId: 'your-project-id',
    );
    await Firebase.initializeApp(options: firebaseOptions);
    runApp(MyApp());
}
class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
        return MaterialApp(
            title: 'Firebase Example App',
            theme: ThemeData(
                primarySwatch: Colors.blue,
            ),
            home: MyHomePage(),
        );
    }
}
class MyHomePage extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
        return Scaffold(
            appBar: AppBar(
                title: Text('HomePage'),
            ),
            body: Center(
                child: Text('Welcome to Firebase!'),
            ),
        );
    }
}

Ensure you have the correct settings for your Firebase project in the options, and this updated code should initialize Firebase properly in your Flutter application.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)