3

In my Xamarin Forms project (Visual Studio for Mac) I get the following error when I switch to Release-Build:

Error: System.IO.FileNotFoundException: /Users/mklieber/Projekte/bosig-acoustic-app/App/App.iOS/obj/iPhone/Release/actool/bundle/AppIcon20x20@3x.png does not exist

Output:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(489,3): error : System.IO.FileNotFoundException: /Users/mklieber/Projekte/bosig-acoustic-app/App/App.iOS/obj/iPhone/Release/actool/bundle/AppIcon20x20@3x.png does not exist
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(489,3): error : File name: '/Users/mklieber/Projekte/bosig-acoustic-app/App/App.iOS/obj/iPhone/Release/actool/bundle/AppIcon20x20@3x.png'
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(489,3): error :   at System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) [0x00193] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-10/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/File.cs:111 
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(489,3): error :   at Xamarin.MacDev.Tasks.SmartCopyTaskBase.CopyFile (System.String source, System.String target, System.String targetItemSpec) [0x00030] in <495eb6424ad84352b6b2ce90deac218a>:0 
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(489,3): error :   at Xamarin.MacDev.Tasks.SmartCopyTaskBase.Execute () [0x000e7] in <495eb6424ad84352b6b2ce90deac218a>:0 
    0 Warnung(en)
    1 Fehler

This is the AppIcon:

AppIcon

The icon is present (third from top) and will be copied in debug build:

Release build

In release build the icon is missing:

Debug build

This is what I already tried:

  • Clean and rebuild solution
  • Recreate AppIcon asset
  • Build project with Visual Studio for Windows

Any ideas on this issue?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
mklieber
  • 192
  • 11
  • 1
    Issues with this can be very confusing... Did you open the csproj of your iOS project manually and see if there is an entry for that specific file in there? Maybe excluded for some reason on a release build? – Gerald Versluis Apr 04 '19 at 09:14
  • 1
    In your iOS project go to project **Properties>iOS Build>Enable device specific builds** and mark it off and see if this works for you – FreakyAli Apr 04 '19 at 11:05

2 Answers2

2

I solved the issue by recreating all app icons with the appropriate size and, very important, with a dpi of 96. The reason why the error occurs seems to cohere with the dpi of the image, some of my app icons had a dpi of 300.

mklieber
  • 192
  • 11
0

In my case,

  1. I have generated App Icons using jpeg image from https://appicon.co/.
  2. When I extracted that Icon zip file, there were Icons in PNG format.
  3. After attaching these Icons in Asset Catalog file and then building source was giving me this error.
  4. I converted jpeg format to png and also changed 300 dpi to 96 dpi using photoshop.
  5. I generated Icons again using png Icon from https://appicon.co/ and tried attaching and rebuilding solution. And it worked for me.
A. Qasim
  • 1
  • 2