Bug 42247 - Missing image files in application using asset catalog
Summary: Missing image files in application using asset catalog
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 4.1.0 (C7)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Emanuel
URL:
Depends on:
Blocks:
 
Reported: 2016-06-29 12:57 UTC by Kenneth
Modified: 2017-01-02 18:40 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 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 FIXED

Description Kenneth 2016-06-29 12:57:07 UTC
I have a problem with images in my assets folder are gone deploying to device/simulator.

If I create a new project in VS it works the first couple of times, then stops working. The images are simply not present in the application deploying with VS.

It seems to work from Xamarin Studio. 

If I clear the build cache in /Users/xx/Library/Caches/Xamarin/mtbs/bui... it works the first time, and then breaks down again. I have a few interesting log statements. 


Working actool build log:

4>Using "ACTool" task from assembly "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Tasks.dll".
4>Task "ACTool"
4>  ACTool: 2016-06-29T14:41:47.1742591+02:00 - Started
4>  ACTool: 2016-06-29T14:41:47.1877893+02:00 - Initializing
4>  ACTool: 2016-06-29T14:41:47.1877893+02:00 - Initialized
4>  ACTool: 2016-06-29T14:41:47.1902697+02:00 - Determining the modified files that should be copied to the mac (7 files)
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Sending Request Xamarin.Messaging.Build.Contracts.CompareItemsMessage to topic xvs/Build/4.1.1.3/compare-items
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Received Response of Xamarin.Messaging.Build.Contracts.CompareItemsMessage to topic build11024krike/response/xvs/Build/4.1.1.3/compare-items
4>  ACTool: 2016-06-29T14:41:47.2048647+02:00 - Copying files (6 files)
4>  Copying Resources/Media.xcassets/flash.imageset/Contents.json...
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Sending Request Xamarin.Messaging.Build.Contracts.CopyItemMessage to topic xvs/Build/4.1.1.3/copy-item/WMSMobileios/c843ca8%2FContents.json
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Received Response of Xamarin.Messaging.Build.Contracts.CopyItemMessage to topic build11024krike/response/xvs/Build/4.1.1.3/copy-item/WMSMobileios/c843ca8%2FContents.json
4>  Copying Resources/Media.xcassets/flash.imageset/flash.png...
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Sending Request Xamarin.Messaging.Build.Contracts.CopyItemMessage to topic xvs/Build/4.1.1.3/copy-item/WMSMobileios/c843ca8%2Fflash.png
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Received Response of Xamarin.Messaging.Build.Contracts.CopyItemMessage to topic build11024krike/response/xvs/Build/4.1.1.3/copy-item/WMSMobileios/c843ca8%2Fflash.png
4>  Copying Resources/Media.xcassets/mottak.imageset/Contents.json...
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Sending Request Xamarin.Messaging.Build.Contracts.CopyItemMessage to topic xvs/Build/4.1.1.3/copy-item/WMSMobileios/c843ca8%2FContents.json
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Received Response of Xamarin.Messaging.Build.Contracts.CopyItemMessage to topic build11024krike/response/xvs/Build/4.1.1.3/copy-item/WMSMobileios/c843ca8%2FContents.json
4>  Copying Resources/Media.xcassets/mottak.imageset/mottak.png...
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Sending Request Xamarin.Messaging.Build.Contracts.CopyItemMessage to topic xvs/Build/4.1.1.3/copy-item/WMSMobileios/c843ca8%2Fmottak.png
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Received Response of Xamarin.Messaging.Build.Contracts.CopyItemMessage to topic build11024krike/response/xvs/Build/4.1.1.3/copy-item/WMSMobileios/c843ca8%2Fmottak.png
4>  Copying Resources/Media.xcassets/stock.imageset/Contents.json...
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Sending Request Xamarin.Messaging.Build.Contracts.CopyItemMessage to topic xvs/Build/4.1.1.3/copy-item/WMSMobileios/c843ca8%2FContents.json
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Received Response of Xamarin.Messaging.Build.Contracts.CopyItemMessage to topic build11024krike/response/xvs/Build/4.1.1.3/copy-item/WMSMobileios/c843ca8%2FContents.json
4>  Copying Resources/Media.xcassets/stock.imageset/stock.png...
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Sending Request Xamarin.Messaging.Build.Contracts.CopyItemMessage to topic xvs/Build/4.1.1.3/copy-item/WMSMobileios/c843ca8%2Fstock.png
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Received Response of Xamarin.Messaging.Build.Contracts.CopyItemMessage to topic build11024krike/response/xvs/Build/4.1.1.3/copy-item/WMSMobileios/c843ca8%2Fstock.png
4>  ACTool: 2016-06-29T14:41:47.3013804+02:00 - Serializing intputs
4>  ACTool: 2016-06-29T14:41:47.3093561+02:00 - Executing
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Sending Request Xamarin.Messaging.Build.Contracts.ExecuteTaskMessage to topic xvs/Build/4.1.1.3/execute-task/WMSMobileios/c843ca8%2FACTool
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Received Response of Xamarin.Messaging.Build.Contracts.ExecuteTaskMessage to topic build11024krike/response/xvs/Build/4.1.1.3/execute-task/WMSMobileios/c843ca8%2FACTool
4>  ACTool: 2016-06-29T14:41:47.8559724+02:00 - Logging messages
4>  ACTool Task
4>    AppManifest: Info.plist
4>    DeviceModel: <null>
4>    DeviceOSVersion: <null>
4>    ImageAssets:
4>      Resources/Media.xcassets/flash.imageset/Contents.json
4>      Resources/Media.xcassets/flash.imageset/flash.png
4>      Resources/Media.xcassets/mottak.imageset/Contents.json
4>      Resources/Media.xcassets/mottak.imageset/mottak.png
4>      Resources/Media.xcassets/stock.imageset/Contents.json
4>      Resources/Media.xcassets/stock.imageset/stock.png
4>    IntermediateOutputPath: obj/iPhoneSimulator/Debug/
4>    IsWatchApp: False
4>    OptimizePNGs: True
4>    OutputPath: bin/iPhoneSimulator/Debug/
4>    ProjectDir: C:/Utvikling/Xamarin/wms-mobile/WMSMobile.ios
4>    ResourcePrefix: Resources
4>    SdkBinPath: /Applications/Xcode.app/Contents/Developer/usr/bin
4>    SdkPlatform: iPhoneSimulator
4>    SdkVersion: 9.3
4>  Tool /Applications/Xcode.app/Contents/Developer/usr/bin/actool execution started with arguments: --errors --warnings --notices --output-format xml1 --compress-pngs --target-device iphone --minimum-deployment-target 9.3 --platform iphonesimulator --compile /Users/bob/Library/Caches/Xamarin/mtbs/builds/WMSMobileios/c843ca8a13b612b637f630ce1ffce4ab/obj/iPhoneSimulator/Debug/actool/bundle /Users/bob/Library/Caches/Xamarin/mtbs/builds/WMSMobileios/c843ca8a13b612b637f630ce1ffce4ab/Resources/Media.xcassets
4>  Tool /Applications/Xcode.app/Contents/Developer/usr/bin/actool execution finished (exit code = 0).
4>  ACTool: 2016-06-29T14:41:47.8564723+02:00 - Deserializing outputs
4>  ACTool: 2016-06-29T14:41:47.8564723+02:00 - Creating output items
4>  ACTool: 2016-06-29T14:41:47.8724833+02:00 - Finished
4>Done executing task "ACTool".

