Bug 32960 - Android designer can't open with error The installed Android SDK is too old. Version 24.3 or newer is required.
Summary: Android designer can't open with error The installed Android SDK is too old. ...
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Android
Classification: Xamarin
Component: Designer ()
Version: 5.1
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Jérémie Laval
URL:
Depends on:
Blocks:
 
Reported: 2015-08-11 10:58 UTC by Amalia
Modified: 2017-09-21 01:35 UTC (History)
7 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Amalia 2015-08-11 10:58:35 UTC
### Overview

On Windows machines, when you download the Android SDK to anywhere (anywhere) other than 'C:\Users\[username]\AppData\Local\Android\android-sdk', the designer won't open and gives the error 'The installed Android SDK is too old. Version 24.3 or newer is required. Please update to the latest version.'


### Steps to reproduce

1) On a Windows machine, download the Android SDK from https://developer.android.com/sdk/index.html or just move it to anywhere on your computer that isn't 'C:\Users\[username]\AppData\Local\Android\android-sdk'

2) In Xamarin Studio, go to Tools->Options->SDK Locations->Android. Click Browse next to Android SDK and choose the new location, then click OK.

3) In any Android project in Xamarin Studio, try to open Main.axml.


### Expected results

Main.axml opens successfully.


### Actual results

Main.axml won't open with error "The installed Android SDK is too old. Version 24.3 or newer is required. Please update to the latest version."


### Workaround

Simply move the Android SDK to 'C:\Users\[username]\AppData\Local\Android\android-sdk'


### Additional information

=== Xamarin Studio ===

Version 5.9.4 (build 5)
Installation UUID: f3ebd2e6-8398-4cdc-bf5f-e6cba20fd608
Runtime:
	Microsoft .NET 4.0.30319.34014
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.26

=== Xamarin.Android ===

Version: 5.1.4 (Enterprise Edition)
Android SDK: C:\Android\android-sdk
	Supported Android versions:
		None installed
Java SDK: C:\Program Files (x86)\Java\jdk1.7.0_71
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode, sharing)

=== Xamarin Android Player ===

Not Installed

=== Build Information ===

Release ID: 509040005
Git revision: 8010a90f6e246b32364e3fb46ef2c9d1be9c9a2b
Build date: 2015-06-08 17:16:25-04
Xamarin addins: 7e93e9c3503f28770f23ce1b7eafd829919f18e8

=== Operating System ===

Windows 6.2.9200.0 (64-bit)
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2015-08-11 12:02:46 UTC
Just a quick comment: I can tell you that "anywhere on your computer that isn't 'C:\Users\[username]\AppData\Local\Android\android-sdk'" is not quite sufficiently precise as a description of the problematic location.

I have my Android SDK installed at `C:\android-sdk`, and the designer works correctly for me.

There is a chance that the problem in this bug is that the registry key for the Android SDK location does not get re-checked until you restart Xamarin Studio. You can also check on the registry key itself to make sure the value is changing as expected. I can get back to you with the exact location of that key. By memory, I believe it's somewhere under local user, software, Xamarin.
Comment 2 Amalia 2015-08-11 13:45:08 UTC
Restarting Xamarin Studio doesn't fix the problem. When my Android SDK is installed at `C:\Android\android-sdk` the designer isn't working. There might be something wrong with the registry key changing-where is it, exactly?
Comment 3 Brendan Zagaeski (Xamarin Team, assistant) 2015-08-11 14:30:39 UTC
The location of the registry value is:

> HKEY_CURRENT_USER\Software\Novell\Mono for Android\AndroidSdkDirectory
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2015-08-11 14:43:50 UTC
I checked quickly, and I was not able to reproduce the problem when I moved the Android SDK folder and then updated the SDK location under "Tools -> Options -> SDK Locations -> Android -> Android SDK" to:

> C:\Android\android-sdk


(In my tests I did not need to restart Xamarin Studio after updating the SDK location.)




## Next steps

If you can still reproduce the problem, you can try:


1. Delete the Xamarin Studio log folder [1].

[1] %LOCALAPPDATA%\XamarinStudio-5.0\Logs


2. Reproduce the problem (in particular, obtain the "The installed Android SDK is too old. Version 24.3 or newer is required" error message after you have set the Android SDK location to `C:\Android\android-sdk`).


3. Zip up and attach back the log folder [1]. Many thanks in advance!


4. For good measure, you can also collect your Android SDK Tools, Platform-tools, and Build-tools versions from the SDK Manager (example in my version information below) and include those in the follow-up comment too.




## My version information

Android SDK Tools 24.3.3
Android SDK Platform-tools 22
Android SDK Build-tools 21.1.2
Android SDK Build-tools 20


=== Xamarin Studio ===

Version 5.9.5 (build 9)
Installation UUID: 052b21d8-ec7e-476d-8f37-49099059cd73
Runtime:
	Microsoft .NET 4.0.30319.42000
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.26

=== Xamarin.Android ===

Version: 5.1.5 (Business Edition)
Android SDK: C:\Android\android-sdk
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: C:\Program Files (x86)\Java\jdk1.7.0_71
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode, sharing)

=== Build Information ===

Release ID: 509050009
Git revision: b99cb19a1d3b15d8980c4616f13f837457e5b292
Build date: 2015-07-28 02:41:02-04
Xamarin addins: d53d6eceb828422f3d4aff8547f2f6bab6c9ea58

