xamarinhq / app-conference

Pre-build conference application built with Xamarin

Home Page:http://www.xamarin.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build error in the latest version of Xamarin Studio/Visual Studio for Mac

hungys opened this issue · comments

Formerly, I am able to build this solution in both Xamarin Studio (Alpha channel) and Visual Studio for Mac. However, in the latest version of XS and VS for Mac Preview 4, both pop an error related to missing icon resource:

/Users/hungys/Workspace/Xamarin Studio/app-evolve/src/XamarinEvolve.iOS/Resources/Images.xcassets/AppIcons.appiconset/Icon-58.png: Error: File not found: /Users/hungys/Workspace/Xamarin Studio/app-evolve/src/XamarinEvolve.iOS/Resources/Images.xcassets/AppIcons.appiconset/Icon-58.png (XamarinEvolve.iOS)

Did anyone encounter this build error?

Putting my name down for having this issue as well

After upgrading to the latest versions of Xamarin, Xamarin Studio and Visual Studio for Mac, here comes a new error when building the solution:

/Users/hungys/Workspace/Visual Studio/app-evolve/src/packages/Xamarin.Forms.2.3.2.127/build/portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Xamarin.Forms.targets(3,3): Error MSB4018: The "XamlCTask" task failed unexpectedly.
This is an unhandled exception from a task -- PLEASE OPEN A BUG AGAINST THE TASK OWNER.
System.IO.FileNotFoundException: Could not find file "/Users/hungys/Workspace/Visual Studio/app-evolve/src/XamarinEvolve.Utils/obj/Debug/XamarinEvolve.Utils.dll.mdb".
File name: '/Users/hungys/Workspace/Visual Studio/app-evolve/src/XamarinEvolve.Utils/obj/Debug/XamarinEvolve.Utils.dll.mdb'


Server stack trace: 
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0019c] in <b36112eafe0a48c4bdeb716ed555aded>:0 
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean isAsync, System.Boolean anonymous) [0x00000] in <b36112eafe0a48c4bdeb716ed555aded>:0 
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access) [0x00000] in <b36112eafe0a48c4bdeb716ed555aded>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess)
  at Mono.CompilerServices.SymbolWriter.MonoSymbolFile.ReadSymbolFile (System.String mdbFilename) [0x00000] in <f812160bc1d54955ae9692ed601b6f12>:0 
  at Mono.CompilerServices.SymbolWriter.MonoSymbolFile.ReadSymbolFile (System.String mdbFilename, System.Guid assemblyGuid) [0x00000] in <f812160bc1d54955ae9692ed601b6f12>:0 
  at Mono.Cecil.Mdb.MdbReaderProvider.GetSymbolReader (Mono.Cecil.ModuleDefinition module, System.String fileName) [0x00012] in <f812160bc1d54955ae9692ed601b6f12>:0 
  at Mono.Cecil.ModuleReader.ReadSymbols (Mono.Cecil.ModuleDefinition module, Mono.Cecil.ReaderParameters parameters) [0x00032] in <d4dd94f3e5f74095b62543e88f18941d>:0 
  at Mono.Cecil.ModuleReader.CreateModuleFrom (Mono.Cecil.PE.Image image, Mono.Cecil.ReaderParameters parameters) [0x00042] in <d4dd94f3e5f74095b62543e88f18941d>:0 
  at Mono.Cecil.ModuleDefinition.ReadModule (System.IO.Stream stream, Mono.Cecil.ReaderParameters parameters) [0x00028] in <d4dd94f3e5f74095b62543e88f18941d>:0 
  at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x0000a] in <d4dd94f3e5f74095b62543e88f18941d>:0 
  at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <d4dd94f3e5f74095b62543e88f18941d>:0 
  at Xamarin.Forms.Build.Tasks.XamlCTask.Compile () [0x001ca] in <1eeee30f2b6d417892034c6c5a6de832>:0 
  at Xamarin.Forms.Build.Tasks.XamlCTask.Execute () [0x00007] in <1eeee30f2b6d417892034c6c5a6de832>:0 
  at (wrapper xdomain-dispatch) Xamarin.Forms.Build.Tasks.XamlCTask:Execute (object,byte[]&,byte[]&)

Exception rethrown at [0]: 
  at (wrapper xdomain-invoke) Xamarin.Forms.Build.Tasks.XamlCTask:Execute ()
  at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x0002a] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/msbuild-15.0/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:632 
  at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x002bf] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/msbuild-15.0/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:787  (MSB4018) (XamarinEvolve.Utils)

This occurs on both Xamarin Studio and Visual Studio for Mac Preview 6.

cc @jamesmontemagno

The older Xamarin.Forms NuGet package does not support .pdb files which are being generated when on building. You should be able to fix the FileNotFoundException: Could not find file "obj/Debug/XamarinEvolve.Utils.dll.mdb" build error by updating the Xamarin.Forms NuGet package to 2.3.4.224 in all your projects. However this will only fix this problem not the Icon-58.png error.

For me it turned out to be a weirdness in my ios csproj. I found that for some reason it was referencing both icon. . . as well as Icon-. . .
I went in and made all of my icons use the convention of Icon-. . . and then remove all references of icon. . . and then to build on Visual Studio 2017 for the first time after everything I had to

  1. clean from Visual Studio 2017
  2. (optional) super clean using a powershell script (just removes lots of extra folders and some files)
  3. disconnected build host
  4. deleted xamarin cache at /Users/{username here}/Library/Caches/Xamarin
  5. reconnected build host
  6. (optional) clean from visual studio (it populates a few files super clean kills and VS wants to be there)
  7. build from visual studio
  8. success

sorry for reviving a week old thread, but I hope that helps someone.

  1. Open XamarinEvolve.iOS.csproj
  2. Remove ImageAsset node below
    <ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-87.png">
    <InProject>false</InProject>
    </ImageAsset>
    ........
    <ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\PadIcon-167.png">
    <InProject>false</InProject>
    </ImageAsset>

I hope this helps.

@mrward @zeusjung

Thanks. I followed your guides and it now works on my VS for Mac RTM.
But I have no idea why XamarinEvolve.iOS.csproj has references to those nonexistent icons.

Thanks a lot. This worked for me too.