Open yakimant opened 1 year ago
Thank you for reporting this. I'm not a user of apkanalyzer
so I didn't face this problem before. I'll check it today.
why do you want to use the apkanalyzer
that exists in the tools
? You may know that tools
is obsoleted. There's a newer version of it in the cmdline-tools
[nix-shell:/nix/store/h0j69b6wq56kfjz0xj4h6w8qr6apgq06-androidsdk/libexec/android-sdk]$ ls -al $ANDROID_SDK_ROOT/cmdline-tools/9.0/bin/apkanalyzer
-r-xr-xr-x 1 root root 858 Dec 31 1969 /nix/store/h0j69b6wq56kfjz0xj4h6w8qr6apgq06-androidsdk/libexec/android-sdk/cmdline-tools/9.0/bin/apkanalyzer
to have access to it you don't even need to know that! For instance, you can use the examples/shell.nix, then just run apkanalyzer --version
[nix-shell:/nix/store/h0j69b6wq56kfjz0xj4h6w8qr6apgq06-androidsdk/libexec/android-sdk]$ apkanalyzer --help
Verb must be one of:
Usage:
apkanalyzer [global options] <subject> <verb> [options] <apk> [<apk2>]
Option Description
------ -----------
--human-readable Print sizes in human readable format
Let me know if you have more concerns.
I mentioned this workaround in my initial message.
A bit of our case:
apkanalyzer
from tools
was used historicatlly (it can only run on JDK8).
So now we are switching Android SDK Tools to Android SDK Command-Line Tools (it can only run on JDK11, so we upgrade it too).
This issue was created to highlight the issue with apkanalyzer
from tools
in nixpkgs.
It is there, but you cannot run it. I propose either to remove tools
or fix the issue for better clarity.
unfortunately, we cannot remove the tools
because the standard Android SDK keeps installing it, so we have to follow their steps, unless it's not the case anymore :D
Regarding the fix, it doesn't look like it's adding any value, because of the reasons we mentioned above. If I had infinite time I would spend some of it to solve this interesting problem, but unfortunately I don't, but if someone solves it, I would be happy :)
No prob, I actually didn't expect this unpopular issue to be fixed. Let it be here as motivation to use newer tools an JDK =)
I run into a problem regarding platform tools.
I trited to install packages necessary to develop flutter for android (with devbox), but when I run flutter doctor
, I get this error:
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
just for reference, I installed these:
devbox global add openjdk11@latest android-tools@latest flutter@latest
I found this issue when I researched this issue, maybe you know what is the problem.
@BenceBakos :| devbox? here is an issue related to NixOS, not devbox, as you can see in the address bar!!
@BenceBakos :| devbox? here is an issue related to NixOS, not devbox, as you can see in the address bar!!
@hadilq
Sorry for the misunderstanding.
Devbox is just a package manager making the management of nix packages simpler.
I only mentioned it for additional context, the nix package is the same.
Describe the bug
Android SDK Tools are broken. For example running
apkanalyzer
from them:Possible reason
208793,
build-tools
are not linked totools
https://github.com/NixOS/nixpkgs/blob/6d1d80a232a355a65dc4d3bfea1f108e8dac1340/pkgs/development/mobile/androidenv/compose-android-packages.nix#L147-L156
Possible fix
Add a link, but it will couse infinite cycle, as
build-tools
also links to thetools
.Workaround
Switch to JDK11 and Android SDK Command-Line Tools
Steps To Reproduce
Steps to reproduce the behavior:
androidenv
apkanalyzer
from${ANDROID_HOME}/tools/bin/apkanalyzer
Expected behavior
Should print help
Additional context
SDK Tools can only run on JDK8
Notify maintainers
@hadilq
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.