在 Xcode 中找不到 Flutter 模块

Sil*_*ree 10 xcode ios flutter

当我在 Xcode 中构建应用程序时,它会引发错误:.../ios/Runner/GeneratedPluginRegistrant.m:10:9: Module 'audioplayers' not found 我尝试重新安装并再次设置 pod,但是它没有用。我也包含pod 'Firebase/Core'在 pod 文件中。也许我还需要在那里包含 Audioplayer 模块?提前致谢!

tha*_*h84 147

确保 pod 文件中的平台:iOS 版本与 Xcode 中的部署信息匹配

在此输入图像描述

  • 谢谢!这为我解决了这个问题。我在 Runner 项目上的 XCode 构建设置如下: Project Runner -> 构建设置 -> 部署 -> iOS 部署目标:iOS 9.0 我的 podfile 说:平台:ios,'13.0' 我将 XCode 构建设置更改为 13.0 并运行 ` flutter build ipa` 并且成功了。 (13认同)

Sal*_*rke 99

您是否确保通过双击“project/ios”文件夹中的“runner.xcworkspace”而不是“runner.xcodeproj”来启动 xcode?

据此消息来源称,它为很多人解决了“缺少模块”的问题(正如它为我所做的那样)。 https://github.com/flutter/flutter/issues/41033

  • 哦,ffs-谢谢!!我真的不喜欢xcode (5认同)

小智 36

  1. 删除 Podfile
  2. flutter clean
  3. flutter pub get
  4. flutter build ios

这个对我有用!


Tha*_*hin 20

确保所选的运行方案是“debug”

  • 单击模拟器下拉菜单附近的“Runner”。
  • 编辑方案。
  • 选择左侧列表中的“运行”。
  • 为“构建配置”选择“调试”

  • 太感谢了!我在归档我的生产风味时遇到了问题。结果存档是发布,而不是发布生产。 (2认同)

Sha*_*put 16

我遇到了同样的错误Better Video Player。确保您的 IOS 版本在Pod File is 11. 首先确保您正在打开runner.xcworkspace如果问题仍然存在,请尝试此步骤。

1.- flutter clean
2.- flutter pub get
3.- cd ios
4.- pod deintegrate
5.- pod install
Run Code Online (Sandbox Code Playgroud)

如果问题仍然存在

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
    end
  end
end
Run Code Online (Sandbox Code Playgroud)


thi*_*vin 9

对于我(Mac w/ M1),我运行了以下命令:

  1. flutter pub get
  2. cd ios
  3. rm -rf Pods/ Podfile.lock
  4. pod install

此后,在 xcode 中运行应用程序按预期工作。


小智 8

在 Mac 上使用 m1

1.- 删除 Podfile

在 Android Studio 中:

2.- flutter clean
3.- flutter pub get
4.- cd ios
5.- pod install
Run Code Online (Sandbox Code Playgroud)

然后

6.- Build and run your app through Xcode
Run Code Online (Sandbox Code Playgroud)

这对我有用。


小智 7

尝试这个对我有用的简单步骤

  1. 删除pod目录和podfile.lock

  2. 扑干净

  3. 扑扑酒吧得到

  4. 光盘

  5. pod install --repo-update

  6. 在 Xcode 中运行应用程序


ITW*_*ITW 6

尝试了很多东西,flutter clean恢复 Podfile 等,仍然面临同样的问题。

最终通过解决 Xcode 中突出显示的问题来获得此修复。你可以检查

https://github.com/flutter/flutter/issues/54599#issuecomment-644336055 https://github.com/flutter/flutter/issues/53573#issuecomment-749912604


Mat*_*rle 5

我对以下编译器输出有类似的问题:

/Users/me/flutter_project/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'barcode_scan' not found
    @import barcode_scan;
     ~~~~~~~^~~~~~~~~~~~
Run Code Online (Sandbox Code Playgroud)

我的项目包含多个具有 Flutter 风格的构建环境,如下所述:https ://medium.com/@thomasgallinari/e7a0c973f54e

对我来说解决这个问题的方法是将构建配置和相应文件的大小写从类似 到 的值更改Debug-stageDebug-StageFlutter 所期望的。

  • 这对我有用。我对 amplify_flutter 也有同样的问题,从 xcode 构建并运行良好,但无法从 flutter 命令行运行调试构建(`flutter run --flavor dev`)。拯救了我的理智,谢谢! (2认同)

小智 5

如果您通过 Xcode 运行程序,请确保您已在 Xcode 中打开 Runner.xcworkspace 文件,而不是 Runner.xcodeproj 文件