找不到模块“ firebase_admob”

如何解决找不到模块“ firebase_admob”

尝试在Flutter项目中添加firebase_admob。

首先,我创建了Firebase项目,然后在该项目中创建了2个应用程序(Android和iOS)。

执行了所有步骤(包括google-services.json / GoogleService-Info.plist和相应的源代码

在pubspec.yaml中仅具有以下依赖项:

dependencies:
  Flutter:
    sdk: Flutter
  cupertino_icons: ^0.1.3
  firebase_admob: ^0.10.0+2

然后使用此模块添加admob功能https://pub.dev/packages/firebase_admob/install

当我在Android上运行此项目时,一切都很好。显示测试广告横幅。

然后尝试在Mac上运行相同的存储库(命令:Flutter run)。并收到以下错误

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上启动应用程序时出错。

可在此处找到源代码 https://github.com/vetalitet/firebase_admob_test

在问这里之前,我试图找到一个解决方案,但没有任何帮助。该模块仍然不可见。 而且由于我是iOS开发的新手,所以我不知道如何继续调查此问题。 也许您可以提出一些建议。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?