New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
android-studio/android-sdk: cannot install/upgrade Android SDK packages #8650
Comments
As a non user of android-studio/sdk; If you are an android developer please consider adding yourself to the android-studio maintainers and submitting the appropriate changes to whatever you feel is more reasonable. Right now you need to use overrides. I think above makes a good case for removing ANDROID_HOME from the wrapper. |
Thanks for the reply. Too bad there aren't many android devs using nix. I've checked whether it would be possible to let Android SDK Manager from nixpkgs download SDKs to a different directory (HOME/something) instead of deriving the location from its executable. I haven't found a way to do this. I'll close this for now. If there pops up some option to still be able to do this I'll reopen it again. Also, I don't mind being a maintainer for android-studio. Should I open a PR? |
@bobvanderlinden sorry for noise, so I want to stick with NixOS is there some way to develop Android apps (e.g. virtual box, running Studio GUI from docker container, or something else)? Can you suggest something? |
IMO, this should be reopened as there's still no real solution to the problem. |
@jgillich Agreed. I recently became aware of |
Yep, when I run |
Did anyone try a LD_PRELOAD library that redirects the SDK directory? Or by some other means redirect accesse from that nix store path to $HOME? |
@Radivarig You can't use the 'android' tool from The
You can also configure the plugins yourself: with import <nixpkgs> {};
androidenv.androidsdk {
platformVersions = [ "23" ]; # Anything between 2 - 23
abiVersions = [ "armeabi-v7a" ]; # Also possible: x86, mips, x86_64
useGoogleAPIs = true;
useExtraSupportLibs = true;
useGooglePlayServices = true;
} and install the above SDK composition, by running:
|
@svanderburg: So these open issues we have about android-studio being unuseable on Nix(OS) is basically a due misunderstandings (and possibly lack of documentation...)? Android development is OK with Nix? |
@bjornfor If Android development is OK with Nix? There are always things that can be improved and it depends on what kinds of applications you want to develop. For example, not all the plugins that the Android SDK provides have been packaged. The Nixpkgs documentation can be improved as well, but I think this also applies to other areas of Nixpkgs. I don't want to claim that these android-studio issues are caused by a lack of understanding. There are many reasons for it. There may be some functionality missing, and there is no (convenient) integration pattern allowing one to use a Nix-deployed Android SDK in android-studio. I think the latter is the biggest issue in getting android studio to work. The primary reason for me developing the androidenv package is to automate Android builds on Hydra. For me, it covers all my use cases in the development projects that I'm involved with. For example, last year I have built +/- 100 different kinds of apps with it. |
This commit fixes 2 main problems: - Android Studio comes with its own package manager. The current packaging approach doesn't allow such management. As a result the package is unusable (see NixOS#8650 and NixOS#14903). In this version, $ANDROID_HOME is _not_ set, allowing Android Studio to deal with the Android SDK as it pleases (typically in $HOME/Android/Sdk). - Android Studio downloads prebuilt binaries as part of the SDK. These tools (e.g. `mksdcard`) have `/lib/ld-linux.so.2` set as the interpreter. An FHS environment is used as a work around for that.
At the moment the different Android SDKs are packaged in NixOS. However, Google made its own package manager for these packages: Android SDK Manager. The Android SDK Manager cannot install or upgrade packages, because ANDROID_HOME is set to a /nix/store path, which is read-only.
In addition, Android Studio has a dependency on one Android SDK. At the moment it is
androidsdk_4_4
(nixpkgs/pkgs/top-level/all-packages.nix
Line 11456 in af3d395
I don't know whether I'm missing something, but for actual day-to-day usage it is probably more practical to let Androids SDK Manager do its thing in a home directory and not set
ANDROID_HOME
to a/nix/store
path.What is the best way to solve this problem? Those who use Android Studio on NixOS, how do you make this practical?
The text was updated successfully, but these errors were encountered: