简体   繁体   English

如何解决在 Xcode 上找不到模块“image_picker”的问题?

[英]How to solve this problem Module 'image_picker' not found on Xcode?

When I try to archive my app to upload on the Apple Store I face this problem Module image_picker not found?当我尝试存档我的应用程序以在 Apple Store 上上传时,我遇到了这个问题 Module image_picker not found?

示例代码

What should I do to fix this @import error?我应该怎么做才能修复此@import错误?

I know that is old topic, but i have a propossiton how you can resolve this issue.我知道这是个老话题,但我有一个建议,你可以如何解决这个问题。

If application is develope in Flutter, and this error occured when you opened project in XCode then you try open entire folder "ios" instead of "xcodeproj" or "xcworkspace".如果应用程序是在 Flutter 中开发的,并且当您在 XCode 中打开项目时发生此错误,那么您尝试打开整个文件夹“ios”而不是“xcodeproj”或“xcworkspace”。

The tip in the picture below.提示如下图。

example例子

Verify info.plist验证info.plist

iOS # Add the following keys to your Info.plist file, located in <project root>/ios/Runner/Info.plist : iOS # 将以下键添加到位于<project root>/ios/Runner/Info.plist Info.plist文件中:

NSPhotoLibraryUsageDescription - describe why your app needs permission for the photo library. NSPhotoLibraryUsageDescription - 描述为什么你的应用需要照片库的权限。 This is called Privacy - Photo Library Usage Description in the visual editor.这在可视化编辑器中称为隐私 - 照片库使用说明。

NSCameraUsageDescription - describe why your app needs access to the camera. NSCameraUsageDescription - 描述为什么你的应用需要访问相机。 This is called Privacy - Camera Usage Description in the visual editor.这在可视化编辑器中称为隐私 - 相机使用说明。

NSMicrophoneUsageDescription - describe why your app needs access to the microphone, if you intend to record videos. NSMicrophoneUsageDescription - 如果您打算录制视频,请描述为什么您的应用需要访问麦克风。 This is called Privacy - Microphone Usage Description in the visual editor这在可视化编辑器中称为隐私 - 麦克风使用说明

More detail in: https://pub.dev/packages/image_picker更多详细信息: https : //pub.dev/packages/image_picker

First of all, you can try running the following commands:首先,您可以尝试运行以下命令:

pods repo update
rm -rf ios/Pods ios/Podfile.lock
flutter clean
flutter run

After that, you have to open the "Runner.xcworkspace" on Xcode.之后,您必须在 Xcode 上打开“Runner.xcworkspace”。

I know is an old topic but could help other people.我知道这是一个老话题,但可以帮助其他人。 You need to change "image_picker" to "image_picker_ios" and if this doesn't help, you can try this https://stackoverflow.com/a/72515674/11972105您需要将“image_picker”更改为“image_picker_ios”,如果这没有帮助,您可以试试这个https://stackoverflow.com/a/72515674/11972105

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

相关问题 image_picker:如果首先访问相机,则取消按钮在图库中不可见 - image_picker: Cancel button not visible in gallery, if camera was accessed first 如何解决Xcode构建错误“没有这样的模块RxCocoa”? - How to solve Xcode build error “No such module RxCocoa”? Flutter IOS 应用程序不会以 image_picker 启动:^0.6.3+4 - Flutter IOS app won't start with image_picker: ^0.6.3+4 颤振:“与设备的连接丢失。” 第二次使用 image_picker 从 iOS 上的图库中选择照片 - Flutter: 'Lost connection to device.' second time using image_picker to select photo from gallery on iOS Flutter image_picker 视频库 OSError: Operation not allowed [Errno 1] IOS 13 - Flutter image_picker video gallery OSError: Operation not permitted [Errno 1] IOS 13 [Flutter] Xcode 中“未找到模块” - [Flutter]'No module found' in Xcode Flutter 在 Xcode 中找不到模块 - Flutter module not found in Xcode 如何解决codemagic中的“fatal error: module 'barcode_scan' not found”? - How to solve "fatal error: module 'barcode_scan' not found" in codemagic? 图像选择器未显示图像iOS Xcode 6.1.1 - Image picker not showing image iOS Xcode 6.1.1 有没有办法使用 Image_Picker 或来自 pub.dev 的类似插件从 Flutter 中的 ios 设备中选择 *.HEIC 文件? - Is there a way to pick *.HEIC files from an ios device in Flutter using Image_Picker or similar plugins from pub.dev?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM