0

I am working on a Xamarin IOS project and just created a .png file that I want to display in the app. When I add the image to the Resources folder the app no longer builds and displays the following error:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(3,3): Error: System.IO.FileNotFoundException: /Users/davidshepard/Projects/NewEPA/NewEPA/obj/iPhoneSimulator/Debug/device-builds/ipad6.12-11.0/optimized/Pres0.png does not exist File name: '/Users/davidshepard/Projects/NewEPA/NewEPA/obj/iPhoneSimulator/Debug/device-builds/ipad6.12-11.0/optimized/Pres0.png' at System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) [0x00193] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/File.cs:111 at Xamarin.MacDev.Tasks.SmartCopyTaskBase.CopyFile (System.String source, System.String target, System.String targetItemSpec) [0x00030] in <3718405664a748fa8803db38a9584ea4>:0 at Xamarin.MacDev.Tasks.SmartCopyTaskBase.Execute () [0x0013d] in <3718405664a748fa8803db38a9584ea4>:0 (NewEPA)

I verified that the file was being added to the .csproj file and I still get this error even when I do reference this image anywhere in my code other than the .csproj

Another interesting piece of information is that Images that I added before upgrading to the newest version of Xamarin.IOS and Visual Studio for Mac 2017 work just fine even if I remove and readd the m to the project.

Any suggestions as to how I can resolve this issue would be greatly appreciated!

Additional Info: iPad only app. IOS 11.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
DavidShepard
  • 306
  • 3
  • 11

1 Answers1

0

So after a scratching my head for a few days, I figured out what went wrong. When I was uploading the file to Visual studio, it was becoming corrupt and unreadable. I had to reinstall visual studio to fix the issue and now it's working fine. If you experience the same problem, it is most likely due to the file being corrupt. Hope this helps someone in need!

DavidShepard
  • 306
  • 3
  • 11