Flutter 模块';firebase_admob';找不到
正在尝试在Flatter项目中添加firebase_admob 首先,我创建了Firebase项目,然后在该项目中创建了两个应用程序(Android和iOS) 执行所有步骤(包括google-services.json/GoogleService-Info.plist和相应的源代码) 在pubspec.yaml中,只有以下依赖项:Flutter 模块';firebase_admob';找不到,flutter,firebase-admob,Flutter,Firebase Admob,正在尝试在Flatter项目中添加firebase_admob 首先,我创建了Firebase项目,然后在该项目中创建了两个应用程序(Android和iOS) 执行所有步骤(包括google-services.json/GoogleService-Info.plist和相应的源代码) 在pubspec.yaml中,只有以下依赖项: dependencies: flutter: sdk: flutter cupertino_icons: ^0.1.3 firebase_admo
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.3
firebase_admob: ^0.10.0+2
然后使用此模块添加admob功能:
当我在Android上运行这个项目时,一切都很好。显示测试广告横幅
然后尝试在mac上运行相同的存储库(命令:flatterrun)。并收到以下错误:
admin@Mac-Admin firebase_admob_test % flutter run
Running "flutter pub get" in firebase_admob_test... 2.4s
Launching lib/main.dart on iPhone 8 in debug mode...
Running pod install... 6.1s
flutter: BannerAd event is MobileAdEvent.loaded
Running Xcode build...
└─Compiling, linking and signing... 4.9s
Xcode build done. 57.8s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/admin/Projects/firebase_admob_test/ios/Runner/GeneratedPluginRegistra
nt.m:10:9: fatal error: module 'firebase_admob' not found
@import firebase_admob;
~~~~~~~^~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is 9.0 to
14.0.99. (in target 'nanopb' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is 9.0 to
14.0.99. (in target 'GoogleUtilities' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is 9.0 to
14.0.99. (in target 'PromisesObjC' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is 9.0 to
14.0.99. (in target 'GoogleDataTransport' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is 9.0 to
14.0.99. (in target 'Runner' from project 'Runner')
warning: Capabilities for Signing & Capabilities may not function correctly
because its entitlements use a placeholder team ID. To resolve this, select
a development team in the Runner editor. (in target 'Runner' from project
'Runner')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is 9.0 to
14.0.99. (in target 'Pods-Runner' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is 9.0 to
14.0.99. (in target 'FirebaseInstallations' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is 9.0 to
14.0.99. (in target 'FirebaseCoreDiagnostics' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is 9.0 to
14.0.99. (in target 'FirebaseCore' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is 9.0 to
14.0.99. (in target 'GoogleAppMeasurement' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is 9.0 to
14.0.99. (in target 'FirebaseAnalytics' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 8.0, but the range of supported deployment target versions is 9.0 to
14.0.99. (in target 'Firebase' from project 'Pods')
无法为模拟器生成应用程序。
在iPhone 8上启动应用程序时出错
源代码可以在这里找到
在这里提问之前,我试图找到一个解决方案,但没有任何帮助。此模块仍然不可见。
因为我是iOS开发新手,我不知道如何继续调查这个问题。
也许您可以建议一些方法。此库已弃用。您可以用替换它。此错误是否仅与此包一起存在?您是否可以尝试将firebase_admob包替换为cloud_firestore。