简体   繁体   English

使用 flutter_secure_storage package 为 ios 创建构建存档时出现问题

[英]Problem creating a build archive for ios using flutter_secure_storage package

I'm trying to produce an archive (IPA file) of my application made with Flutter.我正在尝试生成使用 Flutter 制作的应用程序的存档(IPA 文件)。 I'm following the official guide for that: Preparing an iOS app for release: Create a build archive .我正在遵循官方指南: 准备发布 iOS 应用程序:创建构建档案

I have a problem producing the archive when I'm using the flutter_secure_storage package.当我使用flutter_secure_storage package 时,我在生成存档时遇到问题。

When I try to produce the archive (Xcode -> Product -> Archive), I get the following error:当我尝试生成存档(Xcode -> 产品 -> 存档)时,我收到以下错误:

Runner: 1 issue
/Path/to/my/project/ios/Runner/GeneratedPluginRegistrant.m:6:9: 
'flutter_secure_storage/FlutterSecureStoragePlugin.h' file not found

I can compile the project (from Xcode/Visual Code or using "flutter build ios --release" command) without any issue.我可以毫无问题地编译项目(从 Xcode/Visual Code 或使用“flutter build ios --release”命令)。 I only get the issue when I'm trying to generate the archive.我只有在尝试生成存档时才会遇到问题。

Do I need to change something in the project settings for creating the archive?我是否需要更改项目设置中的某些内容以创建存档?

The problem was that I was trying to create the archive from the Runner.xcodeproj instead of the Runner.xcworkspace (which defines the pods targets).问题是我试图从Runner.xcodeproj而不是Runner.xcworkspace (定义 pod 目标)创建存档。

Switching to that project solved the issue to produce the archive.切换到该项目解决了生成档案的问题。

make sure the platform: ios version is aligned with the one in the Podfile:确保平台:ios 版本与 Podfile 中的版本一致:

Version in Target -> Runner -> General -> Deployment Info should be the same as the on in your Podfile. Target -> Runner -> General -> Deployment Info中的版本应该与 Podfile 中的 on 相同。

Checkout this image: https://i.stack.imgur.com/Q6nPr.png查看此图片: https ://i.stack.imgur.com/Q6nPr.png

just make sure that you're opening Runner.xcworkspace and not Runner.xcodeproj只需确保您打开的是 Runner.xcworkspace 而不是 Runner.xcodeproj

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM