Skip to main content
All CollectionsKnowledge BaseAndroid
Error: Missing cmdline-tools
Error: Missing cmdline-tools
Updated over a week ago

Issue:

When building an Android app, you run into an error that looks similar to this:

Cannot run program "/usr/local/share/android-sdk/cmdline-tools/latest/bin/sdkmanager": error=2, No such file or directory

Based on the error it may seem like that cmdline-tools is missing from our stacks.

Possible Solutions:

You can confirm that cmdline-tools are installed on our stacks running a script like sdkmanager --list. If it exists, the command fails due to the path it is trying to use.

The command is trying to access this path: /usr/local/share/android-sdk/cmdline-tools/latest/bin/sdkmanager.

The path in our stacks for sdk manager is the following: /usr/local/share/android-sdk/cmdline-tools/cmdline-tools/bin/sdkmanager.

Based on this information, you can create a symlink with the following script:

mkdir /usr/local/share/android-sdk/cmdline-tools/latest/
mkdir /usr/local/share/android-sdk/cmdline-tools/latest/bin/
ln -s /usr/local/share/android-sdk/cmdline-tools/cmdline-tools/bin/sdkmanager
/usr/local/share/android-sdk/cmdline-tools/latest/bin/sdkmanager
/usr/local/share/android-sdk/cmdline-tools/latest/bin/sdkmanager --licenses

Your symlink should now allow for the program to run on the correct path.

Did this answer your question?