IntelliJ IDEA - ADB error=2
Answered
Hi,
I created an Android app project in IntelliJ IDEA and it is displaying the error Cannot run program ”/home/my user/Android/Sdk/platform-tools/adb": error=2, No such file or directory. I am running IntelliJ IDEA 2025.2.2 (Community Edition) on Raspbian Bookworm. ADB is available in /home/my user/Android/Sdk/platform-tools directory. Why is the error displayed? I can't run my Android app.
Please sign in to leave a comment.
Hi there,
How are you launching the IDE? Via a shortcut?
Can you try launching it using the command prompt (OS terminal), and then checking again?
Are there any symbolic links in the
/home/my user/Android/Sdk/platform-tools/adbpath?How did you install
adbin your system exactly?Hi Arina,
I tried launching it using the terminal (./idea.sh) and I got the same error.
There isn't any symbolic link in the
/home/my user/Android/Sdk/platform-tools/adbpathI got adb installing Android SDK Platform-Tools using the Android SDK Updater in the Settings.
Log
Thank you.
Are you able to cd to the
/home/etchot/Android/Sdk/platform-toolsdirectory from within the IDE Terminal? Can you runadb versionthere and attach a screenshot of the terminal window with output?Also, please provide the idea.log file collected after reproducing the issue: Help | Show Log in…. I will analyze the flow of events and check your system environment settings.
Logs can be uploaded securely to https://uploads.jetbrains.com. Make sure to share the ID of the upload here so that I can find it.
I am able to cd to the
/home/etchot/Android/Sdk/platform-toolsdirectory from within the IDE Terminal but I can't runadb version. The following message is displayed: bash: adb: command not found.Upload id for the log file is: 2025_09_30_XuxWTETdVa7A3etMZCYjM7 (file: idea.log)
Can you
cdto/home/etchot/Android/Sdk/platform-toolsin the OS terminal and runadb versionthere?Can you run
echo $PATHin the system terminal and check if/home/etchot/Android/Sdk/platform-toolsis on it? If not, add it there, save changes, re-login into the system and launch the IDE again.ADB version in the OS terminal:
Now the IDE is showing the following message:
When I run
adb start-serverin the OS terminal, I get the following error:Upload id: 2025_10_01_omWX2hSrXCVfq5ASWpdHr6 (file: adb start-server)
Today I installed a BOX64 update. Maybe it has something to do with the adb start-server error.
https://stackoverflow.com/questions/23415746/how-to-resolve-the-adb-server-didnt-ack-error
https://stackoverflow.com/questions/47570678/adb-start-server-command-fails
None of the solutions in the two posts fixed the issue.
I decided to uninstall all Android SDK components and the Android plugin in the IDE. I also removed the .Android and /Android directories manually. I installed the Android plugin in the IDE again and during the Gradle building I was requested to point at the Android SDK directory but I cancelled it because the Android SDK was not installed. I went to the Android SDK Manager/Updater, installed Android API3 36, Android SDK Platform 36 and Android SDK Build-Tools 36.1. I restarted the Gradle building and it ended successfully but it installed Android SDK Build-Tools 35.0. Why? Anyway the issue with ADB is still there. I am unable to run the adb start-server command. Any other possible solutions?
Thank you for your support.
Which commands did you run to try and fix this? In which terminal did you run them: OS or IDE?
Did you try checking if port 5037 is used by another process that needs to be killed?
sudo netstat -tulnp | grep 5037Try removing Android tools installed by the IDE and installing ADB using OS package manager:
(or the equivalent package manager commands for your specific Linux distribution).
In some cases, VPN connections can interfere with ADB's communication. Temporarily disable any active VPN and try again.
Check loopback interface. If the loopback interface (
lo) is down, ADB might not be able to bind tolocalhost. Verify its status withip addr show loand ensure it's configured correctly in/etc/network/interfaces.I run the sudo apt-get install android-sdk command in the OS terminal and now I am able to succesfully run adb start-server. However when I am requested by the IDE to specify the Android SDK Home, I get the error “The selected directory is not a valid home for Android SDK” when specifying the correct directory (/usr/lib/android-sdk/platform-tools/). How can I fix this error?
Does it help if you specify
/usr/lib/android-sdkinstead?No, I am afraid not. If I specify /usr/lib/android-sdk, I get the same error.
When trying to open the IDE terminal I get the error “To make the IDE accessible from the command line, please add '/home/etchot/IntelliJ/idea-IC-252.26199.169/bin' to the $PATH variable and use 'idea.sh' to run commands.” but I already added the path of idea.sh to the $PATH variable.
echo $PATH
/home/etchot/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/snap/bin:/home/etchot/IntelliJ/idea-IC-252.26199.169/bin
Can you attach a screenshot of the error as it appears in the UI?
Yes, I tried rebooting the system.
Screenshot in upload id: 2025_10_04_67sVxWKSyjDqeKTsM2JT1R (file: IDE terminal error.png)
Log file in upload id: 2025_10_04_8NiSEx38e7mYq1jpNowYDb (file: idea.log)
Thanks for the logs. Looks like it's a known issue: see IDEA-173890 and IDEA-212787
As a workaround, see if it helps to install Android Studio and create a new project there. Then, in IntelliJ IDEA under Project Structure | SDKs settings, you should be able to select the Android SDKs downloaded and installed by Android Studio.
Let me know if it doesn't help.
Which is the expected resolution date for this known issue?
Android Studio can't be installed in my computer since there is no ARM 64bits Linux OS version available. Is there any other workaround for the issue?
I also asked our Android developer to take a look at the log and suggest workarounds or additional things to check.
You are welcome to track the progress in the YouTrack issue directly by hitting the 'star' button at the top right corner.
Unfortunately, I can't provide any solid ETA for resolution, but you will receive a new email as soon as there is an update in the ticket.
Thanks.
Thank you for opening the issue and asking your Android developer for workarounds or additional things to check. I am tracking the progress of the issue now.