Windows 7 X86 + Android Studio 1.2.2 + Emulator

来源:互联网 发布:jquery遍历json对象 编辑:程序博客网 时间:2024/06/05 15:17

Windows 7 X86 + Android Studio 1.2.2

 

 

0.      配置 hosts,可以上google的网站

http://laod.cn/hosts/2015-google-hosts.html

 

 

1.      下载Android Studio

http://developer.android.com/

 

 

2.      安装Android Studio

安装Android Studio时缺少java sdk(oracle官网下载java sdk, 并且设置好环境变量),安装时还会下载android sdk等,因此一定要配置好google hosts参考步骤“0”,不然很多资源下载不了。

 

 

3.      新建project

如果出现gradle的一下错误,就修改gradle下的properties文件的distributionUrl

修改前

distributionUrl=https://services.gradle.org/distributions/gradle-2.2.1-all.zip

修改后

distributionUrl=http://services.gradle.org/distributions/gradle-2.2.1-all.zip

 

 

4.      Run

emulator: ERROR: x86 emulation currentlyrequires hardware acceleration!

Please ensure Intel HAXMis properly installed and usable.

CPU acceleration status:HAX kernel module is not installed!

 

下载上面错误中提到的HAX

https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager-end-user-license-agreement

 

 

如果安装HAX出现下面错误:

 

进入Bios

virtualization technology [enable]

 

 

然后继续运行,出现下面错误

"D:\ProgramFiles\Android\sdk\tools\emulator.exe" -avd Nexus_5_API_22_x86 -netspeedfull -netdelay none

emulator: WARNING: Requested RAM size of1536MB is too large for your environment, and is reduced to 1152MB.

emulator: device fd:596

HAX is not working and emulator runs inemulation mode

Cannot set up guest memory 'pc.ram':Invalid argument

emulator: The memory needed by this AVDexceeds the max specified in your HAXM configuration.

emulator: AVD      RAM size = 1152 MB

emulator: HAXM max RAMsize = 1024 MB

emulator: You might want to adjust your AVDRAM size and/or HAXM configuration to run in fast virt mode.

Error accepting connection, aborting

Emulator AVD RAM设置得有些大,于是改成了1G

 

修改Emulator AVDRAM的路径

Tools -> Android -> AVD Manager

 

 

然后运行,还是出现错误

 

"D:\ProgramFiles\Android\sdk\tools\emulator.exe" -avd Nexus_5_API_22_x86 -netspeedfull -netdelay none

emulator: device fd:580

HAX is working and emulator runs in fastvirt mode

Cannot set up guestmemory 'pc.ram': Invalid argument

Error accepting connection, aborting

 

继续改小EmulatorAVD RAM,为512M

 OK终于可以运行了

 

0 0
原创粉丝点击