{ pkgs, android-nixpkgs }:

let
  android = pkgs.callPackage android-nixpkgs { };
  androidSdk = android.sdk (
    sdkPkgs: with sdkPkgs; [
      cmdline-tools-latest
      build-tools-35-0-0
      platform-tools
      platforms-android-35
    ]
  );

in
pkgs.mkShell rec {
  buildInputs = with pkgs; [
    androidSdk
    jdk17
    glibc
  ];

  ANDROID_JAVA_HOME = "${pkgs.jdk17.home}";
  ANDROID_SDK_ROOT = "${androidSdk}/share/android-sdk";
  GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${ANDROID_SDK_ROOT}/build-tools/35.0.0/aapt2";
}
