I have a small android application (made with gradle
) and would like to build and test it in gitlab CI. Many other components are built with Nix already, so it’s okay to use Nix for that. The documentation suggests pkgs.androidenv.buildApp
, but I cannot figure out how to use it correctly. I am trying the following flake:
{
description = "example";
inputs.nixpkgs.url = "nixpkgs/nixos-23.05";
outputs = { self, nixpkgs }: {
packages.x86_64-linux.default = let
pkgs = import nixpkgs {
system = "x86_64-linux";
config.android_sdk.accept_license = true;
config.allowUnfree = true;
};
androidenv = pkgs.androidenv;
in androidenv.buildApp {
name = "example watches";
src = ./app;
platformVersion = [ "28" ];
};
};
}
nix build
fails fast with a message:
error: 'functionArgs' requires a function
at /nix/store/93i8f7404djndcryp55cvpcydjgbnxhg-source/pkgs/development/mobile/androidenv/build-app.nix:12:26:
11| let
12| androidSdkFormalArgs = builtins.functionArgs composeAndroidPackages;
| ^
13| androidArgs = builtins.intersectAttrs androidSdkFormalArgs args;
What am I missing?
I would be also glad to see a complete example, it’s hard to find such one.