Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IDE0006 Error running Xamarin Android project in Visual Studio

I had just created a new Visual Studio for Cross-Platform project.

Clean the solution, rebuild solution, run the Android project and it took forever to compile and finally the emulator shows up. And after awhile I get that "Warning IDE0006..." error.

I've clicked the IDE0006 link and points me to the same place with no recommendation to solve or debug it.

like image 412
Rolando Cruz Avatar asked Jan 05 '23 19:01

Rolando Cruz


1 Answers

This one took me 75 days of blood, sweat, and tears to puzzle through.

  1. Right-click on the Solution (at the very top of the Solution Explorer list).
  2. Left-click on "Manage NuGet Packages for Solution..."
  3. Click on the word "Updates" at the top of the dialog box that shows up.
  4. Click on the checkbox next to "Xamarin.Forms". Do not select any other packages for update.
  5. Click the "Update" button. It will grind away for a minute or two or three. Or four. :)
  6. Close Visual Studio. This is very important. Re-open Visual Studio. Open the Solution.
  7. Pull down "Build" -> "Clean Solution"
  8. Pull down "Build" -> "Rebuild"

You're left with one error: "The referenced component 'System.ObjectModel' could not be found. SolutionName.Droid"

In the Solution Explorer, Open up SolutionName.Droid. Open up "References" under that. Right-click on "System.ObjectModel" and delete it.

This has worked repeatably for me. Maybe somebody else could explain why it works...

like image 90
LionelGoulet Avatar answered May 10 '23 19:05

LionelGoulet