UE4.9 Unable to import iOS MobileProvision

Clean install of UE 4.9.2

OSX 10.10.3

Xcode 6.3

I seem to have a new version of a problem that’s reported in a few places here…

Opening the project’s iOS settings finds two valid signing certificates fine (doesn’t green-check either of them though)

Provision-wise, I just get “No Provisions Found. Please Import a Provision.”
Importing one (wildcard, which is working on non-unreal projects, matching the app’s bundle company name) seems to attempt to load it, but then reverts to the same message.

Packaging for iOS flags errors about the absent provision (and the not-checked signing key), but then goes ahead and packages, finishing by pulling a (arbitarily chosen?) provision and signing key from xcode and outputting a working .ipa.

Launching, on the other hand, doesn’t happen, so I can’t do nice things like profiling.

When first opening the iOS settings, there’s an interesting bit of log after getting the signing certificates…

LogTemp:Display: IPP ERROR: Application exception: System.Xml.XmlException: unexpected end of file. Current depth is 4  Line 48, position 9.
LogTemp:Display:   at Mono.Xml2.XmlTextReader.ReadContent () [0x00000] in <filename unknown>:0 
LogTemp:Display:   at Mono.Xml2.XmlTextReader.Read () [0x00000] in <filename unknown>:0 
LogTemp:Display:   at System.Xml.XmlTextReader.Read () [0x00000] in <filename unknown>:0 
LogTemp:Display:   at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
LogTemp:Display:   at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
LogTemp:Display:   at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
LogTemp:Display:   at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
LogTemp:Display:   at System.Xml.XmlDocument.ReadNode (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
LogTemp:Display:   at System.Xml.XmlDocument.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
LogTemp:Display:   at System.Xml.XmlDocument.LoadXml (System.String xml) [0x00000] in <filename unknown>:0 
LogTemp:Display:   at iPhonePackager.Utilities+PListHelper..ctor (System.String Source) [0x00000] in <filename unknown>:0 
LogTemp:Display:   at iPhonePackager.MobileProvision..ctor (System.String EmbeddedPListText) [0x00000] in <filename unknown>:0 
LogTemp:Display:   at iPhonePackager.MobileProvisionParser.ParseFile (System.Byte[] RawData) [0x00000] in <filename unknown>:0 
LogTemp:Display:   at iPhonePackager.MobileProvisionParser.ParseFile (System.IO.Stream InputStream) [0x00000] in <filename unknown>:0 
LogTemp:Display:   at iPhonePackager.MobileProvisionParser.ParseFile (System.String Filename) [0x00000] in <filename unknown>:0 
LogTemp:Display:   at iPhonePackager.CodeSignatureBuilder.FindProvisions (System.String CFBundleIdentifier) [0x00000] in <filename unknown>:0 
LogTemp:Display:   at iPhonePackager.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 

(similarly, an experiment trying the settings - or the iPhonePackager - in Windows rather than OSX side gets a dialog “Unexpected end of file has occurred. The following elements are not closed: data, array, dict, plist. Line 48, position 9. while trying to install a mobile provision” when attempting to import a provision)

I’ve had a poke around the project and engine directories, but can’t find any files containing both data and array tags.

When actually trying to import the provision under OSX, there’s a different issue, which also seems to be coming from something Mono-related:-

IPP ERROR: Application exception: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeEngine ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeWin32Classic ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.KnownColors ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: libgdiplus.dylib

Any ideas where to go from here?

TIA

Fred

Update, having grabbed the source and debugged a bit: The main problem’s in MobileProvisionUtilities.cs, MobileProvisionParser, specifically

“// Back up two bytes and read a two byte little endian plist size”

Our plist size runs to three bytes thanks to a large (60-entry) “DeveloperCertificates” array, so the XML parse is running off truncated data.

Establishing whether it’s 2 or 3 bytes looks to require better knowledge of the mobileprovision’s header format - Perhaps looking for the closure of the plist tag would be a better approach?

ttfn

Fred