IntelliJ IDEA - ADB error=2

已回答

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.

 

0

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/adb path?

How did you install adb in your system exactly?

0

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/adb path

I got adb installing Android SDK Platform-Tools using the Android SDK Updater in the Settings. 
 

Log

2025-09-29 20:16:53,486 [  17254]   WARN - #com.android.ddmlib - Cannot run program "/home/etchot/Android/Sdk/platform-tools/adb": error=2, No such file or directory
2025-09-29 20:16:53,490 [  17258]   WARN - #com.android.tools.idea.adb.AdbService - Error creating adb
java.lang.IllegalArgumentException: java.io.IOException: Cannot run program "/home/etchot/Android/Sdk/platform-tools/adb": error=2, No such file or directory
    at com.android.ddmlib.AndroidDebugBridgeImpl.initOsLocationAndCheckVersion(AndroidDebugBridgeImpl.java:835)
    at com.android.ddmlib.AndroidDebugBridgeImpl.lambda$createBridge$14(AndroidDebugBridgeImpl.java:566)
    at com.android.ddmlib.AndroidDebugBridgeImpl.logCall(AndroidDebugBridgeImpl.java:1742)
    at com.android.ddmlib.AndroidDebugBridgeImpl.createBridge(AndroidDebugBridgeImpl.java:535)
    at com.android.ddmlib.AndroidDebugBridge.createBridge(AndroidDebugBridge.java:419)
    at com.android.tools.idea.adb.AdbService$Implementation.createBridge(AdbService.java:520)
    at com.android.tools.idea.adb.AdbService$Implementation.getAndroidDebugBridge(AdbService.java:473)
    at com.android.tools.idea.adb.AdbService.lambda$getDebugBridge$0(AdbService.java:208)
    at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:128)
    at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:74)
    at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:80)
    at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167)
    at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167)
    at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:173)
    at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:167)
    at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
    at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:248)
    at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:27)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:226)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:249)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:211)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
    at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.io.IOException: Cannot run program "/home/etchot/Android/Sdk/platform-tools/adb": error=2, No such file or directory
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
    at com.android.ddmlib.AndroidDebugBridgeImpl.lambda$runAdb$26(AndroidDebugBridgeImpl.java:912)
    ... 1 more
Caused by: java.io.IOException: error=2, No such file or directory
    at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
    at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
    at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
    ... 3 more
 
0

Thank you.

Are you able to cd to the /home/etchot/Android/Sdk/platform-tools directory from within the IDE Terminal? Can you run adb version there 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.

0

I am able to cd to the /home/etchot/Android/Sdk/platform-tools directory from within the IDE Terminal but I can't run adb 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) 

0

Can you cd to /home/etchot/Android/Sdk/platform-tools in the OS terminal and run adb version there?

Can you run echo $PATH in the system terminal and check if /home/etchot/Android/Sdk/platform-tools is on it? If not, add it there, save changes, re-login into the system and launch the IDE again.

 

0

ADB version in the OS terminal:

[BOX64] Box64 arm64 v0.3.7 ba973183 with Dynarec built on Oct  1 2025 06:24:57
[BOX64] Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2
[BOX64] Running on Cortex-A76 with 4 cores, pagesize: 4096
[BOX64] Will use hardware counter measured at 54.0 MHz emulating 3.4 GHz
[BOX64] Didn't detect 48bits of address space, considering it's 39bits
[BOX64] Counted 59 Env var
[BOX64] Library search path: 
[BOX64] Binary search path: ./:bin/:/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/Android/Sdk/platform-tools/
[BOX64] Looking for /home/etchot/Android/Sdk/platform-tools/adb
[BOX64] argv[1]="version"
[BOX64] Rename process to "adb"
[BOX64] Using native(wrapped) libdl.so.2
[BOX64] Using native(wrapped) libpthread.so.0
[BOX64] Using native(wrapped) libm.so.6
[BOX64] Using native(wrapped) librt.so.1
[BOX64] Using emulated /usr/lib/box64-x86_64-linux-gnu/libgcc_s.so.1
[BOX64] Using native(wrapped) libc.so.6
[BOX64] Using native(wrapped) ld-linux-x86-64.so.2
[BOX64] Using native(wrapped) libutil.so.1
[BOX64] Using native(wrapped) libbsd.so.0
[BOX64] Warning: Weak Symbol __gmon_start__ not found, cannot apply R_X86_64_JUMP_SLOT @0x10071f488 (0x6fea96)
[BOX64] Warning: Weak Symbol OPENSSL_memory_alloc not found, cannot apply R_X86_64_JUMP_SLOT @0x10071f9f0 (0x6ff566)
[BOX64] Warning: Weak Symbol OPENSSL_memory_free not found, cannot apply R_X86_64_JUMP_SLOT @0x10071f9f8 (0x6ff576)
[BOX64] Warning: Weak Symbol OPENSSL_memory_get_size not found, cannot apply R_X86_64_JUMP_SLOT @0x10071fa00 (0x6ff586)
	Android Debug Bridge version 1.0.41
	Version 36.0.0-13206524
	Installed as /home/etchot/Android/Sdk/platform-tools/adb
	Running on Linux 6.12.47+rpt-rpi-v8 (x86_64)

