我希望有人可以在這裏幫忙。我有這樣的Xcode /團結項目,每次我試圖建立它,我得到這個錯誤:NSPhotoLibraryAddUsageDescription錯誤
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryAddUsageDescription key with a string value explaining to the user how the app uses this data.
我明白,在我的info.plist我需要說明的使用相機,圖書館等,但作爲據我所知,我有這個嗎?
這裏是我的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>MyGame</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon57x57.png</string>
<string>[email protected]</string>
<string>[email protected]</string>
<string>[email protected]~ipad.png</string>
<string>AppIcon72x72~ipad.png</string>
<string>[email protected]~ipad.png</string>
<string>AppIcon76x76~ipad.png</string>
</array>
<key>CFBundleIdentifier</key>
<string>com.mycompany.${PRODUCT_NAME}</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.3</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true />
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true />
</dict>
<key>UIApplicationExitsOnSuspend</key>
<false />
<key>UILaunchStoryboardName~ipad</key>
<string>LaunchScreen-iPad</string>
<key>UILaunchStoryboardName~iphone</key>
<string>LaunchScreen-iPhone</string>
<key>UILaunchStoryboardName~ipod</key>
<string>LaunchScreen-iPhone</string>
<key>UIPrerenderedIcon</key>
<false />
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIRequiresFullScreen</key>
<true />
<key>UIRequiresPersistentWiFi</key>
<false />
<key>UIStatusBarHidden</key>
<true />
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleDefault</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>Unity_LoadingActivityIndicatorStyle</key>
<integer>-1</integer>
<key>UnityCloudProjectID</key>
<string>xxx-xxx-xxx-xxx-xxx</string>
<key>UnityCrashSubmissionURL</key>
<string>https://a:[email protected]/symbolicate</string>
<key>NSCameraUsageDescription</key>
<string>Used for profile image</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Used for profile image</string>
<key>FacebookAppID</key>
<string>xxxxx</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>facebook-unity-sdk</string>
<key>CFBundleURLSchemes</key>
<array>
<string>xxxxx</string>
</array>
</dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
</dict>
</plist>
正如你所看到的,我確實有描述在裏面?!?!
當查看裏面Xcode中的Info.plist它看起來像這樣
真的希望有人能幫助我在這個問題上,以及在此先感謝:-)
錯誤表示您的plist需要具有'NSPhotoLibraryAddUsageDescription'條目,並且您的plist沒有它。對這個錯誤究竟有什麼不清楚? –
[iOS 11中的照片捕獲權限問題]的可能重複(https://stackoverflow.com/questions/44527321/photo-capture-permission-problems-in-ios-11) –