=== Operating System ===

Windows 6.2.9200.0 (64-bit)
Comment 5 Amalia 2015-08-11 15:31:25 UTC
Logs here: https://www.dropbox.com/s/jwy11ke1rf00cbu/Logs.zip?dl=0

Android SDK Tools 24.3.3
Android SDK Platform-tools 22
Android SDK Build-tools 22.0.1
Comment 6 Brendan Zagaeski (Xamarin Team, assistant) 2015-08-11 18:36:50 UTC
Ohhhh. I somehow missed it in the original version information, but now that I looked at the logs, I see you have no Android API levels installed.




### In `Ide*.log`

> Found Android SDK. API levels: (none)




### From the original version information in Comment 0

>    Supported Android versions:
>        None installed




## "Partially confirmed"

I can in fact reproduce the error message "Version 24.3 or newer is required" if I rename my "android-sdk\platforms" folder to "android-sdk\platforms-bak" and create a new empty folder named "android-sdk\platforms".

(This itself might be sufficient for a small enhancement request to improve the error message for that particular scenario.)

_But_ if I then move my `android-sdk` folder to the default location (`%LOCALAPPDATA%\Android\android-sdk`), I _still_ get the same "Version 24.3 or newer is required" error and the designer does not load. Comment 0 reported that the designer _did_ load in this state, so there is still a mismatch in my test setup compared to the original setup from Comment 0.




## Possible next steps

When you move the `android-sdk` folder back to `%LOCALAPPDATA%\Android\android-sdk`, does Xamarin Studio still report that no Android API levels are installed?

Perhaps there is a Windows file permissions problem that is disallowing Xamarin Studio from reading the `platforms` folder when you move the `android-sdk` folder outside of your user directory?
Comment 7 Amalia 2015-08-12 14:18:26 UTC
I checked, and the `platforms` folder at `C:\Android\android-sdk was empty. Adding platforms doesn't fix the issue, though.

With a bit more experimenting, it looks like the original SDK I had (downloaded with Xamarin Studio) works fine no matter where on the computer I move it. However, when I download the SDK from the link in the comment 0, it doesn't work no matter where I put it.

I think it's safe to say the path is not the issue, but something else is going wrong.
Comment 10 Ram Chandra 2015-08-13 13:13:14 UTC
@Amalia: Thanks for providing the steps.

I have checked this issue but I am not able to reproduce this issue.

Steps I followed:
1. Download the android SDK from here: 
   > https://developer.android.com/sdk/index.html#Other 
2. Unzip the SDK and update the SDK build-tools and platform-tools
3. Move SDK to C:\Android\android-sdk directory
4. Open Xamarin Studio and set the new SDK path, i.e. C:\Android\android-sdk
5. Create android project and open Main.axml file

Screencast: http://www.screencast.com/t/CFLcBHdaA

Observation: XS open .axml file on designer without any error or exception. 

Please let me know if I am missing anything?

Environment Info:

=== Xamarin Studio ===

Version 5.9.5 (build 4)
Installation UUID: fc6654a4-ce73-4628-9813-c7e1b1548ece
Runtime:
 Microsoft .NET 4.0.30319.0
 GTK+ 2.24.22 (MS-Windows theme)
 GTK# 2.12.26

=== Xamarin.Android ===

Version: 5.1.5 (Enterprise Edition)
Android SDK: C:\Android\android-sdk
 Supported Android versions:
  5.0 (API level 21)
Java SDK: C:\Program Files (x86)\Java\jdk1.7.0_55
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) Client VM (build 24.55-b03, mixed mode, sharing)

=== Xamarin Android Player ===

Not Installed

=== Build Information ===

Release ID: 509050004
Git revision: 22bfad7fde45f7820b9b5649fd396ba0e5125198
Build date: 2015-07-10 11:41:05-04
Xamarin addins: 8adf470161f63b54bcfea78416e4541f6d55d7bb

=== Operating System ===

Windows 6.2.9200.0 (64-bit)
Comment 11 Ram Chandra 2015-08-13 13:16:25 UTC
An update to the bug : 

The platforms directory of SDK is not blank after updating the SDK it contains "android-21" directory.
Comment 12 Brendan Zagaeski (Xamarin Team, assistant) 2017-09-21 01:35:08 UTC
Thank you for taking the time to submit this report.  I will mark this old bug report as "not reproducible" at this time for the following reasons:

- The confirmation attempt in Comment 10 was unsuccessful, indicating that the conditions required to produce this error were unfortunately subtle and not yet known as of Comment 10.

- There are no other open bug reports that mention "The installed Android SDK is too old", and this bug report doesn't have any other users subscribed on CC.

- In the time since the last update on this bug, Xamarin Studio has changed status and is no longer under development.  Visual Studio is the supported IDE for Xamarin development at this time.

- I tried one final confirmation attempt in Visual Studio 2017 and was unable to replicate the issue.  In fact, it seems that the designer no longer even strictly requires the "platforms" directory, so my earlier partial confirmation from Comment 6 no longer applies.  With the current Xamarin versions I was able to successfully open Main.axml in the designer on a fresh system image where I had only installed 2 Android packages using `sdkmanager.bat`:

Android SDK Tools 26.0.1
Android SDK Platform-Tools 26.0.0