当我在应用程序中使用 Mapbox sdk 时,无法从文件中读取属性列表,Info.plist 问题

Fah*_*ain 7 error-handling info.plist ios dart flutter

我在我的一个 flutter 应用程序中遇到了问题。我正在使用 MapBox-SDK 插件,但是当我在 IOS 上测试该应用程序时,它要求我将 Mapbox-sdk 更新到某个版本(我使用 pop install 命令执行此操作)。现在,在一切之后,我在 info.plist 文件中面临新的错误。我忘记备份旧的 info.plist 文件。\n无论如何,新的 info.plist 是:

\n\n
<plist version="1.0">\n<dict>\n<string>YES</string>\n<key>io.flutter.embedded_views_preview</key>\n<true/>\n<key>MGLMapboxAccessToken</key>\n<string>Mapbox-key-not-visible</string>\n<true/>\n<key>NSLocationWhenInUseUsageDescription</key>\n<key>NSLocationAlwaysUsageDescription</key>\n<key>NSPhotoLibraryUsageDescription</key>\n<key>NSCameraUsageDescription</key>\n<key>NSMicrophoneUsageDescription</key>\n<string>This app needs access to location when open.</string>\n<key>CFBundleDevelopmentRegion</key>\n<string>$(DEVELOPMENT_LANGUAGE)</string>\n<key>CFBundleExecutable</key>\n<string>$(EXECUTABLE_NAME)</string>\n<key>CFBundleIdentifier</key>\n<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n<key>CFBundleInfoDictionaryVersion</key>\n<string>6.0</string>\n<key>CFBundleName</key>\n<string>project1</string>\n<key>CFBundlePackageType</key>  \n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n<string>$(FLUTTER_BUILD_NAME)</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n<string>$(FLUTTER_BUILD_NUMBER)</string>\n<key>LSRequiresIPhoneOS</key>\n<true/>\n<key>UILaunchStoryboardName</key>\n<string>LaunchScreen</string>\n<key>UIMainStoryboardFile</key>\n<string>Main</string>\n<key>UISupportedInterfaceOrientations</key>\n<array>\n    <string>UIInterfaceOrientationPortrait</string>\n    <string>UIInterfaceOrientationLandscapeLeft</string>\n    <string>UIInterfaceOrientationLandscapeRight</string>\n</array>\n<key>UISupportedInterfaceOrientations~ipad</key>\n<array>\n    <string>UIInterfaceOrientationPortrait</string>\n    <string>UIInterfaceOrientationPortraitUpsideDown</string>\n    <string>UIInterfaceOrientationLandscapeLeft</string>\n    <string>UIInterfaceOrientationLandscapeRight</string>\n</array>\n<key>UIViewControllerBasedStatusBarAppearance</key>\n<false/>\n</dict>\n</plist\n
Run Code Online (Sandbox Code Playgroud)\n\n

我在构建应用程序时面临的错误是:

\n\n

错误:

\n\n
Users/apple/flutter-practice/Project-Casky/casky/ios/Runner/Info.plist: Property List       error: Found non-key inside <dict> at line 10 / JSON error: JSON text did not start with array or object and option to allow fragments not set.\nXcode build done.                                           24.2s\nFailed to build iOS app\nError output from Xcode build:\n\xe2\x86\xb3\n** BUILD FAILED **\nXcode\'s output:\n\xe2\x86\xb3\nerror: unable to read property list from file: /Users/apple/flutter-practice/Project-  Casky/casky/ios/Runner/Info.plist: The operation couldn\xe2\x80\x99t be completed.  (XCBUtil.PropertyListConversionError error 1.) (in target \'Runner\' from project \'Runner\')\nnote: Using new build system\nnote: Building targets in parallel\nnote: Planning build\nnote: Constructing build description\nwarning: Mapping architecture armv7 to i386. Ensure that this target\'s Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator  platform. (in target \'image_picker\' from project \'Pods\')\nwarning: Mapping architecture arm64 to x86_64. Ensure that this target\'s Architectures and Valid Architectures build settings are configured correctly for the iOS  Simulator platform. (in target \'image_picker\' from project \'Pods\')\nwarning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in  the Runner editor. (in target \'Runner\' from project \'Runner\')\nCould not build the application for the simulator.\nError launching application on iPhone 11 Pro Max.\nExited (sigterm)\n
Run Code Online (Sandbox Code Playgroud)\n\n

伙计们,我找不到解决方案。请尽可能帮助我。提前致谢。

\n

Oma*_*att 5

该错误error: unable to read property list from file: Info.plist通常是由于 plist 文件中缺少配置引起的。正如前面在评论中提到的,您需要在 上设置一个值NSLocationWhenInUseUsageDescription包的文档中解释了更多详细信息。

<key>NSLocationWhenInUseUsageDescription</key>
<string>[Your explanation here]</string>
Run Code Online (Sandbox Code Playgroud)