Reputation: 1549
While installing Xamarin Mono for Android, it says it cannot find Java SDK and Android SDK and it goes on to download them. But I have installed Java SDK and Android SDK.
I looked at the installation log (c:\users\\appdata\local\xamarin\monoforandroid) and found that it looked for registry keys: 'SOFTWARE\Wow6432Node\JavaSoft\Java Development Kit', value 'CurrentVersion' and 'SOFTWARE\JavaSoft\Java Development Kit', value 'CurrentVersion'. And it didn't find it. I looked in my registry and I see the key 'HKLM\SOFTWARE\JavaSoft\Java Development Kit'.
Why the setup doesn't see the key ?
The details from log are below:
[Info] Checking whether JDK needs to be installed.
[Debug] Attempting to read registry subkey 'SOFTWARE\Wow6432Node\JavaSoft\Java Development Kit', value 'CurrentVersion'
[Debug] Attempting to read registry subkey 'SOFTWARE\JavaSoft\Java Development Kit', value 'CurrentVersion'
[Info] JDK not detected.
[Info] JDK 1.6 needs to be installed.
Is there a way to tell the installer that Java SDK and Android SDK are installed?
Upvotes: 3
Views: 5587
Reputation: 31
I was having some similar problems with the Xamarin installer. I would normally allow the Xamarin installer to just setup everything for me, but it didn't work. The tools all installed and seemed to be functional but I couldn't launch devices to run the sample hello world app. I suspect this is because of where the SDK got installed by default (and I wasn't prompted during the install process!). The default location seemed to be over in c:\users\\appdata... but IT policies at my office make this a funky sync'd drive and I find most things don't well because of it.
To work around this I pulled down the ADT bundle, thinking I might want to fool with the visual designer through eclipse in addition to just having the SDK. Some google searching and parsing the install log made me realize I needed a few registry keys to get the setup utility to find the SDK. Fixed it by putting the following in adt.reg and then running it.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\Android SDK Tools]
"Path"="C:\\lib\\adt-bundle-windows\\sdk"
[HKEY_CURRENT_USER\SOFTWARE\Android SDK Tools]
"Path"="C:\\lib\\adt-bundle-windows\\sdk"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools]
"Path"="C:\\lib\\adt-bundle-windows\\sdk"
[HKEY_LOCAL_MACHINE\SOFTWARE\Android SDK Tools]
"Path"="C:\\lib\\adt-bundle-windows\\sdk"
The Xamarin setup still seems intent on updating with the sdk though. I especially love this line from the log.
Component 'Android SDK' v. 21.0.0.0 present but requires update to v. 20
At least everything seems to be running now.
Upvotes: 3
Reputation: 11
The installer tries to find the key in the 'Current User' section of the registry. But the Java JDK(also other products) installer(s) places it in the 'Local Machine' section.
FIX!
The registry editor(regedit.exe) can be launched with commands by using a script, nothing more then a text file with a *.reg extension.
● Open up notepad!
● Paste the following.
IF YOU HAVE 1.7 JDK INSTALLED USE THIS!
● Save the save the file as anything.reg! Make sure you select "All Files (.)" for 'Save as Type'!
● Double-click the *.reg file you saved! Click 'OK' for the UAC message(if your running => vista) Click 'OK' for the message from the registry editor about combining the content of the *.reg file to the systems registry.
● Click 'OK' for the information message.
● Restart the Xamarin Mono for Android installer.
As for the missing Android SDK, those you probably are missing so let the setup download it!
Upvotes: 1