You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter项目在Android Studio运行时出现FirebaseAppPlatform.verifyExtends成员未找到错误求助

Fix: "Member not found: 'FirebaseAppPlatform.verifyExtends'" in Flutter Firebase Project

Hey, I’ve run into this exact issue before — let’s break down what’s happening and fix it properly, no messy edits to system cache files required (trust me, you don’t want to go that route).

What’s Causing the Error

Even though you declared firebase_core: ^1.7.0 in your pubspec.yaml, your project is actually pulling and using firebase_core-1.24.0 under the hood. That newer version removed the FirebaseAppPlatform.verifyExtends method, but some code (either yours or a dependency you’re using) is still trying to call it — hence the "member not found" error.

Critical Note: Never edit files directly in the .pub-cache folder! Any changes you make there will get overwritten the next time you run flutter pub get or flutter pub upgrade, and it’ll create inconsistencies if you’re collaborating with a team.

Step-by-Step Solutions

1. Lock Firebase Core to Your Desired Version

First, fix the version in your pubspec.yaml to a hard, non-upgradable version by removing the caret (^):

dependencies:
  firebase_core: 1.7.0  # No more ^ here — forces exact version

Then run this command to refresh your dependencies:

flutter pub get

This tells Pub to use exactly 1.7.0 instead of automatically pulling a newer, incompatible version.

2. Resolve Dependency Conflicts (If They Pop Up)

If locking the version causes errors with other Firebase packages (like needing a newer firebase_core), you’ll need to track down which dependency is forcing the upgrade. Run this command to view your full dependency tree:

flutter pub deps

Look for any packages that list a higher firebase_core version as a requirement. You have two options here:

  • Downgrade those conflicting packages to versions that work with firebase_core: 1.7.0, or
  • If you need the newer features from those packages, upgrade your code to match a newer firebase_core version. You’ll need to replace calls to FirebaseAppPlatform.verifyExtends with the updated API (check Firebase Core’s changelog — the replacement is usually FirebaseAppPlatform.instanceFor).

3. Clear Stale Cache and Reinstall Dependencies

If the above steps don’t resolve the issue, wipe the pub cache to eliminate any lingering stale versions:

flutter pub cache clean
flutter pub get

Quick Pro Tip

Always keep all your Firebase-related dependencies on matching versions. Mixing old and new Firebase packages is one of the most common causes of these compatibility headaches.

内容的提问来源于stack exchange,提问作者himani patel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.27 13:22:40