Flutter iOS 构建:“GeneratePluginRegistrant.h”找不到文件

发布于 2025-01-09 02:34:59 字数 1234 浏览 5 评论 0原文

我正在尝试构建我的 flutter 应用程序的 iOS 版本。
它最初是作为一个网络应用程序开发的,并且与 Android 版本构建得很好。

我需要初始化 Podfile,并且添加一些变量来修复“沙盒不同步”问题

现在我面临以下错误:

my-app/ios/Runner/Runner-Bridging-Header.h:1:9: 找不到“GeneratePluginRegistrant.h”文件

无法发出预编译头 '/Users/me/Library/Developer/Xcode/DerivedData/Runner-bcjlnasdfassdfsdf/Build/Intermediates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_1LNASLDFKSJDFRW-clang_10GAW6SLDFKJPY.pch' 用于桥接头 '/Users/me/my-app/ios/Runner/Runner-Bridging-Header.h'

如果我打开 Runner/Runner-Bridging-Header.h 文件,这些是内容

#import "GeneratedPluginRegistrant.h"

:我的项目中的任何地方确实没有名为“GeneratePluginRegistrant.h”的文件。

从哪里获取GeneratePluginRegistrant.h 文件?
我该如何解决这个问题?


更新:

我也看到这个错误:

无法为设备构建预编译应用程序。

看来您的应用程序仍然包含默认签名 标识符。尝试将 'com.example' 替换为您在 Xcode 中的签名 ID: 打开 ios/Runner.xcworkspace

在 iPhone 上启动应用程序时出错。


更新:

更改签名 ID 会导致以下结果:

无法为设备构建预编译应用程序。迅速 编译器错误(Xcode):无法在中找到“GeneratePluginRegistrant” 范围 /Users/me/my-app/ios/Runner/AppDelegate.swift:9:4

I'm trying to do an iOS build of my flutter app.
It was originally developed as a web app, and that and the Android version build just fine.

I've needed to init the Podfile, and also add some variable to fix a "Sandbox is not in sync" issue.

Now I am facing the following error:

my-app/ios/Runner/Runner-Bridging-Header.h:1:9:
'GeneratedPluginRegistrant.h' file not found

Failed to emit precompiled header
'/Users/me/Library/Developer/Xcode/DerivedData/Runner-bcjlnasdfassdfsdf/Build/Intermediates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_1LNASLDFKSJDFRW-clang_10GAW6SLDFKJPY.pch'
for bridging header
'/Users/me/my-app/ios/Runner/Runner-Bridging-Header.h'

If I open the Runner/Runner-Bridging-Header.h file, these are the contents:

#import "GeneratedPluginRegistrant.h"

And there is indeed no file called "GeneratedPluginRegistrant.h" anywhere in my project.

Where do I get the GeneratedPluginRegistrant.h file from?
How do I fix this issue?


Update :

I am also seeing this error :

Could not build the precompiled application for the device.

It appears that your application still contains the default signing
identifier. Try replacing 'com.example' with your signing id in Xcode:
open ios/Runner.xcworkspace

Error launching application on iPhone.


Update :

Changing the signing ID results in the following :

Could not build the precompiled application for the device. Swift
Compiler Error (Xcode): Cannot find 'GeneratedPluginRegistrant' in
scope /Users/me/my-app/ios/Runner/AppDelegate.swift:9:4

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

心房的律动 2025-01-16 02:34:59

请务必将 Runner-Bridging-Header.h 文件包含在 XCode 项目文件的“Objective-C Bridging Header”部分中,如下所述

https://github.com/flutter/flutter/issues/24869#issuecomment-461865955

Be sure to include the Runner-Bridging-Header.h file in the "Objective-C Bridging Header" section in your project file in XCode as described here

https://github.com/flutter/flutter/issues/24869#issuecomment-461865955

演出会有结束 2025-01-16 02:34:59

添加#import“GeneratePluginRegistrant.h”
到 Runner-Bridging-Header.h 文件

add #import "GeneratedPluginRegistrant.h"
to Runner-Bridging-Header.h file

陌上芳菲 2025-01-16 02:34:59

GeneratePluginRegistrant 由 flutter 自动生成。
我认为你可以这样做:

  1. 的构建文件夹
  2. 清理 ios 文件夹中 flutter 项目pod update 中 ios 项目 flutter pub update
  3. (如果你有一些插件)
    然后再试一次。

GeneratedPluginRegistrant is generated automaticlly by flutter.
I think you can do:

  1. clean the build folder of ios project
  2. flutter pub upgrade in flutter project
  3. pod update in ios folder (If you have some plugin)
    Then try again.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文