Redth / ResizetizerNT

Add SVG's and PNG's to your shared Xamarin Project
MIT License
318 stars 31 forks source link

Unknown MSBuild error #63

Closed 420tech closed 3 years ago

420tech commented 3 years ago

I get an "Unknown MSBuild error" for both Android and iOS projects when I try to compile on my Mac. I am using Visual Studio for Mac Community V8.9.3 (build 13). As for packages, I have NetStandard.Library 2.0.3, Resietizer.NT V0.2.0, Xamarin.Essentials V1.6.1 and Xamarin.Forms V5.0.0.2012. On the Mac, there is no Resizetizer folder in the obj directory.

On Windows, I get "One or more errors occurred" both Android and iOS. On Windows, I am using VS Community V16.9.2. I have the same packages as the Mac version above. Also, in the obj folder there is no Resizetizer folder. I can provide a complete repro code. My steps to repro:

  1. Generate new project using the Blank Forms App Template
  2. Add Resizetizer.NT to all projects
  3. Import and copy mysvg.svg file to root of main project
  4. Change the Build Action to SharedImage
  5. Edit the csproj file to show BaseSize for copied svg
  6. Deleted the Template boiler plate - in the StackLayout I added an image with the source to be mysvg.png
  7. Perform Build All - That's when the errors occur
420tech commented 3 years ago

Update - there are "resizetize" folders in Android and iOS projects - they are both empty.

420tech commented 3 years ago

I rebooted both computers - now I am not getting ANY build errors. I see the resizetize folders in Android and iOS obj folder. The image is not loading however.

420tech commented 3 years ago

More notes: when I deploy to Android (either emulator or physical device) in the Application Output window I see the following: Could not load image named: {0}: Freesample.png FileImageSourceHandler: Could not find image or image file was invalid: File: Freesample.png

Note: the svg file I am using is called Freesample.svg. I do not get this error with iOS

420tech commented 3 years ago

I tried again - disabling two extensions that I thought might be in the way (MFractor and CodeMaid). Now it works exactly as advertised!