2

Does anyone experienced and know how to fix this issue:

Android Studio sometimes (randomly) does not show any content in dialogs (find, commit, compare dialogs). It takes a part of screen which was visible in that area where dialogs appears. And content of dialog is not refreshed and not visible at all.

All functionality of that dialog works, just I can't see anything. Here's how it looks like: Find in Path with no content

Anyone knows how to fix this?

I'm working on Ununtu 15.04 with Android Studio 1.2.1.1, which is based on IntelliJ IDEA. About Android Studio

Java version is 1.8:

vilius@vilnius:~$ java -version
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
vilius@vilnius:~$ 
ViliusK
  • 11,345
  • 4
  • 67
  • 71
  • 1
    Yes, I have similar issue as well, but reopening the dialog normally helps. However, more weird issue is when IDE somehow freezes and you can do everything with the mouse, but nothing with the keyboard, this is completely annoying and the only fix I found so far is to restart the IDE. – Rufi May 26 '15 at 10:28
  • I'm on my way finding the solution. Take a look to About dialog! It shows, that another java (openJDK) is used. I'm looking to find where Android Studio takes this configuration from, so it uses non Oracle Java. – ViliusK May 26 '15 at 10:33
  • I have a feeling, that this happens because of OpenJDK. – ViliusK May 26 '15 at 10:34
  • I would be surprised if it because of OpenJDK. – Rufi May 26 '15 at 10:58
  • Do you also use Ubuntu? Did you also have "Locked to Launcher" your Android Studio application icon/button? – ViliusK May 26 '15 at 11:03
  • When I'm launching from "Locked" button for Android Studio, I'm getting this message: "OpenJDK shows intermittent performance and UI issues. We recommend using the Oracle JRE/JDK." – ViliusK May 26 '15 at 11:03

5 Answers5

2
  1. STUDIO_JDK=/usr/lib/jvm/jdk1.8.0_60 add to /etc/environment
  2. create new Launcher over old: Android Studio - Tools -CreateDesktopEntry
Rick Smith
  • 9,031
  • 15
  • 81
  • 85
ggm
  • 21
  • 2
1

So apparently it's because I've done "Lock to Launcher" to keep Android Studio visible in Launcher all the time. It creates shortcut which then uses OpenJDK instead of Oracle Java.

That's when I'm getting this message:

OpenJDK shows intermittent performance and UI issues. We recommend using the Oracle JRE/JDK.

In android-studio/bin/studio.sh file it's written, that $STUDIO_JDK environment variable is used to determine which java to use when launching Android Studio IDE.

To find which java is running for your Android Studio, you can check System Monitor: system monitor shows which java is used to run Android Studio

Or Android Studio-> about also tells you which JVM is used: Android Studio About dialog

The answer

Install Oracle Java. Create $STUDIO_JDK environment variable which directs to Oracle Java. Don't use Lock to Launcher functionality.

Community
  • 1
  • 1
ViliusK
  • 11,345
  • 4
  • 67
  • 71
  • I actually found that I have java-8-oracle, so I don't use OpenJDK, maybe I was using it at some point and that time i had this issue, but good to know. Interesting findings! – Rufi May 26 '15 at 11:24
  • Well, I've started doubt with this answer, because I've noticed empty dialog window with Oracle's Java too. Maybe it's after laptop was suspended and Window Manager not woke up correctly. – ViliusK May 27 '15 at 10:12
1

It's Ubuntu's bug, and solution is to just kill compiz. You can do it from command line or System monitor.

All running applications will be brought to 1st desktop, and you'll be able to continue your work.

System monitor showing how to kill compiz process

Community
  • 1
  • 1
ViliusK
  • 11,345
  • 4
  • 67
  • 71
0

Tried both Oracle and OpenJDK Java by setting STUDIO_JDK environment variable:

#export STUDIO_JDK=/usr/lib/jvm/java-8-oracle
export STUDIO_JDK=/usr/lib/jvm/java-7-openjdk-amd64

Still experiencing this issue sometimes. :/

Changing Settings->Appearance & Behavior->Appearance->UI Options->Theme does not help either.

ViliusK
  • 11,345
  • 4
  • 67
  • 71
0

Apparently, it's Ubuntu's bug: https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/1072206

Bug Description

[ Impact ]

With nVidia hardware from time to time window content is rendered
black or transparent. The problem manifests more frequently as 
session uptime increases.

Apparently the problem was caused by textures being cached and 
not freed, resulting in memory exhaustion conditions. It turns out 
the texture caching is unnecessary anyway.

[ Test Case ]

Verification requires an nVidia GPU with proprietary drivers. 
The problem can not be reproduced at will, only after some 
time (depending on resident GPU memory and usage) and even 
then only randomly and unreliably.

[ Regression Potential ]

It is unlikely this change has the potential to introduce 
new regressions.

[ Other Info ]

Fix was cherry-picked from the Ubuntu "Vivid Vervet" dev release
where it has been in use for some weeks without problem.
ViliusK
  • 11,345
  • 4
  • 67
  • 71