Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 2.3.3 stucks when first run

I downloaded Android Studio 2.3.3 for Linux and unzipped the content to /usr/local then

$ cd android-studio/bin

Edited the file idea.properties and appended a following line to it:

disable.android.first.run=true

Then launched Android Studio:

$ sudo sh studio.sh

Looking in classpath from com.intellij.util.lang.UrlClassLoader@1a7cec2 for /com/sun/jna/linux-x86/libjnidispatch.so
Found library resource at jar:file:/usr/local/android-studio/lib/jna.jar!/com/sun/jna/linux-x86/libjnidispatch.so
Trying /root/.AndroidStudio2.3/system/tmp/jna5562911082428971611.tmp
Found jnidispatch at /root/.AndroidStudio2.3/system/tmp/jna5562911082428971611.tmp
[  40066]   WARN - dea.updater.SdkComponentSource - File /root/.android/repositories.cfg could not be loaded. 
^C[18124266]   WARN - pl.local.NativeFileWatcherImpl - Watcher terminated with exit code 130 

And it will stuck. After long waiting I termited it with Ctrl+C

like image 521
xralf Avatar asked Jul 01 '17 07:07

xralf


People also ask

Why Android Studio is not running the app?

Unplug your device from the USB port on the computer. Restart the device by powering off and back on. Verify that Settings => Developer options => USB Debugging is enabled. Quit and re-launch Android Studio.


1 Answers

Try attaching to the process with strace to see what it's doing (for example, waiting on a network or file). Or run it with strace like this:

strace -o foo.log -s1024 -f ./studio.sh

After a while, break it with Ctrl-C and examine the log file for syscalls like open, read, recvmsg.

Alternatively, while it's running, you can attach with a Java profiler to the jvm. For a start, you can launch jconsole or jvisualvm and attach to the Android Studio (it will show as an empty name, with only PID) and view stack traces of individual threads. In jvisualvm you can view the CPU usage sample and click on the hot event and see the stack trace.

Basically you need to find out what the app is trying to access for so long. Most likely some network resource.

like image 180
alexst Avatar answered Oct 01 '22 18:10

alexst