Bug 36238 - [XS 5.10 and XI 9.2] "Project Options -> iOS IPA Options -> Include iTunesArtwork images and the iTunesMetadata.plist" sets the "IpaIncludeArtwork" property incorrectly compared to the default behavior of the Xamarin.iOS build targets
Summary: [XS 5.10 and XI 9.2] "Project Options -> iOS IPA Options -> Include iTunesArt...
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild (show other bugs)
Version: XI 9.2
Hardware: PC Mac OS
: --- normal
Target Milestone: C6SR1
Assignee: Bugzilla
URL:
Depends on:
Blocks: 36403
  Show dependency tree
 
Reported: 2015-11-25 02:46 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2016-01-17 04:12 UTC (History)
3 users (show)

Tags: BZRC6S1_C5SR5S1
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Brendan Zagaeski (Xamarin Team, assistant) 2015-11-25 02:46:32 UTC
[XS 5.10 and XI 9.2] "Project Options -> iOS IPA Options -> Include iTunesArtwork images and the iTunesMetadata.plist" sets the "IpaIncludeArtwork" property incorrectly compared to the default behavior of the Xamarin.iOS build targets


As with the superficially similar non-public Bug 36060 about the "Include Artwork in IPA" checkbox in Visual Studio, this bug can lead to the old familiar "Disallowed paths ( "iTunesMetadata.plist" ) found" error when a user uploads an IPA to iTunesConnect.




## Possible workarounds

### Option 1: edit the `.csproj` file by hand to set the `IpaIncludeArtwork` property to false

Find the `<PropertyGroup Condition=" '$(Configuration)|$(Platform)'` section that matches the configuration your using to build the IPA, and add the following line within that section:

<IpaIncludeArtwork>False</IpaIncludeArtwork>




### Option 2: Remove the `iTunesMetadata.plist` file from the `.ipa` file by hand before submitting it

The `.ipa` file is just a ZIP archive. For this bug, the problematic file is located under in the root of the zip file.

So to remove the file:

1. Unzip the `.ipa` file (for example, change the extension temporarily to `.zip`).

2. Delete the `iTunesMetadata.plist` file.

3. Zip up the remaining files into a new zip archive, and rename the new archive from `.zip` back to `.ipa`
(Important: the "Payload" folder must appear in the top level of zip archive)




## Explanation (it is unfortunately a bit complicated)

1. The iOS build logic has always (as far back as Xamarin.iOS 8.10) defaulted to setting IpaIncludeArtwork to True if the property has not been explicitly specified in the `.csproj` file.


2. Xamarin Studio has (as far back as Xamarin Studio 5.8.3) behaved incorrectly with respect to (1): it _removes_ the `<IpaIncludeArtwork>` element if the user sets the property to False via the GUI project properties. This means that there is currently _no way_ to set the property to False via the GUI in Xamarin Studio.


3. The reason (2) has only started causing problems in Cycle 6 is that the IPA build logic has been _corrected_ in Xamarin.iOS 9.2 so that it now properly respects the `IpaIncludeArtwork` element. Unfortunately this _fix_ has exposed the other older problem with the IDE project properties (2).




(4. To make things even more complicated, XamarinVS 4.0 also broke its own, slightly different implementation of the GUI project property for IpaIncludeArtwork. In XamarinVS 3.11, XamarinVS would add the `IpaIncludeArtwork` property to the `.csproj` any time the user saved the settings on the "iOS IPA Options" tab, for either true or False and True values. XamarinVS 3.11 also correctly displayed the default state of the property as True. In the initial release of XamarinVS 4.0, the "Include Artwork in IPA" checkbox _broke_ so that it had no effect whatsoever. That "checkbox breakage" has now been restored to the XamarinVS 3.11 behavior by the fix for non-public Bug 36060, currently scheduled to be release in the upcoming Cycle 6 – Service Release 1.)




## Table of behaviors for various IDE versions

In the hopes that it might clear up some of the subtlety about this bug, here is a table of the behaviors of various IDE versions with respect to the <IpaIncludeArtwork> property.


> IDE Version                   Shows "True" in project properties     Setting <IpaIncludeArtwork> to       Setting <IpaIncludeArtwork> to
>                               when <IpaIncludeArtwork> is absent?    False in the project properties      True in the project properties
>                                                                      saves the change correctly to the    saves the change correctly to the
>                                                                      .cpsroj?                             .cpsroj?
>  
> XS 5.8                        NO                                     NO                                   YES
> XS 5.10                       NO                                     NO                                   YES
>  
> XVS 3.11 "Cycle 5"            YES                                    YES                                  YES
> XVS 4.0 "Cycle 6"             NO                                     NO                                   NO
> XVS 4.0 plus Bug 36060 fix    YES                                    YES                                  YES




## Possible fixes

(A) Change the Xamarin Studio behavior to match the XamarinVS behavior, so that it correctly interprets the absence of the property as True rather than False, and so that setting the property to False correctly _adds_ a <IpaIncludeArtwork> element to the `.csproj` file.

or

(B) Reverse the iOS build logic to set IpaIncludeArtwork to _False_ by default. In that case, Xamarin Studio wouldn't need any changes, but XamarinVS would need to be updated to match the new behavior.




## Regression status: this is in some sense a "compatibility regression" in Xamarin Studio 5.10 caused by Xamarin.iOS 9.2

BAD:  Xamarin.iOS 9.2.1.52 (d070a7b)
BAD:  Xamarin.iOS 9.2.1.21 (9ce9e8b)
GOOD: Xamarin.iOS 9.1.0.27 (1f068b4)
Comment 3 Jeffrey Stedfast 2015-11-25 07:24:15 UTC
The MSBuild logic should default to False.
Comment 4 Jeffrey Stedfast 2015-11-30 16:55:38 UTC
fixed in git master
Comment 5 Brendan Zagaeski (Xamarin Team, assistant) 2015-12-02 19:16:58 UTC
Just to add a few keywords to this bug report until the fix is released, this problem can also cause an error very similar to the "iTunesMetadata.plist" error, but for "iTunesArtwork":

> Disallowed paths ( "iTunesArtwork" ) found at ...
Comment 9 Brendan Zagaeski (Xamarin Team, assistant) 2016-01-17 02:12:45 UTC
## Status update for any users CC'd on the bug

The candidate fix for this issue is included in the latest Alpha version of "Cycle 6 - Service Release 1" [1].

[1] https://releases.xamarin.com/alpha-preview-2-cycle-6-service-release-1/