Variations on a theme, I’ve been trying to get Xamarin Studio up and running on Windows 7, and it is a royal pain. I don’t think they test it using Standard User accounts on Windows, because there is a huge a number of problems here.
- First and foremost, the Xamarin Studio shortcut is installed only in the installing account’s profile, which is by default an Administrator’s account. It’s not installed for All Users, so you can’t see it as a Standard User. You’ve got to create a shortcut to the executable in the
C:\Program Files (x86)\Xamarin Studio\bin
folder. - If you start Xamarin Studio as a Standard User, it cannot find the connected Android devices. Android Debug Bridge (
adb
) doesn’t seem to be started in a way that lets it see them. However, if you’re using Google’s Android Studio as a Standard User, it works just fine, so it can’t be a permissions problem. - The Xamarin installer downloads a separate 32-bit Java 6 JDK, even though the 64-bit Java 8 JDK works just fine now with Android. Worse yet, you can try as much as you want to point Xamarin to your system-installed Java 8 JDK, and it will absolutely refuse to use it. This seems to be related to a 64-bit vs. 32-bit issue, however, as I stepped my JDK down to 32-bit Java 7, and Xamarin seems to be ok with detecting it.
After futzing around with all of this stuff as a Standard User, I seem to now have a working system. The specific configuration that works for me on a 64-bit Windows 7 desktop, is to do all of the following as an Administrator user:
- Install Android SDK for All Users to
C:\Program Files (x86)\Android\android-sdk
. - Unpack 64-bit Android NDK to
C:\Program Files (x86)\Android\android-ndk-rxxx
. - Install 32-bit Java 7 JDK.
- Set
ANDROID_NDK_PATH=C:\Program Files (x86)\Android\android-ndk-rxxx
, where xxx is whatever revision they’re up to now. - Set
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_xx
, where xx is whatever point release they’re up to now.
Then, run Xamarin Studio as your Standard User account, and set the SDK Locations to:
With any luck, Xamarin Studio should have picked up the locations automatically, via the environment variables. With all of these items set, the build should now work properly and adb
should pick up the connected device. And you don’t have to run your system as an Administrator, or do any other hokey things to get Xamarin to work.
But the fact is, Xamarin asks you to install it as an Administrative user, but it shouldn’t actually need any special administrative rights to do its job. Or, if it does (to install a JDK, for instance), then it doesn’t need those rights any longer once it is installed. For instance, it installs its own copy of the Android SDK in the Administrative user’s %APPDATA%
folder, which it could just as easily do in a Standard User account.
Overall, they are assuming that everyone out there uses a single Administrator account on their computers, and I suppose that’s a pretty safe guess, except for when it’s not the case. I get the impression there are probably other devs out there who don’t run around as Administrator, because we know just how bad of an idea that is (even with User Account Control).
(Parting thought: I’d be willing to bet even money that the Xamarin installer works without a hitch on OS X, because that seems like the place most devs spend their time these days, if the Berlin coffee shop scene is any indication.)
I agree that the installer is a mess (on Windows, at least) and it does seem that OS-X and iOS are getting most of the focus these days.
Question: Isn’t installing the SDK in C:\Program Files (x86)\Android\android-sdk problematic when it comes time for updates, especially as a normal user?
One of the early installers that I used (stock Google?) put everything in %localappdata%\Android and I’ve stuck with that so no update requires special permission.
I’ll definitely keep this link as a reference for all the 32/64 bit issues that you seem to have resolved. Thanks.
I’m currently installing SE7 32 bit based on your observations.