无法在Visual Studio 2012,2015(Windows 7 64位)上安装Xamarin

问题描述:

我试图今天在Visual Studio 2012上安装Xamarin,它失败了,并试图在Visual Studio 2015上安装一个月后失败。在*中报告了一些类似的问题,但看起来像安装程序已更新,因此报告新问题。请帮我解决这个问题。无法在Visual Studio 2012,2015(Windows 7 64位)上安装Xamarin

Installation of 'Android SDK' failed with more than one exception (attempt 3) 
    Errors while installing items. 
    Exception type: System.AggregateException 
    Failed to install Android archive. 
    Exception type: Xamarin.Web.Installer.InstallException 
    Full stack trace: 
    at Xamarin.Web.Installer.Installer.AndroidSoftwareItem.Install(UInt32 tryNumber) 
    at WindowsInstaller.ProgressPage.InstallationWorker() 
    Failed to install Android archive. 
    Exception type: Xamarin.Web.Installer.InstallException 
    Full stack trace: 
    at Xamarin.Web.Installer.Installer.AndroidSoftwareItem.Install(UInt32 tryNumber) 
    at WindowsInstaller.ProgressPage.InstallationWorker() 
    Failed to install Android archive. 
    Exception type: Xamarin.Web.Installer.InstallException 
    Full stack trace: 
    at Xamarin.Web.Installer.Installer.AndroidSoftwareItem.Install(UInt32 tryNumber) 
    at WindowsInstaller.ProgressPage.InstallationWorker() 

最后几行日志文件;

[2017-01-03 05:34:06.671] [Error] Attempting to clean up. 
[2017-01-03 05:34:06.686] [Error] Trying to remove directory '<USER_HOME>\Android\android-sdk\system-images\android-23\google_apis\x86' 
[2017-01-03 05:34:07.685] [Warning] Attempt to delete a non-existing directory '<USER_HOME>\Android\android-sdk\system-images\android-23\google_apis\x86.old96145954' 
[2017-01-03 05:34:07.685] [Info] Status: failed. 
[2017-01-03 05:34:07.685] [Error] Android SDK Platform API level 23, ABI x86, tag google_apis system image. 
[2017-01-03 05:34:07.700] [Exception] Installation of Android SDK component 'system-image-23-x86-google' failed with exception. 
[2017-01-03 05:34:07.700] [Exception] System.InvalidOperationException: Component installation failed 
[2017-01-03 05:34:07.700] [Exception] at Xamarin.Installer.AndroidSDK.AndroidComponentSystemImage.Install(String archivePath, String androidSdkRoot) 
[2017-01-03 05:34:07.700] [Exception] at Xamarin.Installer.AndroidSDK.AndroidSDKInstaller.InstallComponent(AndroidComponentBase component, AndroidSdkInstance instance) 
[2017-01-03 05:34:07.700] [Info] Status: failed. 
[2017-01-03 05:34:07.700] [Info] Status: failed. 
[2017-01-03 05:34:07.716] [Exception] Installation of software item 'Android SDK' failed with exception. 
[2017-01-03 05:34:07.716] [Exception] Xamarin.Web.Installer.InstallException: Failed to install Android archive. ---> System.InvalidOperationException: Component installation failed 
[2017-01-03 05:34:07.716] [Exception] at Xamarin.Installer.AndroidSDK.AndroidComponentSystemImage.Install(String archivePath, String androidSdkRoot) 
[2017-01-03 05:34:07.716] [Exception] at Xamarin.Installer.AndroidSDK.AndroidSDKInstaller.InstallComponent(AndroidComponentBase component, AndroidSdkInstance instance) 
[2017-01-03 05:34:07.716] [Exception] at Xamarin.Installer.AndroidSDK.AndroidSDKInstaller.InstallComponents[T](List`1 components, AndroidSdkInstance instance, String progressMessageFormat, Object[] args) 
[2017-01-03 05:34:07.716] [Exception] at Xamarin.Installer.AndroidSDK.AndroidSDKInstaller.InstallSystemImage(List`1 components, AndroidSdkInstance instance, String apiLevel, SystemImageSpec sis) 
[2017-01-03 05:34:07.716] [Exception] at Xamarin.Installer.AndroidSDK.AndroidSDKInstaller.Install(AndroidSdkInstance instance, InstallationSet installationSet) 
[2017-01-03 05:34:07.716] [Exception] at Xamarin.Web.Installer.Installer.AndroidSoftwareItem.Install(UInt32 tryNumber) 
[2017-01-03 05:34:07.716] [Exception] --- End of inner exception stack trace --- 
[2017-01-03 05:34:07.716] [Exception] at Xamarin.Web.Installer.Installer.AndroidSoftwareItem.Install(UInt32 tryNumber) 
[2017-01-03 05:34:07.716] [Exception] at WindowsInstaller.ProgressPage.InstallationWorker() 
[2017-01-03 05:34:07.716] [Info] Status: failed. 
[2017-01-03 05:34:07.825] [Debug] Showing manual installation window because of error 
[2017-01-03 05:34:12.850] [Debug] Starting installation complete task. 
[2017-01-03 05:34:12.850] [Info] Background installation worker completed. 
[2017-01-03 05:34:13.193] [Info] Installation completed with failure 
[2017-01-03 05:34:13.193] [Info] Status: failed. 
+0

我可以知道投票的原因.. – user1396423

+0

这不是一个真正的发展问题。授予它一个工具问题,但有些人似乎并不喜欢没有具体询问代码的问题。 – David

显然,Android SDK无法安装。 Android SDK实际上是一个单独的安装,您可以在尝试执行Xamarin安装之前下载并进行预安装。

只要确保在android SDK安装中使用默认路径,以便Xamarin安装程序可以找到它。

网址到Android SDK: https://developer.android.com/studio/index.html#downloads

如果Android SDK和Android的潜在工作室安装干净然后再回来,并再次尝试Xamarin。

+0

谢谢,Android工作室已安装。试图安装Xamarin,再次失败。它像任何东西一样吃掉我的硬盘C盘中的4 GB可用空间变为0字节免费********* [2017-01-03 09:18:50.188] [例外] System.InvalidOperationException:组件安装失败 [2017-01-03 09:18:50.188] [Exception]在Xamarin.Installer.AndroidSDK.AndroidComponentSystemImage.Install(String archivePath,String androidSdkRoot) [2017-01-03 09:18:50.188] [Exception] at Xamarin.Installer.AndroidSDK.AndroidSDKInstaller.InstallComponent(AndroidComponentBase组件,AndroidSdkInstance实例) – user1396423

+0

哦yaeh android SDK需要一些SERIOUS空间。鉴于版本和所有的模拟器等我一点也不惊讶听到它吃了4GB,并希望更多 – David

首先,您不需要Android Studio,只需要Android SDK。其次,预安装Android SDK没有帮助,因为VS安装程序不会注意到并安装自己的副本,甚至可能位于不同的位置。

建议:

  1. 反安装Android的工作室和Android SDK

  2. 所有文件夹和子文件夹中删除\程序文件(x86)\ Android的文件夹

  3. 检查安全权限你的HOME文件夹。您应该拥有完全访问权限。

  4. 在修复模式下运行VS安装程序。如果它没有帮助,unmaall Xamarin和所有相关的东西(Android的,IOS等),并重新安装