LoginSignup
4
2

More than 5 years have passed since last update.

ubuntuでAndroid StudioのEmulatorが起動しない問題

Last updated at Posted at 2017-11-18

環境

- ubuntu17.10
- Android Studio 3.0

エミュレータを動かそうとすると、下記のようなエラーとなり起動に失敗してしまいます。

1:08    Gradle sync started

1:08    Project setup started

1:08    Gradle sync finished in 2s 16ms (from cached state)

1:09    Executing tasks: [:app:assembleDebug]

1:09    Emulator: libGL error: unable to load driver: nouveau_dri.so

1:09    Emulator: libGL error: driver pointer missing

1:09    Emulator: libGL error: failed to load driver: nouveau

1:09    Emulator: libGL error: unable to load driver: swrast_dri.so

1:09    Emulator: libGL error: failed to load driver: swrast

1:09    Emulator: X Error of failed request:  BadValue (integer parameter out of range for operation)

1:09    Emulator: Major opcode of failed request:  155 (GLX)

1:09    Emulator: Minor opcode of failed request:  24 (X_GLXCreateNewContext)

1:09    Emulator: Value in failed request:  0x0

1:09    Emulator: Serial number of failed request:  33

1:09    Emulator: Current serial number in output stream:  34

1:09    Emulator: Process finished with exit code 1

1:09    Gradle build finished in 10s 28ms

調べると環境変数にANDROID_EMULATOR_USE_SYSTEM_LIBS=1を設定すると解決するようです。
参考:https://qiita.com/fjmthdk/items/64e57a559dab6d5235d3

export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1

Android Studioを再起動してエミュレータを起動してみると、今度は起動しました。
が、起動してから数秒で落ちてしまいます。
エラー内容はこちら

1:24    Emulator: Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

これは調べても解決方法が見当たらなったので、手当り次第にAVDの設定を弄っていたところ、
Emulated PerformanceのGraphicsをAutomaticからSoftwareに変更すると起動するようになりました。
Herdwareにすると落ちることから、AutomaticでHerdwareになっていたのが原因みたいです。

Android Studioの公式ガイド:https://developer.android.com/studio/run/managing-avds.html?hl=ja#hpproperties によるとEmulated PerformanceのGraphics項目は

エミュレータでのグラフィックのレンダリング方法を選択します。

[Hardware]: コンピュータ グラフィック カードを使用して高速レンダリングします。
[Software]: ソフトウェアでグラフィックをエミュレートします。グラフィック カードでのレンダリングに問題がある場合に便利です。
[Auto]: グラフィック カードに応じてエミュレータが最適なオプションを選択します。

とのことです。私のPCのグラボは玄人志向の GEFORCE GTX 1050 GF-GTX1050-2GB/OC/SF です。
ハードウェア設定の方が良いみたいですが、対応するまではソフトウェア設定で我慢しよぅと思います。

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2