Info.plist NSAdvertisingAttributionReportEndpoint bug

Hello,

I'm having the following problem using Xcode 13 - though I'm not sure if this is a Xcode 13 exclusive issue, since I haven't tried with previous versions.

I'm trying to add property NSAdvertisingAttributionReportEndpoint to my iOS app's Info.plist. The value of this property is a string that follows the URL format https://example.com (as explained here).

After the changes, plist looks like this:

However, build fails with the following error:

error: unable to read property list from file: /Users/(redacted)/Library/Developer/Xcode/DerivedData/*(redacted)-fadhvqskytledpbdeobyopzsxmkf/Build/Intermediates.noindex/(redacted)build/Beta-iphoneos/(redacted) iOS Universal.build/Preprocessed-Info.plist: The operation couldn’t be completed. (XCBUtil.PropertyListConversionError error 2.) (in target '(redacted) iOS Universal' from project '(redacted)')

The issue is that the resulting processed plist file content looks like this:

(... beginning of file omitted ...)
 <key>urlScheme</key>
 <string>(redacted)urlscheme</string>
 <key>NSAdvertisingAttributionReportEndpoint</key>
 <string>https:
</dict>
</plist>

NSAdvertisingAttributionReportEndpoint value is skipped from the first pair of slashes it finds, the string tag not even being properly closed, producing a wrongly formatted plist file.

Is there any way to workaround this while I wait for an official fix? I'm not entirely sure how to escape inside a plist file (though I think that this should be done by Xcode upon editing the file maybe?)

Thanks!

Jota

Answered by Jotakun in 688860022

I've managed to workaround it by creating a User-Defined Setting THE_OFFENDING_URL that contains the URL value, and using ${THE_OFFENDING_URL} as the value of NSAdvertisingAttributionReportEndpoint in the plist. Of course, this will only work if you have option "Expand Build Settings in Info.plist File" set to true in your Build Settings.

I've also opened a ticket through Feedback Assistant because this is obviously a Xcode bug.

Your Info.plist seems to have an invalid format, as the string value for NSAdvertisingAttributionReportEndpoint is unterminated.

Viewing Info.plist, I would expect something like this:

And viewing Info.plist as Source Code (so the text can be directly edited), would give this:

<key>NSAdvertisingAttributionReportEndpoint</key>
<string>https://notyou.co.uk</string>

So I suggest you open your Info.plist as Source Code, and add the missing text to the "string" line.

@robnotyou I'm not entirely sure what you're referring to. My plist looks like this:

and source looks like this:

As you can see, the value is not unterminated. Also, even if the value wasn't complete, Xcode should close the value with a anyway, which is what is making me think that this is a bug in Xcode (there might be a way to workaround this escaping the slashes, but not sure how to do it).

Accepted Answer

I've managed to workaround it by creating a User-Defined Setting THE_OFFENDING_URL that contains the URL value, and using ${THE_OFFENDING_URL} as the value of NSAdvertisingAttributionReportEndpoint in the plist. Of course, this will only work if you have option "Expand Build Settings in Info.plist File" set to true in your Build Settings.

I've also opened a ticket through Feedback Assistant because this is obviously a Xcode bug.

Info.plist NSAdvertisingAttributionReportEndpoint bug
 
 
Q