Skip to content
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 ndk 27.x not selectable #1453

Open
cguentherTUChemnitz opened this issue Sep 17, 2024 · 1 comment
Open

android ndk 27.x not selectable #1453

cguentherTUChemnitz opened this issue Sep 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@cguentherTUChemnitz
Copy link

Describe the bug
When i select in devenv.nix android.ndk.version = [] any of the 27.x releases as shown here: https://github.com/android/ndk/releases, devenv is telling that the version does not exist, even without telling which version it is seeing. I updated also to cmdLineTools.version = "12.0" but it did not help.

To reproduce

  android = {
    enable = true;
    platforms.version = [ "32" "34" ];
    systemImageTypes = [ "google_apis_playstore" ];
    abis = [ "arm64-v8a" "x86_64" ];
    # cmakeVersions = [ "3.22.1" ];
    cmdLineTools.version = "12.0";
    tools.version = "26.1.1";
    platformTools.version = "35.0.1";
    buildTools.version = [ "35.0.0-rc2" ];
    emulator = {
      enable = true;
      version = "35.1.4";
    };
    sources.enable = false;
    systemImages.enable = true;
    ndk = {
      enable = true;
      version = [ "27.1.12297006" ];
    };
    googleAPIs.enable = true;
    googleTVAddOns.enable = true;
    extras = [ "extras;google;gcm" ];
    extraLicenses = [
      "android-sdk-preview-license"
      "android-googletv-license"
      "android-sdk-arm-dbt-license"
      "google-gdk-license"
      "intel-android-extra-license"
      "intel-android-sysimage-license"
      "mips-android-sysimage-license"
    ];
    android-studio = {
      enable = true;
      package = pkgs.android-studio;
    };
  };

direnv allow

       … while calling the 'sort' builtin
         at /nix/store/39rsyaxxn4sqvjb721n4sj5dj0fzpi1m-cjz8w4dgc3rd2n3dqv5c208vygndjyba-source/pkgs/development/mobile/androidenv/deploy-androidpackages.nix:6:20:
            5|   extraParams = removeAttrs args [ "packages" "os" "buildInputs" "nativeBuildInputs" "patchesInstructions" ];
            6|   sortedPackages = builtins.sort (x: y: builtins.lessThan x.name y.name) packages;
             |                    ^
            7|

       error: at /nix/store/39rsyaxxn4sqvjb721n4sj5dj0fzpi1m-cjz8w4dgc3rd2n3dqv5c208vygndjyba-source/pkgs/development/mobile/androidenv/compose-android-packages.nix:245:54:
          244|       inherit deployAndroidPackage os platform-tools;
          245|       package = packages.ndk-bundle.${ndkVersion} or packages.ndk.${ndkVersion};
             |                                                      ^
          246|     };

       error: attribute '"27.1.12297006"' missing

Make sure to include full logs and what you expected to happen.

Version
https://devenv.sh 1.1.0

@cguentherTUChemnitz cguentherTUChemnitz added the bug Something isn't working label Sep 17, 2024
@cguentherTUChemnitz
Copy link
Author

cguentherTUChemnitz commented Oct 28, 2024

As far as i understand is this the point, where the selectable ndks are defined:
https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/androidndk-pkgs/default.nix

I am trying to write some overlays to provide the ndk 27.2 but i am failing to do so. Can anyone provide a meaningful override to provide current ndk in devenv.nix?

My current attempt is something like this:

{
  pkgs,
  lib,
  config,
  inputs,
  ...
}:
let
  system = pkgs.stdenv.system;
  nixpkgs = import inputs.nixpkgs {
    inherit system;
    overlays = [
      (final: prev: {
        androidndkPkgs = prev.androidndkPkgs // {
          "27" = prev.androidenv.composeAndroidPackages {
            includeNDK = true;
            ndkVersion = "27.2.12479018";
          };
        };
      })
    ];
  };
in
{
  android = {
    enable = true;
    platforms.version = [ "35" ];
    systemImageTypes = [ "google_apis_playstore" ];
    abis = [ "arm64-v8a" "x86_64" ];
    cmdLineTools.version = "12.0";
    emulator = {
      enable = true;
      version = "35.2.5";
    };
    sources.enable = false;
    systemImages.enable = true;
    ndk = {
      enable = true;
      version = [ "27" ];
    };
    extraLicenses = [
      "android-sdk-preview-license"
      "android-googletv-license"
      "android-sdk-arm-dbt-license"
      "google-gdk-license"
      "intel-android-extra-license"
      "intel-android-sysimage-license"
      "mips-android-sysimage-license"
    ];
  };
}

But it does not pick up the populated version 27, even running with github:NixOS/nixpkgs/nixpkgs-unstable channel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant