This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 52165 - Non clean build yields a sealed resource is missing or invalid
Summary: Non clean build yields a sealed resource is missing or invalid
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild (show other bugs)
Version: XI 10.4 (C9)
Hardware: PC Mac OS
: --- normal
Target Milestone: (C9)
Assignee: Jeffrey Stedfast
URL:
: 52059 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-02-01 00:19 UTC by t9mike
Modified: 2017-03-21 04:36 UTC (History)
12 users (show)

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


Attachments
Build log (198.15 KB, text/plain)
2017-02-01 00:19 UTC, t9mike
Details

Description t9mike 2017-02-01 00:19:07 UTC
Created attachment 19672 [details]
Build log

I can build fine if I do a clean build. But if I make edit and then build again, I always get a sealed resource is missing or invalid. This makes it incredibly **slow and tedious** to update my app.

Key Snippet:

	Target _CodesignVerify:
		CodesignVerify Task
		  CodesignAllocate: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
		  Resource: bin/iPhone/Debug/SundialWatchApp.app
		Tool /usr/bin/codesign execution started with arguments: --verify -vvvv -R='anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.1] exists and (certificate leaf[field.1.2.840.113635.100.6.1.2] exists or certificate leaf[field.1.2.840.113635.100.6.1.4] exists)' bin/iPhone/Debug/SundialWatchApp.app 
		bin/iPhone/Debug/SundialWatchApp.app: a sealed resource is missing or invalid
		file modified: /Users/xxx/Mike/Git/Main2/Projects/SundialWatchApp/App/WatchApp/bin/iPhone/Debug/SundialWatchApp.app/PlugIns/SundialWatchAppExtension.appex/.monotouch-32/SundialWatchAppExtension.armv7k.aotdata
		file modified: /Users/xxx/Mike/Git/Main2/Projects/SundialWatchApp/App/WatchApp/bin/iPhone/Debug/SundialWatchApp.app/PlugIns/SundialWatchAppExtension.appex/.monotouch-32/SundialWatchAppExtension.dll.mdb
		file modified: /Users/xxx/Mike/Git/Main2/Projects/SundialWatchApp/App/WatchApp/bin/iPhone/Debug/SundialWatchApp.app/PlugIns/SundialWatchAppExtension.appex/.monotouch-32/SundialWatchAppExtension.dll
		file modified: /Users/xxx/Mike/Git/Main2/Projects/SundialWatchApp/App/WatchApp/bin/iPhone/Debug/SundialWatchApp.app/PlugIns/SundialWatchAppExtension.appex/_CodeSignature/CodeResources
		file modified: /Users/xxx/Mike/Git/Main2/Projects/SundialWatchApp/App/WatchApp/bin/iPhone/Debug/SundialWatchApp.app/PlugIns/SundialWatchAppExtension.appex/libSundialWatchAppExtension.dll.dylib
		file modified: /Users/xxx/Mike/Git/Main2/Projects/SundialWatchApp/App/WatchApp/bin/iPhone/Debug/SundialWatchApp.app/PlugIns/SundialWatchAppExtension.appex/SundialWatchAppExtension
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: error : Tool exited with code: 1. Output: bin/iPhone/Debug/SundialWatchApp.app: a sealed resource is missing or invalid
file modified: /Users/xxx/Mike/Git/Main2/Projects/SundialWatchApp/App/WatchApp/bin/iPhone/Debug/SundialWatchApp.app/PlugIns/SundialWatchAppExtension.appex/.monotouch-32/SundialWatchAppExtension.armv7k.aotdata
file modified: /Users/xxx/Mike/Git/Main2/Projects/SundialWatchApp/App/WatchApp/bin/iPhone/Debug/SundialWatchApp.app/PlugIns/SundialWatchAppExtension.appex/.monotouch-32/SundialWatchAppExtension.dll.mdb
file modified: /Users/xxx/Mike/Git/Main2/Projects/SundialWatchApp/App/WatchApp/bin/iPhone/Debug/SundialWatchApp.app/PlugIns/SundialWatchAppExtension.appex/.monotouch-32/SundialWatchAppExtension.dll
file modified: /Users/xxx/Mike/Git/Main2/Projects/SundialWatchApp/App/WatchApp/bin/iPhone/Debug/SundialWatchApp.app/PlugIns/SundialWatchAppExtension.appex/_CodeSignature/CodeResources
file modified: /Users/xxx/Mike/Git/Main2/Projects/SundialWatchApp/App/WatchApp/bin/iPhone/Debug/SundialWatchApp.app/PlugIns/SundialWatchAppExtension.appex/libSundialWatchAppExtension.dll.dylib
file modified: /Users/xxx/Mike/Git/Main2/Projects/SundialWatchApp/App/WatchApp/bin/iPhone/Debug/SundialWatchApp.app/PlugIns/SundialWatchAppExtension.appex/SundialWatchAppExtension

Full log attached.
Comment 1 Alex Soto 2017-02-01 03:46:33 UTC
Hello Mike