4>  Copying file from '/Users/bob/Library/Caches/Xamarin/mtbs/builds/WMSMobileios/c843ca8a13b612b637f630ce1ffce4ab/obj/iPhoneSimulator/Debug/actool/bundle/Assets.car' to '/Users/bob/Library/Caches/Xamarin/mtbs/builds/WMSMobileios/c843ca8a13b612b637f630ce1ffce4ab/bin/iPhoneSimulator/Debug/WMSMobileios.app/Assets.car'


The successfull build have an obj/iPhoneSimulator/Debug/actool folder with a bundle folder and the Assets.car. The asset-manifest.plist looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.actool.compilation-results</key>
	<dict>
		<key>output-files</key>
		<array>
			<string>/Users/bob/Library/Caches/Xamarin/mtbs/builds/WMSMobileios/c843ca8a13b612b637f630ce1ffce4ab/obj/iPhoneSimulator/Debug/actool/bundle/Assets.car</string>
		</array>
	</dict>
</dict>


actool not working:

4>Output file "obj\iPhoneSimulator\Debug\actool\_PartialAppManifest.items" does not exist.
4>Using "ACTool" task from assembly "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Tasks.dll".
4>Task "ACTool"
4>  ACTool: 2016-06-29T14:43:59.6521748+02:00 - Started
4>  ACTool: 2016-06-29T14:43:59.6661857+02:00 - Initializing
4>  ACTool: 2016-06-29T14:43:59.6661857+02:00 - Initialized
4>  ACTool: 2016-06-29T14:43:59.6681884+02:00 - Determining the modified files that should be copied to the mac (7 files)
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Sending Request Xamarin.Messaging.Build.Contracts.CompareItemsMessage to topic xvs/Build/4.1.1.3/compare-items
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Received Response of Xamarin.Messaging.Build.Contracts.CompareItemsMessage to topic build1068krike/response/xvs/Build/4.1.1.3/compare-items
4>  ACTool: 2016-06-29T14:43:59.6861995+02:00 - Serializing intputs
4>  ACTool: 2016-06-29T14:43:59.6982076+02:00 - Executing
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Sending Request Xamarin.Messaging.Build.Contracts.ExecuteTaskMessage to topic xvs/Build/4.1.1.3/execute-task/WMSMobileios/c843ca8%2FACTool
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Received Response of Xamarin.Messaging.Build.Contracts.ExecuteTaskMessage to topic build1068krike/response/xvs/Build/4.1.1.3/execute-task/WMSMobileios/c843ca8%2FACTool
4>  ACTool: 2016-06-29T14:43:59.7382365+02:00 - Logging messages
4>  ACTool Task
4>    AppManifest: Info.plist
4>    DeviceModel: <null>
4>    DeviceOSVersion: <null>
4>    ImageAssets:
4>      Resources/Media.xcassets/flash.imageset/Contents.json
4>      Resources/Media.xcassets/flash.imageset/flash.png
4>      Resources/Media.xcassets/mottak.imageset/Contents.json
4>      Resources/Media.xcassets/mottak.imageset/mottak.png
4>      Resources/Media.xcassets/stock.imageset/Contents.json
4>      Resources/Media.xcassets/stock.imageset/stock.png
4>    IntermediateOutputPath: obj/iPhoneSimulator/Debug/
4>    IsWatchApp: False
4>    OptimizePNGs: True
4>    OutputPath: bin/iPhoneSimulator/Debug/
4>    ProjectDir: C:/Utvikling/Xamarin/wms-mobile/WMSMobile.ios
4>    ResourcePrefix: Resources
4>    SdkBinPath: /Applications/Xcode.app/Contents/Developer/usr/bin
4>    SdkPlatform: iPhoneSimulator
4>    SdkVersion: 9.3
4>  Tool /Applications/Xcode.app/Contents/Developer/usr/bin/actool execution started with arguments: --errors --warnings --notices --output-format xml1 --compress-pngs --target-device iphone --minimum-deployment-target 9.3 --platform iphonesimulator --compile /Users/bob/Library/Caches/Xamarin/mtbs/builds/WMSMobileios/c843ca8a13b612b637f630ce1ffce4ab/obj/iPhoneSimulator/Debug/actool/bundle /Users/bob/Library/Caches/Resources/Media.xcassets
4>  Tool /Applications/Xcode.app/Contents/Developer/usr/bin/actool execution finished (exit code = 0).
4>  ACTool: 2016-06-29T14:43:59.7382365+02:00 - Deserializing outputs
4>  ACTool: 2016-06-29T14:43:59.7412395+02:00 - Creating output items
4>  ACTool: 2016-06-29T14:43:59.7432401+02:00 - Finished
4>Done executing task "ACTool".

