337人阅读 评论(0) 收藏 举报

If you're getting started with the Android SDK and encounter an error message which says "Error: Target id is not valid. Use 'android list targets' to get the target ids'" here's how to solve it...

While you're developing an Android application you'll need to create an Android Virtual Device or AVD, which allows you to test your application before you let it loose on a real 'phone.

The docs tell you to run the following command: android create avd --target 2 --name my_avd However, this gave me the following error "Error: Target id is not valid. Use 'android list targets' to get the target ids."

Running android list targets listed no available targets. This is because the SDK needs some further set-up work to tell it to fetch sources before you can use it.

To get around this problem type android in your terminal. Then click Available sources > check the box and click install selected. It will then go off and download all of the SDK packages via an https repository server at google.com/android.

Now re-run android create avd --target 2 --name my_avd and it should allow you to create the AVD and map it to a target.

更多相关文章

  1. 网址收藏
  2. Android 面试题集(精华收藏版)
  3. 收藏一个 漂亮的 Android加载中动画AVLoadingIndicatorView
  4. Android实现资料收藏
  5. 实例收藏Android开发环境搭建和Android开发基础知识汇总值得收藏
  6. 利用android studio LinearLayout线性布局嵌套设计制作简易的计
  7. 阿里架构师最新 Android 面试点梳理,我收藏了你呢?
  8. android 学习文章收藏(链接)
  9. 3个月学会Android开发!Android面试资料集合,建议收藏

随机推荐

  1. 获取 + 查看 Android(安卓)源码的 方法
  2. Android(安卓)5.0 默认水波纹背景属性,可
  3. android颜色代码
  4. 【Android】:跳转系统界面汇总
  5. Android(安卓)控件GridView使用案例讲解
  6. 【Android】自定义权限
  7. Android(安卓)SDK Emulator: Compile Cya
  8. android FloatingActionButton
  9. android双击事件
  10. Android(安卓)NDK Tools 下载链接大全