Thanks for contacting us, Is there any chance you could share a reproducible test case for this? Or instruct us on how to reproduce it. Also please share with us your version information.

The easiest way to get exact version information is to use the 
"Xamarin Studio" menu, "About Xamarin Studio" item, "Show Details" 
button and copy/paste the version informations (you can use the 
"Copy Information" button).
Comment 2 Rolf Bjarne Kvinge [MSFT] 2017-02-01 08:26:40 UTC
This happened here: https://bugzilla.xamarin.com/show_bug.cgi?id=52059#c2, where we have a test project.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2017-02-01 08:26:58 UTC
@Jeff, can you have a look at this?
Comment 4 Jeffrey Stedfast 2017-02-01 16:24:06 UTC
It looks like the main app bundle wasn't re-codesigned because nothing in the main app bundle itself changed. Instead, what changed was one of the appex's.
Comment 5 t9mike 2017-02-01 17:33:14 UTC
Let me know if you need a test case. I can't see https://bugzilla.xamarin.com/show_bug.cgi?id=52059#c2 but it sounds like you have another example.
Comment 6 Jeffrey Stedfast 2017-02-01 18:19:11 UTC
I've created a simple project that can recreate this:

1. File -> New Project -> iOS -> Single View
2. Right-click on the Solution and Add New Project -> iOS -> Extensions -> Action Extension
3. Add a Project Reference to Action extension from SingleView app (I think this is done automatically, but is here for safety)
4. Build
5. Edit Action extension's ActionViewController.cs and change:

bool imageFound = false;

to:

bool imageFound = true;

6. Build


You'll get the error.
Comment 7 Jeffrey Stedfast 2017-02-01 19:23:43 UTC
I've managed to fix this for cycle9 here: https://github.com/xamarin/xamarin-macios/pull/1612

Working on a fix for cycle10 now.
Comment 8 t9mike 2017-02-02 02:59:20 UTC
I copied new Xamarin.iOS.Common.targets into my Xamarin tree and this resolved the issue. Thank you Jeff for the speedy fix!
Comment 9 Rolf Bjarne Kvinge [MSFT] 2017-02-02 11:34:32 UTC
*** Bug 52059 has been marked as a duplicate of this bug. ***
Comment 10 Jeffrey Stedfast 2017-02-02 17:06:22 UTC
Awesome :)
Comment 11 Sebastien Pouliot 2017-02-03 15:39:36 UTC
PR#1612 (comment #7) was merged.

I opened a different bug to track `master` since the fix will be quite different.
https://bugzilla.xamarin.com/show_bug.cgi?id=52284

QA: please verify *only* on `cycle9`, thanks!
Comment 13 GouriKumari 2017-02-15 19:39:13 UTC
@Jeff:  I am getting this failure with latest cycle9 builds and a few samples.

## Logs:
Build Log: 
https://gist.github.com/GouriKumari/3e2fe10adb0bb48f538bedcec2c2fac0
https://gist.github.com/GouriKumari/6a2a65e1654fb0d79cdd6d5823148d14

## Test Env: https://gist.github.com/GouriKumari/6bc172dadaf21d452d2a640dbd377f24
Comment 14 GouriKumari 2017-02-21 17:08:27 UTC
I couldn't reproduce the issue mentioned in comment #13 with the following test environment, hence I am marking this bug as verified fixed. 

## Test Env:
https://gist.github.com/GouriKumari/656b3eec66c1543d4a703c461b61b529

##Logs:
https://gist.github.com/GouriKumari/33fec255d0f2253776cb130a127052cc
Comment 15 Hussain Abbasi 2017-03-08 19:57:38 UTC
I am able to reproduce this bug in Cycle 9 on XS 6.2. This is not an issue on other projects in the solution as simply rebuilding fixes the issue.

For our UI tests project, the first test run builds and runs fine. Any subsequent build fails with this error:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: Error: Tool exited with code: 1. Output: file added: /Use/SampleAppiOS.app: a sealed resource is missing or invalid"

only on iOS device. It works fine on iOS Simulator and for Android.

Please assist.
Comment 16 Jeffrey Stedfast 2017-03-08 21:52:08 UTC
Does your app bundle have a .uploaded file?

If so, delete that and it'll be fine.
Comment 17 Jeffrey Stedfast 2017-03-09 19:13:50 UTC
I've fixed it so that XS doesn't add the .uploaded file (it should not have been added to the app bundle to begin with) for the next major stable release (6.3 or w/e), but unfortunately the fix has come too late for cycle9 (6.2 series).

On the bright side, 6.3 is supposed to be out in the next few weeks AFAIK.
Comment 18 JR 2017-03-21 04:36:15 UTC
It's a shame we have to wait a few weeks for this fix. Bugs like this really affect developers' productivity. It seems you either need a way to provide rapid fixes, or a much stricter testing regime before release.

Note You need to log in before you can comment on or make changes to this bug.