1

When i build my xamarin android app i get this above error failed to download android m2repository_r32.zip. Another error is no definition for the name theme in the mainactivity class. when i build it creates empty folders on c/users/username/appdata/xamarin

xamarin.android.support.animated.vector.drawable
xamarin.android.support.v4
xamarin.android.support.v7.appCompat
xamarin.android.support.vector.drawable.

I downloaded the m2repository and installed it manually but that did not work also i dont know what to do. I installed android support library v7 appCompat

  • The last time I had this problem was due to the file path size limit on Windows. I think it's only 256 characters and while the archive was extracting, it suddenly failed and resulted in the error you're receiving. What version of Windows are you running and do you see any mentions to file paths in the logs? – Timo Salomäki Feb 08 '17 at 16:00
  • http://stackoverflow.com/a/36215224/6146870 – ashley Feb 08 '17 at 22:26
  • i am using windows 10 – Nomathamsanqa Philiso Feb 09 '17 at 06:27

1 Answers1

0

This often happens when aborting the Android build while it is downloading the packages.

Right-click the Android project and select Clean then Rebuild.

If this does not fix the problem:

  1. Close Visual Studio / Xamarin Studio
  2. Open the folder where your Android project lies and delete the obj and bin folder
  3. Open the folder where your .sln file and packages folder lies and delete the packages folder
  4. Go to the %UserProfile%\.nuget\packages\ folder (Windows) or ~/.nuget/packages folder (Mac) and delete all Xamarin.Android.* folders
  5. Go to the %UserProfile%\AppData\Local\Xamarin folder (Windows) or ~/.local/share/NuGet/Cache folder (Mac) and delete all Xamarin.Android.* folders and the zips folder
  6. Reopen Visual Studio / Xamarin Studio, right-click your Solution and select Rebuild Solution
  7. Wait until it has finished and do not cancel the package restore or build

For more information about this problem, check http://smstuebe.de/2016/10/29/fix-android-app-compat/

Robin-Manuel Thiel
  • 2,206
  • 19
  • 26
  • Hi Robin i did all these steps but i still get the same error – Nomathamsanqa Philiso Feb 08 '17 at 14:08
  • Severity Code Description Project File Line Suppression State Error Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r32.zip and put it to the C:\Users\nphiliso\AppData\Local\Xamarin\Xamarin.Android.Support.Vector.Drawable\23.4.0.0 directory. ToDoList – Nomathamsanqa Philiso Feb 08 '17 at 14:08