我已经下载了 Android Studio 2.3.3,目前,我正在尝试运行自动生成的基本 Hello World Activity 。当我尝试启动模拟器时,它没有启动。
这是一个已知的错误还是只是错误的配置?我也很惊讶只有 2.3.3 版本适用于 Linux。
最佳答案
模拟器附带一个 bundle 的 libstdc++.so 文件。在某些情况下, bundle 文件与您的系统不兼容。使用系统中可用的 libstdc++.so.6 而不是与 Android SDK bundle 在一起的库可能会解决此问题。
要使用系统的 libstdc++.so 文件,请编辑位于您的主文件夹中的 .profile 文件,并将其附加到文件末尾:
export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1
来自 Android Studio Environment Variables reference 的文档:
Contains a value of 0 (default) or 1. A value of 1 means to use the system's libstdc++.so file instead of the one that comes bundled with the emulator. Set this environment variable only when the emulator does not start on your Linux system because of a system library problem. For example, some Linux Radeon GL driver libraries require a more recent libstdc++.so file.
Note:
There is no guarantee that setting this environment variable to 1 will make the emulator runnable. It is a work-around for system library issues that affect a very small number of Linux users.
关于Android 模拟器不会在 Ubuntu 17.04 上启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44475576/