Flutter iOS 构建:“GeneratePluginRegistrant.h”找不到文件
我正在尝试构建我的 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 foundFailed 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.xcworkspaceError 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
请务必将 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
添加#import“GeneratePluginRegistrant.h”
到 Runner-Bridging-Header.h 文件
add
#import "GeneratedPluginRegistrant.h"
to Runner-Bridging-Header.h file
GeneratePluginRegistrant
由 flutter 自动生成。我认为你可以这样做:
pod update
中 ios 项目flutter pub update
然后再试一次。
GeneratedPluginRegistrant
is generated automaticlly by flutter.I think you can do:
flutter pub upgrade
in flutter projectpod update
in ios folder (If you have some plugin)Then try again.