For the fail build log there are no Asset.car copy.

The failbuild have an obj/iPhoneSimulator/Debug/actool folder with an empty bundle folder, no Assets.car. The asset-manifest.plist looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.actool.compilation-results</key>
	<dict>
		<key>output-files</key>
		<array/>
	</dict>
	<key>com.apple.actool.notices</key>
	<array>
		<dict>
			<key>description</key>
			<string>Failed to read file attributes for "/Users/bob/Library/Caches/Resources/Media.xcassets"</string>
			<key>failure-reason</key>
			<string>No such file or directory</string>
		</dict>
	</array>
</dict>
Comment 1 dsturgeon 2016-06-29 13:05:12 UTC
I'm having the exact same issue with Visual Studio. I have used the current beta and release branches, with the same results.

It seems that deleting ~/Library/Caches/Xamarin/mtbs/builds/{project name} will make the asset catalogs work for a bit in VS, then they randomly stop after 1 to a few builds.

I've reproduced the behavior with projects created in Xamarin Studio and Visual Studio.
Comment 2 Emanuel 2016-07-29 18:18:13 UTC
Hi @Kenneth, thanks for the detailed logs and comments! 

I've tried to reproduce this issue with no luck. I've tried in several ways (i.e. rebuilding all the time, adding/removing images and building, etc) but could not hit it, so I'll need more information to track this issue down.

