JDK/ADT Android开发环境搭建 (二)

来源:互联网 发布:nginx阿里云绑定域名 编辑:程序博客网 时间:2024/06/06 03:40


1.1           ADT开发环境配置及Hello Android

  1. Window| Android SDK Manager

    除了已经被选择的项目外,再选择下面的项目。然后,单击“Install Packages”按钮。

     

  2. 然后,API 20创建出的AVD有些问题,需要安装下面的API 19的各种包。请参考http://stackoverflow.com/questions/24587218/android-util-androidruntimeexception-you-cannot-combine-swipe-dismissal-and-the

  3. 等上面选择的packages都下载安装结束后,重启Eclipse

  4. 选择Window | Android Virtual Device Manager菜单

  5. 在弹出的Android Virtual Device(AVD) Manager中,选择“Create”按钮。Target一定要选API 19。设置如下图,然后单击OK按钮。

  6. 回到AVD Manager中,选择刚才创建的AVD,然后单击“Start”按钮。在弹出的窗口中接受默认设置,然后选“Launch”。启动AVD的过程比较漫长,请耐心等待。

1.2           HelloAndroid

  1. 运行Eclipse

  2. New |Android Application Project菜单

  3. Next后,

  4. Next,

  5. Next,

  6. Next,

  7. Finish

  8. 一个ADTBug

    [2015-05-26 13:48:46 -HelloAndroid] Found 2 versions of android-support-v4.jar in the dependencylist,

    [2015-05-26 13:48:46 -HelloAndroid] but not all the versions are identical (check is based on SHA-1only at this time).

    [2015-05-26 13:48:46 -HelloAndroid] All versions of the libraries must be the same at this time.

    [2015-05-26 13:48:46 -HelloAndroid] Versions found are:

    [2015-05-26 13:48:46 -HelloAndroid] Path: C:\Users\Qingxu_Li\workspace\Android\appcompat_v7\libs\android-support-v4.jar

    [2015-05-26 13:48:46 -HelloAndroid]               Length: 758727

    [2015-05-26 13:48:46 -HelloAndroid]               SHA-1:efec67655f6db90757faa37201efcee2a9ec3507

    [2015-05-26 13:48:46 -HelloAndroid] Path: C:\MyTestPrograms\Android\HelloAndroid\libs\android-support-v4.jar

    [2015-05-26 13:48:46 -HelloAndroid]               Length:1157388

    [2015-05-26 13:48:46 -HelloAndroid]               SHA-1:605c447c20ca216b5556af9f215af5d4bba1b117

    [2015-05-26 13:48:46 -HelloAndroid] Jar mismatch! Fix your dependencies

     

    解决办法:

  1. C:\MyTestPrograms\Android\HelloAndroid\libs\android-support-v4.jar删除

  2. 然后将C:\Users\Qingxu_Li\workspace\Android\appcompat_v7\libs\android-support-v4.jar拷贝到C:\MyTestPrograms\Android\HelloAndroid\libs

  3. Project| Clean

  4. 重启Eclipse。问题应该就消失了。

     

  1. Window| Android Virtual Device Manager启动我们创建的AVD

  2. 右键单击HelloAndoid Project,然后Run As| AndroidApplication。或者, Run | Run As| Android Application菜单。

0 0
原创粉丝点击