繁体   English   中英

Flutter IOS 应用程序不会以 image_picker 启动:^0.6.3+4

[英]Flutter IOS app won't start with image_picker: ^0.6.3+4

当我尝试在IOS端使用Image_Picker时, Flutter应用程序没有启动。 在 Android 方面一切正常。

我在info.plist 中添加了以下权限。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <!-- for Image Picker -->  
    <key>NSPhotoLibraryUsageDescription</key>
    <String>This app requires access to the photo library</String>
    <key>NSCameraUsageDescription</key>
    <string>This app requires access to the camera</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>This app does not require access to the microphone</string>
    
    <key>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>

当我从info.plist 中删除上述属性时,应用程序可以正常工作,直到我使用相机。 但是,如果我将属性添加到info.plist 中,应用程序将无法启动。

当我尝试运行 IOS 应用程序时出现以下错误。

/Users/abcshah/Library/Developer/Xcode/DerivedData/Runner-btwtkgmqdpzzlbcimpfmyibbmiua/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/assetcatalog_generated_info.plist

错误:无法从文件中读取属性列表:/Volumes/abc/projects/new/iconspro/ios/Runner/Info.plist:操作无法完成。 (XCBUtil。PropertyListConversionError错误1.)(以目标“跑步者从项目'转轮')

注意:使用新的构建系统

注意:规划构建

注意:构建构建描述

无法为模拟器构建应用程序。 在 iPhone 8 Plus 上启动应用程序时出错。

看来我的第一个猜测还没有完全断定。 我也在我的项目中使用 image_picker 插件,并且能够通过从字符串更改标签来产生一堆错误

<key>NSPhotoLibraryUsageDescription</key> 
<string>This app requires access to the camera.</string>

字符串

<key>NSPhotoLibraryUsageDescription</key> 
<String>This app requires access to the camera.</String>

因此,我建议注意标签的外壳。
确保所有<string>标签都是小写的。

听起来您需要以传统模式构建。 在 xcode 中加载您的项目并转到:

File -> Workspace Settings -> Build System ,并更改为Legacy Build System

清理然后重建,这应该对你有用

暂无
暂无

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

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