{"id":28843,"date":"2016-12-13T00:00:22","date_gmt":"2016-12-13T08:00:22","guid":{"rendered":"https:\/\/blog.xamarin.com\/?p=28843"},"modified":"2019-04-04T09:01:44","modified_gmt":"2019-04-04T16:01:44","slug":"installing-xamarin-made-easy-offline-installation","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/xamarin\/installing-xamarin-made-easy-offline-installation\/","title":{"rendered":"Installing Xamarin Made Easy with Offline Installation"},"content":{"rendered":"<p>\t\t\t\tMobile application development requires a successful installation of the correct development\u00a0tools &amp; SDKs. In the case of Xamarin, your tools will be\u00a0Visual Studio 2015 and third-party SDKs. As Visual Studio allows any developer to build any kind of app for any platform, while providing features like IntelliSense, code refactoring, code navigation, debugging &amp; testing in the same IDE, it has a considerable\u00a0install size. Successful installation of Visual Studio takes time and depends on network connectivity. In this blog, we\u2019ll cover how you can create your own offline installation media for Xamarin with Visual Studio 2015.<\/p>\n<h2>Step 0: Whitelist URLs<\/h2>\n<p>Before installing Visual Studio, it is important that the\u00a0following URLs are whitelisted in your firewall\/proxy. Failing to do this\u00a0may result\u00a0in some components failing to install.<\/p>\n<ul>\n<li>dl-ssl.google.com<\/li>\n<li>dl.google.com<\/li>\n<li>xamarin.com<\/li>\n<li>download.xamarin.com<\/li>\n<li>dl.xamarin.com<\/li>\n<li>log.xamarin.com<\/li>\n<\/ul>\n<h2>Step 1: Download Setup Files for Offline Installation<\/h2>\n<p>Visit the <a href=\"https:\/\/www.visualstudio.com\/downloads\/\">Visual Studio<\/a> website, and navigate to the Downloads page. Download the relevant installer for Visual Studio Community, Professional or Enterprise. Once the installer download is complete, run it from the command prompt using the\u00a0<code>\/layout<\/code>\u00a0switch:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/01-VS-Offline-Command-Prompt2.png\"><img decoding=\"async\" class=\"aligncenter wp-image-28982 size-full\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/01-VS-Offline-Command-Prompt2.png\" alt=\"\" width=\"559\" height=\"141\" \/><\/a><\/p>\n<p>After executing this command Visual Studio installer will launch\u00a0and ask you to confirm\u00a0where to store install items.<\/p>\n<p><strong><u>Note:<\/u><\/strong>\u00a0The download size will be considerably large and, dependent on your bandwidth, will usually take quite some time to download. Ensure you have enough drive space available.\u00a0Click on the \u2018Download\u2019 button and it will download all the required tools and SDKs to\u00a0that location:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/02-VS-Offline-Setup.png\"><img decoding=\"async\" class=\"aligncenter wp-image-28846\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/02-VS-Offline-Setup.png\" alt=\"02-vs-offline-setup\" width=\"450\" height=\"630\" \/><\/a><\/p>\n<h2>Step 2: Create Offline Installation Media &amp; Install Visual Studio<\/h2>\n<p>Once the download is complete you\u00a0can copy the contents to a USB drive or use any ISO creation tool to create your offline installation media. This will help to mount the ISO as and when required and run the setup by executing the installer. Start the Visual Studio installation from your new installation media and sit back until it completes.<\/p>\n<h2>Step 3: Check for Android Updates<\/h2>\n<p>Optionally, when the installation is complete, you can\u00a0check for any Android SDK Updates. This can be done by launching Android SDK Manager from Visual Studio &gt; Tools &gt; Android &gt; Android SDK Manager.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/03-VS-Offline-Android-SDK.png\"><img decoding=\"async\" class=\"aligncenter wp-image-28848\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/03-VS-Offline-Android-SDK.png\" alt=\"03-vs-offline-android-sdk\" width=\"608\" height=\"437\" \/><\/a><\/p>\n<p>If there are any updates, select and install them.<\/p>\n<h2>Step 4: Verify Installation<\/h2>\n<p>At this point, you will be able to\u00a0build Android and iOS applications using Visual Studio 2015. To verify that the install was successful you can create a new blank Android or iOS project with default the configuration and run it. The project should build and run on device or emulators without any issues.<\/p>\n<h2>Step 5: Resolving Errors when Building Xamarin.Forms Applications<\/h2>\n<p>When a Xamarin.Forms project is compiled for the first time (or when related NuGet packages are updated and a project is compiled) Visual Studio downloads associated Android Support Library packages. Visual Studio will not indicate the size or download progress for installing these packages. If these packages are corrupt because of an incomplete download then there will be errors during compilation:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/04-VS-Offline-Build-Errors.png\"><img decoding=\"async\" class=\"aligncenter wp-image-28850\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/04-VS-Offline-Build-Errors.png\" alt=\"04-vs-offline-build-errors\" width=\"646\" height=\"145\" \/><\/a><\/p>\n<p>If this happens then our guide on <a href=\"https:\/\/developer.xamarin.com\/guides\/android\/troubleshooting\/resolving-library-installation-errors\/\">Resolving Library Installation Errors<\/a> will help you resolve any issues.<\/p>\n<p><strong>Bonus Tip 1:<\/strong><\/p>\n<p>If code is downloaded from the internet\u00a0or GitHub as zip file then it&#8217;s possible that the\u00a0zip file is blocked from being extractable in\u00a0Windows. If the zip was extracted and the solution is opened in Visual Studio then the build may fail. To avoid this you can unblock the zip files which were\u00a0downloaded before extracting and opening the solution in Visual Studio. To do so you can right the zip and go to &#8216;Properties&#8217;. You will see an &#8216;Unblock&#8217; checkbox toward the bottom of the dialogue:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/06-VS-Offline-Unblock.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-28853\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/06-VS-Offline-Unblock.png\" alt=\"06-vs-offline-unblock\" width=\"363\" height=\"509\" \/><\/a><\/p>\n<p><strong>Bonus Tip 2:<\/strong><\/p>\n<p>Depending on the Android API installed during installation the projects might either be targeting Android N (API 24) or Android M (API 23). By default, during the installation, Visual Studio installs JDK1.7. However, if the project is targeting API 24 then JDK1.8 is required. In case the project targeting\u00a0API 24 is compiled with JDK1.7 and you will see an error like this:\n<em>C:\\Program Files (x86)\\MSBuild\\Xamarin\\Android\\Xamarin.Android.Common.targets(3,3): Error: java.lang.UnsupportedClassVersionError: com\/android\/dx\/command\/Main : Unsupported major.minor version 52.0<\/em><\/p>\n<p>The Version 52.0 here is referring to the specific release of the JDK which in this case relates to JDK 8. Xamarin.Android 7.0 requires\u00a0<a href=\"http:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/jdk8-downloads-2133151.html\">JDK 1.8<\/a>\u00a0to use the Android Nougat (API 24) APIs. You can continue to use earlier versions of the JDK if targeting earlier Android API levels:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/jdk8-downloads-2133151.html\">JDK 1.8<\/a>&#8211; up to API 24+<\/li>\n<li><a href=\"http:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/jdk7-downloads-1880260.html\">JDK 1.7<\/a>&#8211; up to API 23<\/li>\n<li><a href=\"http:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/java-archive-downloads-javase6-419409.html\">JDK 1.6<\/a>&#8211; up to API 20<\/li>\n<\/ul>\n<p>Additionally, a 64-bit version of the JDK is required to use\u00a0<a href=\"https:\/\/developer.xamarin.com\/releases\/vs\/xamarin.vs_4\/xamarin.vs_4.2\/#androiddesignercustomcontrols\">custom controls in the Android designer<\/a>.<\/p>\n<p>The best option is to install the 64-bit version of <a href=\"http:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/jdk8-downloads-2133151.html\">JDK 1.8<\/a> since it is backward compatible with all the previous API levels and supports the new Android designer features.<\/p>\n<p>More information on this can be found in our <a href=\"https:\/\/developer.xamarin.com\/releases\/android\/xamarin.android_7\/xamarin.android_7.0\/\">Android 7.0 Release Notes<\/a>.\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mobile application development requires a successful installation of the correct development\u00a0tools &amp; SDKs. In the case of Xamarin, your tools will be\u00a0Visual Studio 2015 and third-party SDKs. As Visual Studio allows any developer to build any kind of app for any platform, while providing features like IntelliSense, code refactoring, code navigation, debugging &amp; testing in [&hellip;]<\/p>\n","protected":false},"author":549,"featured_media":28846,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[4],"class_list":["post-28843","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developers","tag-xamarin-platform"],"acf":[],"blog_post_summary":"<p>Mobile application development requires a successful installation of the correct development\u00a0tools &amp; SDKs. In the case of Xamarin, your tools will be\u00a0Visual Studio 2015 and third-party SDKs. As Visual Studio allows any developer to build any kind of app for any platform, while providing features like IntelliSense, code refactoring, code navigation, debugging &amp; testing in [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/28843","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/users\/549"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/comments?post=28843"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/28843\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media?parent=28843"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/categories?post=28843"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/tags?post=28843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}