tadfisher/android-nixpkgs

Could not start dynamically linked executable /nix/store/..../build-tools.../aapt

Opened this issue · 3 comments

I'm getting this error, even after updating to 6cc08ea:

Could not start dynamically linked executable: /nix/store/d6ha4xhym5ibiy4105qfznsprdpxzbln-android-sdk-env/share/android-sdk/build-tools/30.0.3/aapt
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld

This binary was called from a flutter run command.

related #99, #103

I'm getting this error, even after updating to 6cc08ea:

Could not start dynamically linked executable: /nix/store/d6ha4xhym5ibiy4105qfznsprdpxzbln-android-sdk-env/share/android-sdk/build-tools/30.0.3/aapt
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld

This binary was called from a flutter run command.

related #99, #103

I had the same issue, and fixed it adding this to my flake:

GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidSdk}/share/android-sdk/build-tools/34.0.0/aapt2";

https://wiki.nixos.org/wiki/Android#gradlew

GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidSdk}/share/android-sdk/build-tools/34.0.0/aapt2";

That's also what I'm using for kotlin based android apps. But flutter seems to run aapt2 directly...

I guess that in some nix file here I have to patchelf it. But I don't know how to do that yet. Any hints which files I should look at?

A workaround to get going on NixOS systems: https://github.com/nix-community/nix-ld