xcode 意外的键“NSLocationWhenInUseUsageDescription”

chhqkbe1  于 2022-12-05  发布在  其他
关注(0)|答案(1)|浏览(169)

我想如果有人能帮我解决这个问题。
当我运行命令ionic cap buils ios时,我得到这个错误,当我在xcode中打开项目时,info.plist文件似乎不可见。

`
[fatal] Error: Unexpected key "NSLocationWhenInUseUsageDescription" while parsing <dict/>.
[capacitor]     at invariant (/Users/ivanpala/Desktop/mascotas-anuncios-main/node_modules/plist/lib/parse.js:53:11)
[capacitor]     at parsePlistXML (/Users/ivanpala/Desktop/mascotas-anuncios-main/node_modules/plist/lib/parse.js:121:9)
[capacitor]     at parsePlistXML (/Users/ivanpala/Desktop/mascotas-anuncios-main/node_modules/plist/lib/parse.js:101:23)
[capacitor]     at Object.parse (/Users/ivanpala/Desktop/mascotas-anuncios-main/node_modules/plist/lib/parse.js:71:15)
[capacitor]     at logiOSPlist (/Users/ivanpala/Desktop/mascotas-anuncios-main/node_modules/@capacitor/cli/dist/cordova.js:273:43)`

我试着在谷歌和不同的论坛上寻找信息,但我找不到这个问题的解决方案,如果有人理解这个错误,并能指导我,我将不胜感激。
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>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
        <string>Mascota Anuncios</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>CFBundleVersion</key>
    <string>1</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Necesitamos acceder a la ubicacion para obtener una info precisa de su ubicacion actual</string>
    <true/>
</dict>
</plist>
cgfeq70w

cgfeq70w1#

这似乎解决了错误,只是现在出现了这些警告。

</array> <key>UIViewControllerBasedStatusBarAppearance</key> <true/> <key>NSLocationWhenInUseUsageDescription</key> <string>Necesitamos acceder a la ubicación para obtener una información precisa de su ubicación actual</string> </dict>

[capacitor] [warn] Configuration required for cordova-plugin-x-socialsharing.
[capacitor]        Add the following to Info.plist:
[capacitor]        <key>NSPhotoLibraryAddUsageDescription</key>
[capacitor]        <string>$PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION</string>
[capacitor]        
[capacitor] [warn] Configuration required for cordova-plugin-x-socialsharing.
[capacitor]        Add the following to Info.plist:
[capacitor]        <key>NSPhotoLibraryUsageDescription</key>
[capacitor]        <string>$PHOTO_LIBRARY_USAGE_DESCRIPTION</string>
[capacitor]        
[capacitor] [warn] Configuration required for ionic-plugin-deeplinks.
[capacitor]        Add the following to Info.plist:
[capacitor]        <key>CFBundleURLTypes</key>
[capacitor]        <array>
[capacitor]        <dict>
[capacitor]        <key>CFBundleURLSchemes</key>
[capacitor]        <array>
[capacitor]        <string>$URL_SCHEME</string>
[capacitor]        </array>
[capacitor]        </dict>
[capacitor]        </array>
[capacitor]        
[capacitor] [warn] Configuration required for cordova-plugin-googleplus.
[capacitor]        Add the following to Info.plist:
[capacitor]        <key>CFBundleURLTypes</key>
[capacitor]        <array>
[capacitor]        <dict>
[capacitor]        <key>CFBundleTypeRole</key>
[capacitor]        <key>CFBundleURLName</key>
[capacitor]        <key>CFBundleURLSchemes</key>
[capacitor]        <string>Editor</string>
[capacitor]        <string>REVERSED_CLIENT_ID</string>
[capacitor]        <array>
[capacitor]        <string>$REVERSED_CLIENT_ID</string>
[capacitor]        </array>
[capacitor]        </dict>
[capacitor]        </array>
[capacitor]        
[capacitor] [warn] Configuration required for onesignal-cordova-plugin.
[capacitor]        Add the following to Info.plist:
[capacitor]        <key>UIBackgroundModes</key>
[capacitor]        <array>
[capacitor]        <string>remote-notification</string>
[capacitor]        </array>
[capacitor]  

  I have to add those lines in info.plist as the message says, copy and paste I don't know much about this info.plist file between which labels I should put if they are to be copied.

相关问题