Could you describe the way you hit it? For instance:
- Are you modifying your assets when you start to hit this issue or these remain untouched?
- Do you rebuild your solution all the time?
- Do you modify your assets and build your project between changes?
- Which Xamarin for Visual Studio and Xamarin iOS versions are you using (you can find this at Help -> About Microsoft Visual Studio)?

Regarding your project structure, I can see in the logs you have 3 imagesets with one image each of these, is this correct?

Lastly, could you try to reproduce this issue with the latest Cycle 8 alpha preview (Xamarin VS 4.2.0.378)?

Thanks!
Comment 3 Kenneth 2016-08-08 09:06:55 UTC
Hi @Emanuel. 

- Modifying does not seem important, it happends either way
- No, I usually build incrementally. It does not seem to make a difference what I do
- Not sure what you are asking for, but modifying assets does not seem to make a difference. They usually ofc stay unmodified, and the error appears either way
- Version information:
------------------------------
Microsoft Visual Studio Professional 2015
Version 14.0.25123.00 Update 2

Microsoft .NET Framework
Version 4.6.01038

Xamarin   4.1.2.18 (fcbe082)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.1.2.21 (1cf254d)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   9.8.2.22 (f37444a)
Visual Studio extension to enable development for Xamarin.iOS.
----------------------

I have 1 asset catalog with several image assets.

Using the latest alpha i get an error with actool:

