tadfisher / android-nixpkgs

Nix-packaged Android SDK
MIT License
294 stars 44 forks source link

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

Open fdietze opened 2 months ago

fdietze commented 2 months ago

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

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

praguevara commented 1 month ago

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

fdietze commented 1 month ago

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?

fdietze commented 2 weeks ago

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