当前位置: 代码迷 >> Android >> JDK/ADT Android开发环境搭建 (2)
  详细解决方案

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

热度:87   发布时间:2016-04-28 00:47:19.0
JDK/ADT Android开发环境搭建 (二)


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菜单。

  相关解决方案