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

Unable to recognize NDK (and Gradle?) #79

Open
c4lliope opened this issue Nov 28, 2023 · 0 comments
Open

Unable to recognize NDK (and Gradle?) #79

c4lliope opened this issue Nov 28, 2023 · 0 comments

Comments

@c4lliope
Copy link

Hello! I'm seeing an issue in the use of the NDK package.
I'm inexperienced in Android and a beginner in Nix; apologies on any simple errors I make.

I am running nix-shell android.nix --run android-studio; here's android.nix:

{ pkgs ? import <nixpkgs> { } }:
with pkgs;
let
  android-nixpkgs = callPackage <android-nixpkgs> { };
  android-sdk = android-nixpkgs.sdk (sdkPkgs: with sdkPkgs; [
    cmdline-tools-latest
    build-tools-34-0-0
    platform-tools
    platforms-android-34
    emulator
    ndk-21-4-7075529
  ]);
in mkShell { buildInputs = [ android-studio android-sdk gradle ]; }

To begin, I had an error for a while regarding an unrecognized gradle;
I had to change my distributionUrl inside gradle-wrapper.properties to use 8.4.

distributionUrl=https://services.gradle.org/distributions/gradle-8.4-bin.zip

Once I do this, gradlew pulls a copy of gradle rather than using the one I asked for in android.nix.
Only a minor issue I guess.

My bigger problem is that the NDK is also unrecognized, and android has less luck pulling the missing copy to the read-only /nix/store.

Failed to install the following SDK components:
    ndk;21.4.7075529 NDK (Side by side) 21.4.7075529
The SDK directory is not writable (/nix/store/8vgf0v69gmkgyaxbvfs58rp9pfw6xdx5-android-sdk-env/share/android-sdk)

Maybe the problem is in the example app I am using - since no one else has opened these issues.
I'm using https://github.com/elixir-desktop/android-example-app and only changed the line inside gradle-wrapper.properties as described earlier.

I hope someone can lend a couple hands and a keyboard to help me launch to Android again.

This same app had been surprisingly easy to build on Fedora, and I'd been eager to add mobile apps to my arsenal. Seems like the Android onboarding experience has had large upgrades in prior years, though on NixOS there remains a need to build from square one. Hope this issue helps more people use the NDK seamlessly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant