FileNotFoundException for images and icons when building ad-hoc release.

MarklarsaMarklarsa SEMember

I've build a cross-platform solution targeting both android and iOS using PCL & Xamarin.Forms to share code. I managed to publish my android project without problems, but when i try to build my iOS project (ad-hoc release) i get FileNotFoundExceptions for all my icons and images.

the error looks like this:

Error 1 System.IO.FileNotFoundException: /Users/itappgem/Library/Caches/Xamarin/mtbs/builds/AteaPOC1iOS/106bce41ac7f78f0080588aa38c68524/obj/iPhone/Ad-Hoc/[email protected] does not exist
File name: '/Users/itappgem/Library/Caches/Xamarin/mtbs/builds/AteaPOC1iOS/106bce41ac7f78f0080588aa38c68524/obj/iPhone/Ad-Hoc/[email protected]'
at System.IO.File.Copy (System.String sourceFileName, System.String destFileName, Boolean overwrite) [0x00000] in :0
at Xamarin.MacDev.Tasks.SmartCopyTaskBase.CopyFile (System.String source, System.String target, System.String targetItemSpec) [0x00000] in :0
at Xamarin.MacDev.Tasks.SmartCopyTaskBase.Execute () [0x00000] in :0 AteaPOC1iOS

I have made sure that all image files are set to "Always Copy" and i've checked Include Artwork in my iOS Application properties.

Anyone know how to fix this issue?

Best Answer


  • MarklarsaMarklarsa SEMember

    Might be worth mentioning that the path is that of the Build host, so Users/itappgem i my mac build host. So essentially the image and icon files can't be found on the build host.

  • MarklarsaMarklarsa SEMember

    Managed to release my project by firstly cleaning / rebuilding, then going through Debug -> Start without Debugging instead of simply klicking the play icon / F5.

  • EdwardCastilloEdwardCastillo USMember ✭✭

    I am having this exact same issue, however OP resolution does not work for me. Anyone have any other ideas?

  • Also having the same problem VS 2015 -> build host.

  • DougBarbinDougBarbin USMember

    Also having this problem with VS2013 -> build host. Anybody ever figure this out?

  • this is extremely annoying. has anyone resolved this yet?

  • I am having a similar issue, but with different image:

    Error System.IO.FileNotFoundException: /Users/user24/Library/Caches/Xamarin/mtbs/builds/AppIncaricateiOS/bb7c0beed4ba0e67a9b914655a584536/obj/iPhone/Release/Icons/icon-error.png does not exist

  • MarkFredricksonMarkFredrickson USMember ✭✭


    This is a bug in VS/Xamarin.IOS but surfaces when using the Toasts.Forms.Plugin. The Plugin for iOS places it's icons in an Icon folder in the Resources folder. When you compile with VS the icons do not get copied over to the Mac. I have reported this to the Toasts plugin developer and suggested he moves the icons out of the Icon folder and place them directly in the Resources folder. I have also opened Bug 37777 with Xamarin.

    If you want to create a temporary fix, download the plugin and move the icons from the Toasts.Forms.Plugin.iOS Icons folder directly to the Resources folder, then modify DefaultMessageBarStyleSheet.cs icon constants and remove the Icon/ folder reference. Compile and use the two Toast dll's in your project instead of the ones from NuGet.

  • JakovljevicIgorJakovljevicIgor USMember ✭✭✭

    Instead of setting them to BundledResources try setting the files to type Resource. I tried that and it worked. It is also a solution for the bug with the File Not Found exception. Hope it helps. You don't have to set all images to Resource Type, just keep setting the ones that are shown in the error list in VS until the errors are gone.

  • OanaTivadarOanaTivadar USMember

    Igor Jakovljevic's solution worked for me. Thank you!

Sign In or Register to comment.