【问题标题】:Error-> Reading plist: The data couldn’t be read because it isn’t in the correct formatError-> Reading plist: 无法读取数据,因为它的格式不正确
【发布时间】:2021-05-18 11:25:27
【问题描述】:
<?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>
        <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>CFBundleDevelopmentRegion</key>
        <string>en</string>
        <key>CFBundleDisplayName</key>
        <string>kangaroohop</string>
        <key>CFBundleExecutable</key>
        <string>$(EXECUTABLE_NAME)</string>
        <key>CFBundleIdentifier</key>
        <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
        <string>$(PRODUCT_NAME)</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
        <string>1.0</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <string>2</string>
        <key>NSLocationWhenInUseUsageDescription</key>
        <string>This app needs to access your location.</string>
        <key>LSRequiresIPhoneOS</key>
        <true/>
        <key>NSAppTransportSecurity</key>
        <dict>
            <key>NSExceptionDomains</key>
            <dict>
                <key>localhost</key>
                <dict>
                    <key>NSExceptionAllowsInsecureHTTPLoads</key>
                    <true/>
                </dict>
            </dict>
        </dict>
        <!-- <key>NSLocationWhenInUseUsageDescription</key> -->
        <true/>
    <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
    <true/>
        <string/>
        <key>UILaunchStoryboardName</key>
        <string>LaunchScreenIntracept</string>
        <key>UIRequiredDeviceCapabilities</key>
        <array>
            <string>armv7</string>
        </array>
        <key>UISupportedInterfaceOrientations</key>
        <array>
            <string>UIInterfaceOrientationPortrait</string>
            <string>UIInterfaceOrientationLandscapeLeft</string>
            <string>UIInterfaceOrientationLandscapeRight</string>
        </array>
        <key>UIViewControllerBasedStatusBarAppearance</key>
        <false/>
        <key>UIAppFonts</key>
        <array>
            <string>AntDesign.ttf</string>
            <string>Entypo.ttf</string>
            <string>EvilIcons.ttf</string>
            <string>Feather.ttf</string>
            <string>FontAwesome.ttf</string>
            <string>FontAwesome5_Brands.ttf</string>
            <string>FontAwesome5_Regular.ttf</string>
            <string>FontAwesome5_Solid.ttf</string>
            <string>Fontisto.ttf</string>
            <string>Foundation.ttf</string>
            <string>Ionicons.ttf</string>
            <string>MaterialCommunityIcons.ttf</string>
            <string>MaterialIcons.ttf</string>
            <string>Octicons.ttf</string>
            <string>SimpleLineIcons.ttf</string>
            <string>Zocial.ttf</string>
        </array>
    </dict>
    </plist>

我一直在尝试使用 Xcode 构建我的应用程序,但它给了我这个错误。我已经尝试过之前在 StackOverflow 上提到的其他不同的解决方案,但我无法摆脱这个错误。

-> 我使用的是最新版本的 Xcode 12.5

-> 我的 React Native 版本是 0.64.0

-> 我的 info.plist 文件是:

【问题讨论】:

    标签: xcode react-native


    【解决方案1】:

    要解决此问题,您可以将 XML 复制/粘贴到模板项目中。

    问题是您进行了一些手工编辑以注释掉键值对并使 XML 无效

    从第 44-48 行删除以进行修复。该段应为:

         <!-- <key>NSLocationWhenInUseUsageDescription</key> 
            <true/> 
        <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
        <true/>
            <string/> -->
    

    不是

    <!-- <key>NSLocationWhenInUseUsageDescription</key> -->
            <true/>
        <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
        <true/>
            <string/>
    

    这将解决您当前的问题。从那里您可以为 Xcode 编辑器中的两个键添加字符串。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-15
      • 1970-01-01
      • 2019-07-28
      • 2018-04-06
      • 2020-07-26
      • 2021-10-05
      相关资源
      最近更新 更多