Android: Difference between revisions

imported>Jappeace
Add config that prevents you having to download the entire sdk again
imported>Jappeace
Undo adding sdk from nix to android studio, it'll break android studio.
Line 102: Line 102:
<syntaxhighlight lang=console>
<syntaxhighlight lang=console>
$ nix-shell -p android-studio --run android-studio
$ nix-shell -p android-studio --run android-studio
</syntaxhighlight>
To link up with nix sdk and have gradlew:
<syntaxhighlight lang=nix>
{ pkgs ? import <nixpkgs> {config.android_sdk.accept_license = true; config.allowUnfree = true;} }:
let
  androidSdk = pkgs.androidenv.androidPkgs_9_0.androidsdk;
in
pkgs.mkShell {
  buildInputs = [
    androidSdk
    pkgs.glibc
    pkgs.android-studio
  ];
  # override the aapt2 that gradle uses with the nix-shipped version
  GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidSdk}/libexec/android-sdk/build-tools/28.0.3/aapt2";
  ANDROID_SDK_ROOT="${androidSdk}/libexec/android-sdk/";
}
</syntaxhighlight>
</syntaxhighlight>