1

PROBLEM

Hi, I have IntelliJ Ultimate 2025.2.4, and Android Studio 2025.2.1. When I create a new default project in either one > download all the sources it needs > sync gradle > then click the green button to run the app up top:

green run button up top

I then get a loading loop like these. It goes nowhere, forever:

loading loop 1

loading loop 2

But when I start the emulator from the command line like this:

/home/my_user/Android/Sdk/emulator/emulator -avd MyVirtualDeviceName -wipe-data -no-snapshot -verbose -show-kernel

Then the emulator boots up and runs fine within like 15 seconds, and I can play with it. But it doesn't install the program to test it on there (as expected).

Even worse, I can't even get log files from logcat unless the device fully starts. It constantly says OFFLINE. So I can only guess on where to start. Here's how it looks when starting it via the green play button:

logcat doesn't run after I hit the green play button

And here's how it looks when starting it from the command line:

logcat and android started from command line

The JVM version runs the default program just fine by the way, and I have another question related to this same issue, but further tests in there make me think the answer to that is just a $PATH issue, because I'm making something with Kotlin Multi Platform, and the quickstart instructions said to add export ANDROID_HOME=~/Library/Android/Sdk to ~/.profile.

But echo $ANDROID_HOME returned nothing. So the KMP docs must be outdated, because the proper folder is actually ~/Android/Sdk.

I also checked answers like this, but it's not relative, because I have the proper images for the emulator.

In step 4 at the quickstart instructions, they ask you to add that line, then to add the following ones if you need to troubleshoot. They also ask you to add all these entries into the $PATH variable in the same file:

ANDROID_HOME/tools
ANDROID_HOME/tools/bin
ANDROID_HOME/platform-tools

But the ANDROID_HOME/tools folders don't exist (they were changed years ago). Only ANDROID_HOME/platform-tools does:

folders that exist

Because those folders don't exist, my best guess is that I might need to add paths to some other binaries, like the emulator folder, but I don't know which ones. So I added $PATH variables for everything I think I need inside /home/my_user/Android/Sdk, and put it in ~/.bashrc. I added them in alphabetical order too:

# all at the bottom of ~/.bashrc
export ANDROID_HOME=~/Android/Sdk
export ANDROID_EMULATOR="$ANDROID_HOME/emulator"
export ANDROID_PLATFORM_TOOLS="$ANDROID_HOME/platform-tools"
export PATH="$PATH:$ANDROID_HOME:$ANDROID_EMULATOR:$ANDROID_PLATFORM_TOOLS"

echo $ANDROID_HOME, etc., all return their proper paths. I can cd into all of them properly like cd $ANDROID_PLATFORM_TOOLS.

This is also what echo $PATH returns:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/my_user/.local/share/JetBrains/Toolbox/scripts:/home/my_user/Android/Sdk:/home/my_user/Android/Sdk/emulator:/home/my_user/Android/Sdk/platform-tools

So I'll close either IDE > open it again > create a new, or open a default project > click the green play button > and it gets stuck in the same loading loop.

The JVM versions of the default program run fine, but not android.

QUESTION

Are the values in my $PATH correct?? Anyone have any idea how to fix this??? Do you know anywhere I can look to debug this myself??

Any help is REALLY appreciated, because I been stuck at this for like a month, and it worked fine like a month ago, before I restored my hard drive.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.