2

I just updated to Xamarin.Forms 2 a solution with three projects:

  • Portable library
  • Android project
  • iOS project

I update Xamarin.Forms, Android SDK and I am compiling using the last SDK, which is 23:

enter image description here

When compiling I get tons of errors:

enter image description here

This is how my Nuget looks like:

enter image description here

Any ideas about how to solve this? Really appreciate any help!

Edit Following this post I deleted the folders of "...\Local\Xamarin\" and now I don't have anymore that error. Instead I now have this errors:

enter image description here

edit 2 I uninstalled and installed Xamarin and I'm getting the same error from resource cs file as shown in last picture

Please help

Ignacio Gómez
  • 1,587
  • 4
  • 23
  • 41
  • I would suggest first making sure that you right-click the Xamarin solution and update any and all libraries there. Those Android libraries in the error messages are recent additions to my Xamarin Android project and are libraries that are installed into the Xamarin Android project. Do you see them as updates? – hvaughan3 Nov 24 '15 at 19:38
  • I already updated everything, from Nuget and from Android SDK Manager – Ignacio Gómez Nov 24 '15 at 19:39
  • Do you see the following in your Xamarin Android project's references `Xamarin.Android.Support.v7.MediaRouter`? – hvaughan3 Nov 24 '15 at 19:41
  • Yes, I updated my post with an image showing you that – Ignacio Gómez Nov 24 '15 at 19:42
  • Check out the following post for a few answers which include, setting the android target framework to something other than 'Using Latest', and also adding the zip files to where the error message says it wants them: [Xamarin Forums](https://forums.xamarin.com/discussion/29230/nuget-error-updating-xamarin-android-support-v7-appcompat-21-0-0-0) – hvaughan3 Nov 24 '15 at 19:47
  • What other nuget packages are you referencing? They will have to be built against the latest 23.0.X support packages too. Try a full clean and then rebuild – JamesMontemagno Nov 24 '15 at 21:42
  • I already clean and build. Also uninstalled and installed again Xamarin from scratch: Same result – Ignacio Gómez Nov 24 '15 at 21:53
  • Make sure your output doesn't say something like. `Couldnt copy Xamarin.Forms V2` I was getting similar errors when it failed to copy across Xamarin.Forms. I had to close Visual studio, do it manually and re-open – JKennedy Nov 25 '15 at 09:12
  • @user1 I don't have that error. Thanks anyway – Ignacio Gómez Nov 25 '15 at 12:35

2 Answers2

2

This is how I resolved it. I'm starting from the beginning even though I know you resolved the first error.

  1. Set your target and compile to specifically API 23 (not really a part of this issue but recommended due to other issues that have popped up in the past)

  2. Go to that directory it mentions, go up a level from content, so you will see the content folder and the android m2repository, then delete it all. Do that for every path it references.

  3. Rebuild and it will redownload and install those files.

VS or Xamarin (not sure which) corrupt those zips on a regular basis. Be prepared to do it again in a few days, weeks or months.

Now go to your Resource.Designer.cs and delete everything inside that file. Normally good to keep it there so your project still references it.

That should finally sort out all of these errors.

** Next step if above fails **

  1. Clean solution
  2. update-package -reinstall (can use -project just for your Android project)
  3. Delete Resource.Designer.cs contents again
  4. Restart Visual Studio
  5. Rebuild once again

You might also want to add sobbing, praying or cursing in with those steps :)

One final thing, if that doesn't work, try the same again but this time uninstalling all NuGet packages and components instead of a reinstall. Then make sure your cache's are clean (C:\Users\\AppData\Local\Xamarin)

Adam
  • 16,089
  • 6
  • 66
  • 109
-1

This is what I tried, at the end of every step I tested and get the same error results:

  1. Erasing files in "...\Local\Xamarin\" (post)
  2. Deleting Resource.Designer.cs content
  3. Reinstalling Xamarin
  4. Reinstalling Visual Studio (2015 in mi case)

So finally this solve my problem:

  • Reinstalled Windows from scratch Everything works now (without Xamarin.Forms 2)

I will try to update to Xamarin.Forms 2 in a few weeks, but now I need to continue working so I need Xamarin to work, so sadly this was my "workaround".

Ignacio Gómez
  • 1,587
  • 4
  • 23
  • 41
  • I solved my problem by first erasing files and then comparing/updating packages and project files manually with xamarin examples that had 2.0 updated. – Vili Dec 17 '15 at 06:33