Rolando Cruz
Rolando Cruz

Reputation: 41

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.

Upvotes: 4

Views: 976

Answers (2)

Valentin Helmer
Valentin Helmer

Reputation: 306

Took me almost 4 days to find a way on this issue even on my fresh new setup.

So there is my trick.

I found that it was the Resource.Designer.cs in the Android project that caused me all that pain in my #@$$! It was generated (or imported) from an outdated template or buildtool. So what you want to do is to regenerate it (don't delete it). To do it simply you can:

  1. (Optionnal) Update your solution Nuget packages and restart VisualStudio if asked
  2. Clean and Rebuild your whole solution (don't worry about the new errors if you get some)
  3. Clean again
  4. Unload and reload your Android and iOS projects independently (In Solution explorer : Right click -> Unload)
  5. Tadaaaaa Should be solved and you can get Intellisense and compiling ok now.

I couldn't find a way to definitly solve that even on my brand new windows with all component freshly installed (xamarin, Visual Studio, SDKs, NDK, etc...) If anyone got a proper solution, I'm all ears :)

Upvotes: 0

LionelGoulet
LionelGoulet

Reputation: 577

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...

Upvotes: 9

Related Questions