首页 技术 正文
技术 2022年11月17日
0 收藏 695 点赞 2,449 浏览 1773 个字

Android studio 开发环境搭建

  一、环境:

  下载java jdk:http://www.oracle.com/technetwork/cn/java/javase/downloads/jdk8-downloads-2133151-zhs.html

下载Android Studio:http://developer.android.com/sdk/index.html

  二、安装步骤

    1、安装java jdk

        按照提示一步步来就行 ,如果需要配置环境变量参考 http://www.cnblogs.com/lmh2072005/p/5083648.html

    2、安装Android Studio和创建项目

    双击安装文件一步步安装即可。

  3、创建运行第一个Android apk hello world

  三、常见问题

  1、在运行app时提示未安装Intel HAXM错误信息:

    Emulator: ERROR: x86 emulation currently requires hardware acceleration!

     Please ensure Intel HAXM is properly installed and usable.

     CPU acceleration status: HAX kernel module is not installed!

解决方案:

    1) Open SDK Manager (In Android Studio, go to Tools > Android > SDK Manager) and Download Intel x86 Emulator Accelerator (HAXM installer) if you haven’t.

    2) Now go to your SDK directory (C:\users\username\AppData\Local\Android\sdk, generally). In this directory Go to extras > intel > Hardware_Accelerated_Execution_Manager and run the file named “intelhaxm-android.exe”.

In case you get an error like “Intel virtualization technology (vt,vt-x) is not enabled”. Go to your BIOS settings and enable Hardware Virtualization.  //需要重启电脑设置bios

    3) Restart Android Studio and then try to start the AVD again.

      It might take a minute or 2 to show the emulator window.

  2、模拟器RAM过大,电脑内存不足,错误信息:

emulator: The memory needed by this VM exceeds the driver limit.

HAX is not working and emulator runs in emulation mode

在android studio 打开tools->android->avd manager  找到对应的avd 编辑, 在弹出的配置文件点击’Show Advanced Setting’ ,

在详细设置里面把滚动条拉下来(滚动条很不明显,是个坑),根据自己电脑内存分配下内存

Android studio 开发环境搭建

配置好后重启android studio

Run ‘app’ 一切ok

最后导出apk文件,在android studio -> build->Generate Signed APK 即可。

参考文档:

http://stackoverflow.com/questions/29136173/emulator-error-x86-emulation-currently-requires-hardware-acceleration

http://stackoverflow.com/questions/21031903/how-to-fix-hax-is-not-working-and-emulator-runs-in-emulation-mode

http://www.cnblogs.com/rwxwsblog/p/4769785.html

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,078
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,553
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,402
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,177
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,814
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,898