当前位置:操作系统 > 安卓/Android >>

Android 开发时遇到的两个模拟器问题

开发环境: windows 2008 R2 x64, JDK 7u10, ADT v21.0.1-543035
一.启动 Nexus 7 模拟器失败
模拟器启动出现如下错误:
Starting emulator for AVD 'nexus7'
Failed to allocate memory: 8
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
 
网络搜索解决:
来源:http://code.google.com/p/android/issues/detail?id=36080
方法:用命令行启动,指定内存为 512M,默认1024M有问题
c:\xxx>emulator -avd nexus7 -memory 512
 
二.GUI 响应非常慢
模拟器启动出现如下错误:
Starting emulator for AVD 'nexus7'
emulator: ERROR: Could not load OpenGLES emulation library: Could not load DLL!
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
界面操作,响应很慢
 
网络搜索解决:
来源:http://stackoverflow.com/questions/11674306/eclipse-android-emulator-wont-launch
原因是未指定类库地址相关环境变量
方法:添加变量定义:LD_LIBRARY_PATH=/home/xxxx/devel/android-sdk-linux/tools/lib
 
为此,新建一个批处理来启动模拟器 em.bat,存放在sdk的tools目录下,如下:
setlocal
set LD_LIBRARY_PATH=K:\android\ide\adt-bundle-windows-x86_64\sdk\tools\lib
emulator.exe -avd nexus7 -memory 512 -gpu on
 
开发中,先用命令行启动模拟器,再在运行调试时,选择当前运行的AVD即可.
补充:移动开发 , Android ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,