You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 16.04中Android Studio后台运行但无法在主屏启动求助

Fix for Android Studio Running in Background but Not Showing UI on Ubuntu 16.04

Hey there, I’ve dealt with this exact frustrating issue on Ubuntu 16.04 before—you launch Android Studio, see it chugging along in the background, but no window ever pops up on your main screen. Let’s walk through some tried-and-true fixes to get it displaying properly:

1. Force Disable HiDPI Scaling (Common Culprit)

Ubuntu 16.04’s display scaling often clashes with Android Studio’s UI rendering, especially on high-res screens. Here’s how to override it:

  • Locate the Android Studio startup script, usually at /opt/android-studio/bin/studio.sh (adjust the path if you installed it in a custom location).
  • Open it with a text editor (e.g., sudo nano /opt/android-studio/bin/studio.sh).
  • Add this line at the very top, before any other commands:
    export _JAVA_OPTIONS="-Dsun.java2d.uiScale=1"
    
  • Save the file and restart Android Studio.

2. Reset Off-Screen Window Position

Sometimes the app window gets stuck outside your visible screen area. Use wmctrl to yank it back:

  • First, install wmctrl if you don’t have it:
    sudo apt-get install wmctrl
    
  • List all open windows to find Android Studio’s unique ID:
    wmctrl -l
    
    Look for the entry with "Android Studio" in the name—the first number is its window ID.
  • Move the window to your main screen (adjust the width/height values to match your display):
    wmctrl -i -r <YOUR_WINDOW_ID> -e 0,0,0,1280,720
    

3. Switch to Oracle JDK 8 (Avoid OpenJDK Compatibility Glitches)

Ubuntu 16.04’s default OpenJDK can cause UI rendering bugs with Android Studio. Oracle JDK 8 is far more reliable here:

  • Add the WebUpd8 PPA to access Oracle JDK packages:
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    
  • Install JDK 8 and set it as your system default:
    sudo apt-get install oracle-java8-installer
    sudo apt-get install oracle-java8-set-default
    
  • Verify the installation worked:
    java -version
    
    You should see output showing java version "1.8.x".

4. Wipe Corrupted Configuration Cache

If none of the above works, a damaged config folder might be breaking the UI load:

  • First, kill all running Android Studio processes:
    ps aux | grep android-studio | awk '{print $2}' | xargs kill
    
  • Delete the configuration directory (replace <VERSION> with your Android Studio version, like 4.2):
    rm -rf ~/.AndroidStudio<VERSION>
    
  • Launch Android Studio again—it’ll rebuild fresh config files from scratch.

If all else fails, try downloading the latest Android Studio package directly, extract it, and run the studio.sh script from the extracted folder. The Ubuntu Software Center version sometimes has unresolved dependency quirks that cause this issue.

内容的提问来源于stack exchange,提问作者Harshit

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 04:55:05