Now the IDE is showing the following message:

error: cannot connect to daemon
'/home/etchot/Android/Sdk/platform-tools/adb start-server' failed -- run manually if necessary

When I run adb start-server in the OS terminal, I get the following error: 

...
[BOX64] 5966|SIGSEGV @0x7f87fee6d0 (???(/lib/aarch64-linux-gnu/libc.so.6+0x9e6d0)) (x64pc=0x30051213/"???", rsp=0x7f87b7a8d8, stack=0x7f8737c000:0x7f87b7c000 own=(nil) fp=0x7f87b7a900), for accessing 0x1 (code=1/prot=0), db=(nil)((nil):(nil)/(nil):(nil)/???:clean, hash:0/0) handler=(nil)
RSP-0x20:0x000000000000000f RSP-0x18:0x0000007f87b7aa29 RSP-0x10:0x0000000100683286 RSP-0x08:0x000000010006a054
RSP+0x00:0x00000001001d2b69 RSP+0x08:0x0000007f87b7a9c1 RSP+0x10:0x0000000000000000 RSP+0x18:0x000000006d3d0ec0
RAX:0x000000000000174e RCX:0x0000000100701700 RDX:0x000000000000174e RBX:0x000000010075f460 
RSP:0x0000007f87b7a8d8 RBP:0x0000007f87b7a900 RSI:0x0000007f87fd50a0 RDI:0x00000000000000ba 
R8:0x0000000000000000  R9:0x000000000000001a R10:0x000000000000000f R11:0x0000000000000006 
R12:0x000000010075f498 R13:0x0000000000000000 R14:0x0000007f87b7b10c R15:0x000000010075f468 
ES:0x002b CS:0x0033 SS:0x002b DS:0x002b FS:0x0043 GS:0x0053 
	ADB server didn't ACK
	Full server startup log: /tmp/adb.1000.log
	Server had pid: 5966
	* failed to start daemon
	error: cannot connect to daemon

Upload id: 2025_10_01_omWX2hSrXCVfq5ASWpdHr6 (file: adb start-server)
 

0

Today I installed a BOX64 update. Maybe it has something to do with the adb start-server error.

0

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.

0

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 5037

 

Try removing Android tools installed by the IDE and installing ADB using OS package manager:

    sudo apt update
    sudo apt install android-tools-adb android-tools-fastboot

(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 to localhost. Verify its status with ip addr show lo and ensure it's configured correctly in /etc/network/interfaces.

0

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?

0

Does it help if you specify /usr/lib/android-sdk instead?

0

No, I am afraid not. If I specify /usr/lib/android-sdk, I get the same error.

0

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
 

0
Did you try rebooting the system?
Can you attach a screenshot of the error as it appears in the UI?
0

Yes, I tried rebooting the system.

Screenshot in upload id: 2025_10_04_67sVxWKSyjDqeKTsM2JT1R (file: IDE terminal error.png)

0

Log file in upload id: 2025_10_04_8NiSEx38e7mYq1jpNowYDb (file: idea.log)

0

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.

0

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?

 

0
I submitted a new bug report for this just so that it gets more attention: https://youtrack.jetbrains.com/issue/IDEA-380451
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.
0

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.

0

请先登录再写评论。