----------------------------------------
4>  ACTool: 2016-08-08T10:57:17.9454655+02:00 - Started
4>  ACTool: 2016-08-08T10:57:17.9454655+02:00 - Initializing
4>  ACTool: 2016-08-08T10:57:17.9454655+02:00 - Initialized
4>  ACTool: 2016-08-08T10:57:17.9767498+02:00 - Determining the modified files that should be copied to the mac (17 files)
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Sending Request Xamarin.Messaging.Build.Contracts.CompareItemsMessage to topic xvs/Build/4.2.0.413/compare-items
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Received Response of Xamarin.Messaging.Build.Contracts.CompareItemsMessage to topic build11620krike/response/xvs/Build/4.2.0.413/compare-items
4>  ACTool: 2016-08-08T10:57:17.9923404+02:00 - Serializing intputs
4>  ACTool: 2016-08-08T10:57:17.9923404+02:00 - Executing
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Sending Request Xamarin.Messaging.Build.Contracts.ExecuteTaskMessage to topic xvs/Build/4.2.0.413/execute-task/WMSMobileios/c843ca8%2FACTool
4>  Sending Message Xamarin.Messaging.MessageStatusMessage to topic xma/message-status
4>  Received Response of Xamarin.Messaging.Build.Contracts.ExecuteTaskMessage to topic build11620krike/response/xvs/Build/4.2.0.413/execute-task/WMSMobileios/c843ca8%2FACTool
4>  ACTool: 2016-08-08T10:57:18.0392171+02:00 - Logging messages
4>  ACTool Task
4>    AppManifest: Info.plist
4>    DeviceModel: <null>
4>    DeviceOSVersion: <null>
4>    ImageAssets:
4>      Resources/Media.xcassets/AppIcons.appiconset/Contents.json
4>      Resources/Media.xcassets/AppIcons.appiconset/Icon-App-40x40@3x.png
4>      Resources/Media.xcassets/AppIcons.appiconset/Icon-App-60x60@2x.png
4>      Resources/Media.xcassets/AppIcons.appiconset/Icon-App-60x60@3x.png
4>      Resources/Media.xcassets/flash.imageset/Contents.json
4>      Resources/Media.xcassets/flash.imageset/flash.png
4>      Resources/Media.xcassets/logout.imageset/Contents.json
4>      Resources/Media.xcassets/logout.imageset/logout.png
4>      Resources/Media.xcassets/mottak.imageset/Contents.json
4>      Resources/Media.xcassets/mottak.imageset/mottak.png
4>      Resources/Media.xcassets/settings.imageset/Contents.json
4>      Resources/Media.xcassets/settings.imageset/settings.png
4>      Resources/Media.xcassets/stock.imageset/Contents.json
4>      Resources/Media.xcassets/stock.imageset/stock.png
4>      Resources/Media.xcassets/undo.imageset/Contents.json
4>      Resources/Media.xcassets/undo.imageset/undo.png
4>    IntermediateOutputPath: obj/iPhoneSimulator/Debug/
4>    IsWatchApp: False
4>    OptimizePNGs: True
4>    OutputPath: bin/iPhoneSimulator/Debug/
4>    ProjectDir: C:/Utvikling/Xamarin/wms-mobile/WMSMobile.ios
4>    ResourcePrefix: Resources
4>    SdkBinPath: /Applications/Xcode.app/Contents/Developer/usr/bin
4>    SdkPlatform: iPhoneSimulator
4>    SdkVersion: 9.3
4>  Tool /Applications/Xcode.app/Contents/Developer/usr/bin/actool execution started with arguments: --errors --warnings --notices --output-format xml1 --compress-pngs --target-device iphone --minimum-deployment-target 9.3 --platform iphonesimulator --compile /Users/bob/Library/Caches/Xamarin/mtbs/builds/WMSMobileios/c843ca8a13b612b637f630ce1ffce4ab/obj/iPhoneSimulator/Debug/actool/bundle /Users/bob/Library/Caches/Resources/Media.xcassets
4>  Tool /Applications/Xcode.app/Contents/Developer/usr/bin/actool execution finished (exit code = 0).
4>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(1019,3): error : Failed to read file attributes for "/Users/bob/Library/Caches/Resources/Media.xcassets"
4>  ACTool: 2016-08-08T10:57:18.0392171+02:00 - Finished
4>Done executing task "ACTool" -- FAILED.
---------------------------------------------------

That might be relevant. I'll try recreating the assets.
Comment 4 Kenneth 2016-08-08 10:11:04 UTC
I get the same error with a new asset bundle. Maybe there is a problem with the alpha.
Comment 5 Kenneth 2016-08-08 10:13:57 UTC
Btw, Alpha version information:

Microsoft Visual Studio Professional 2015
Version 14.0.25123.00 Update 2
Microsoft .NET Framework
Version 4.6.01038

Xamarin   4.2.0.413 (b5d9567)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.2.0.23 (fdaf900)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   9.10.0.36 (22921dd)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 6 Emanuel 2016-08-09 21:01:38 UTC
Hi @Kenneth,

I'm sorry you're still facing this issue with the Alpha bits. Unfortunately I haven't been able to reproduce it, so I'll need to bother you and ask you for more info:
- Could you attach a sample solution in which you reproduce this bug?
- Also, could you attach the full detailed build output after you've reproduced it?
- And lastly, could you attach the About Microsoft Visual Studio info completely (not only the Xamarin info)?

thanks for you're help!
Comment 7 Kenneth 2016-08-11 07:24:14 UTC
Hi @Emanuel.

These three points, for the Alpha or for the stable version?
Comment 8 Emanuel 2016-08-11 14:45:48 UTC
Hi @Kenneth,

For the Alpha version please.

Thanks!
Comment 9 Kenneth 2016-09-01 10:34:30 UTC
I'll take a look when I have the chance, hang on :)
Comment 10 John Miller [MSFT] 2016-10-07 19:02:02 UTC
There is a comment here that might help: https://forums.xamarin.com/discussion/comment/226112/#Comment_226112