Bug 38635 - Missing Assets in IPA bundle
Summary: Missing Assets in IPA bundle
Status: RESOLVED DUPLICATE of bug 39137
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild ()
Version: XI 9.2
Hardware: PC Mac OS
: High normal
Target Milestone: (C7)
Assignee: Adrian Alonso
URL:
: 38704 ()
Depends on:
Blocks:
 
Reported: 2016-02-10 15:26 UTC by Dillon Buchananq
Modified: 2016-03-21 15:55 UTC (History)
8 users (show)

Tags:
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:
RESOLVED DUPLICATE of bug 39137

Description Dillon Buchananq 2016-02-10 15:26:05 UTC
I've attached a Zip with two IPA archives inside which were signed for App Store distribution. On suffixed with "good" and one with "bad". These are archives of the exact same code base and commit of my project (except for the Info.properties - which I increased it's version for the next release).

Please unzip both IPAs and inspect the contents of their bundle. Notice anything odd about the "bad" compared to the "good"? I sure do, and so do my users.

In the "bad" version, the "Markdown" folder is missing (with it's contents) and the "MonoTouch.SlideoutNavigation.bundle" is also missing! These were not missing during testing, but magically didn't get bundled during App Store distribution - of which I can't test due to how it's signed. The "good" version, bundled later after this disaster, has the required assets. Again, this is the exact same code just bundled twice which now begs the question, how the hell does something like this happen? Did Xamarin really not notice, or complain, that assets were missing in the release version? Do we need to manually inspect every IPA that goes out and make sure every asset we need exists in the bundle?
Comment 1 Rolf Bjarne Kvinge [MSFT] 2016-02-10 17:34:05 UTC
This sounds like something we've hotfixed in the stable channel recently: https://releases.xamarin.com/xamarin-ios-stable-hotfix-for-missing-storyboard-issue/

Which version of Xamarin.iOS was used to build the broken IPA? Can you get the complete version information from Xamarin Studio's About menu?
Comment 2 Dillon Buchananq 2016-02-11 14:35:01 UTC
Xamarin Studio
Version 5.10.2 (build 56)
Installation UUID: 40092b7e-459f-4111-aa2e-40816f060767
Runtime:
	Mono 4.2.2 (explicit/996df3c)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402020030

Xamarin.Profiler
Version: 0.24.0.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Xamarin.Android
Version: 6.0.0.34 (Business Edition)
Android SDK: /Users/dillonb/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.4   (API level 19)
		5.1   (API level 22)

SDK Tools Version: 24.3.3
SDK Platform Tools Version: 22.0.0
SDK Build Tools Version: 22.0.1

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Xamarin Android Player
Not Installed

Apple Developer Tools
Xcode 7.2 (9548)
Build 7C68

Xamarin.iOS
Version: 9.4.1.25 (Business Edition)
Hash: 962a050
Branch: master
Build date: 2016-01-29 16:59:11-0500

Xamarin.Mac
Not Installed

Build Information
Release ID: 510020056
Git revision: bb74ff467c62ded42b7b7ac7fdd2edc60f8647b0
Build date: 2016-01-26 16:24:41-05
Xamarin addins: 8b797d7ba24d5abab226c2cf9fda77f666263f1b
Build lane: monodevelop-lion-cycle6-c6sr1

Operating System
Mac OS X 10.11.1
Darwin Dillons-Mini.cable.rcn.com 15.0.0 Darwin Kernel Version 15.0.0
    Sat Sep 19 15:53:46 PDT 2015
    root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64
Comment 3 Rolf Bjarne Kvinge [MSFT] 2016-02-11 14:49:11 UTC
It looks like you have the latest hotfix, so I'm reopening this.

@Jeff, any idea what this might be?
Comment 4 Jeffrey Stedfast 2016-02-11 15:34:11 UTC
Same bug but different build action? Ask @kzu.
Comment 6 Brendan Zagaeski (Xamarin Team, assistant) 2016-02-12 03:46:17 UTC
## Probably a duplicate of Bug 38244?


I can replicate Bug 38244 using the original test case for this bug. In fact, my testing on this new sample revealed that Bug 38244 is more general than I thought. I have increased that bug's severity accordingly. (Note that that bug is not a regression (it happens as far back as the Cycle 4, iOS 9.3 release). It is perhaps a little surprising that it was never reported against an earlier version.) 




## Replicating Bug 38244 using the original test case (https://github.com/thedillonb/CodeBucket) and Xamarin.iOS 9.4.1.25



### Clean Build: GOOD

1. Start with a fresh checkout of commit bb1d8ff5b1ebae3c9d8fbeb1476b3c20d7446291.

2. Open the project in Xamarin Studio, and set the configuration to "AppStore|iPhone".

3. "Build -> Archive for Publishing".

4. "Sign and Distribute".


The IPA file contains `Payload/CodeBucketiOS.app/Markdown/` and its 3 subfiles, as well as `Payload/CodeBucketiOS.app/MonoTouch.SlideoutNavigation.bundle/` and its 2 `.png` subfiles.


- (I also tried the same steps, but used the "Build iTunes Package Archive" setting to create the IPA. The IPA contents were the same as when using "Sign and Distribute".)

- (I also tried the same steps, but used the "Build iTunes Package Archive" and built from the command line using `xbuild`. Again the IPA contents were the same.)



### "Dirty" Build: BAD (due to Bug 38244)

1. Clean the checkout with `git clean -xfd -e packages -e Components`.

2. Open the project in Xamarin Studio, and set the configuration to "AppStore|iPhone".

3. Introduce a syntax error in `AppDelegate.cs`, as in Bug 38206, Comment 10.

4. "Build -> Archive for Publishing".

5. Remove the syntax error.

6. "Build -> Archive for Publishing".

7. "Sign and Distribute".


The IPA file is missing `Payload/CodeBucketiOS.app/MonoTouch.SlideoutNavigation.bundle/` and its 2 `.png` subfiles.


- (I also tried the same steps, but used the "Build iTunes Package Archive" setting to create the IPA. The IPA contents were the same as when using "Sign and Distribute".)

- (I also tried the same steps, but used the "Build iTunes Package Archive" and built from the command line using `xbuild`. Again the IPA contents were the same.)




## Unresolved questions

I was not able to create an IPA that was missing the `Markdown` folder in any of my tests. So there still is some mystery about how that folder might have been omitted from the original "bad" IPA.


In an effort to replicate that problem, I tested all 3 variations of the "BAD" steps on two different Xamarin.iOS versions:

(a) The latest stable version Xamarin.iOS 9.4.1.25 that includes the hotfix for Bug 38206.

(b) The previous stable version Xamarin.iOS 9.4.1.24. In this case the `.ipa` file was missing all the "AppIcon", `.storyboardc` directories, and `.nib` files due to Bug 38206, but it did contain the `Markdown` folder and its subfiles.
Comment 7 Brendan Zagaeski (Xamarin Team, assistant) 2016-02-12 03:53:50 UTC
@Dillon, if you have any hints about additional steps you might have followed that we should test to see if we can produce an `.ipa` file that excludes the `Markdown` folder, be sure to let us know. Based on my testing in Comment 6, it looks like the issue with the `.bundle` folder should be addressed by the eventual fix for Bug 38244, but if there is another bug that can be uncovered related to the `Markdown` folder, that would be good to know too. Thanks!


Best,
Brendan
Xamarin Customer Support
Comment 8 Brendan Zagaeski (Xamarin Team, assistant) 2016-02-12 04:11:50 UTC
> Did Xamarin really not notice, or complain, that assets were missing in the release version?

Unfortunately, the logic to test whether there are missing assets would be precisely the same as the logic used by the build process. For example, if there are any `.png` files included in the project that are marked with a build action of "None", then the warning logic would need to know to skip those.

Note that the build process will indeed _fail_ if it is unable to copy a certain resource into the `.app` bundle. But if the build process _succeeds_ without error, that means the logic that determines which assets are supposed to be included does "believe" that all the assets were included correctly. Unfortunately, Bug 38244 is an edge case where the current build process does _not_ determine the full list of assets correctly.
Comment 9 renan jegouzo 2016-02-12 05:58:20 UTC
I think most people like me, are aware of the fuzziness of Xamarin tools, and do a clean all/build all at each build to be sure, and with a double check in case of distribution builds..
Comment 10 renan jegouzo 2016-02-12 05:58:20 UTC
I think most people like me, are aware of the fuzziness of Xamarin tools, and do a clean all/build all at each build to be sure, and with a double check in case of distribution builds..
Comment 11 renan jegouzo 2016-02-12 06:02:00 UTC
this bug is here from a near always, if you have problem during the build you need to clean all/rebuild all to be sure asset are embedded.
Comment 12 Jeffrey Stedfast 2016-02-19 15:30:29 UTC
*** Bug 38704 has been marked as a duplicate of this bug. ***
Comment 13 Vincent Dondain [MSFT] 2016-03-02 17:04:28 UTC
This should be fixed as part of bug the actool fixes I introduced in maccore/c13734b54062e610086a8277843b3d5dab4fe4d2

*** This bug has been marked as a duplicate of bug 39137 ***