UIFileSharingEnabled key in Info.plist

那年仲夏 提交于 2020-01-03 04:54:02

问题


I added the key UIFileSharingEnabled to my app's version info as described here so my users can save files to my apps documents folder. Works great in testing. Tried to upload to apple store with Application Loader and i'm getting an ERROR ITMS-90039: "Type Mismatch. The value for the Info.plist key UIFileSharingEnabled is not of the required type for that key.. I've googled and found where other folks had problems with it but none of their solutions helped. Here are the ways i've tried to show this key in the Info.plist:

<key>UIFileSharingEnabled</key>
<string>true</string>

<key>UIFileSharingEnabled</key>
<true/>

<key>UIFileSharingEnabled</key>
<string>YES</string>

<key>UIFileSharingEnabled</key>
<YES/>

All have the same result, Application Loader barfs out the ERROR ITMS-90039. This key is a boolean key and for other boolean keys in Info.plist they just look like that top one i show. Anyone have a sample Info.plist with this key true that we can compare too?

I've built my app in Rad Studio 10.3.2 (C++ Builder). They key works with test builds on the phone.


回答1:


Got it working and here is the deal: The Info.plist file in the iOSDevice64\Release folder is just for your info, it is not what gets uploaded to apple in the Application Loader. The Info.plist that gets uploaded is inside the .ipa file that is created when you build a Release version in Rad Studio and it gets signed so you obviously can't modify it.

The solution was to edit the info.plist.TemplateiOS.xml that is in my app's project folder. The keys you put in Project->Options-Application->Version Info get added to this info.plist.TemplateiOS.xml when you build. So, I edited this template file and put the correct key representation in between <%ExtraInfoPListKeys%> and the last </dict>:

<?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>
<%VersionInfoPListKeys%>
<%ExtraInfoPListKeys%>
<key>UIFileSharingEnabled</key>
<true/>
</dict>
</plist>

If you just put the UIFileSharingEnabled key in the Project->Options-Application->Version Info it will end up in the Info.plist like below which is wrong and Application Loader will give that error:

 <key>UIFileSharingEnabled</key>
 <string>true</string>

The key must be like below to work on Release that you submit to app store:

<key>UIFileSharingEnabled</key>
<true/>


来源:https://stackoverflow.com/questions/57932283/uifilesharingenabled-key-in-info-plist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!