从 Eclipse 导入 Android Studio 中的项目 [英] Import project in Android Studio from Eclipse

查看:33
本文介绍了从 Eclipse 导入 Android Studio 中的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了基于 IDEA ide 的新 Android Studio 0.1.1 并尝试从 Eclipse 导入代码.

I installed new Android Studio 0.1.1 based on IDEA ide and tried Import code from Eclipse.

  1. 转到 Eclipse->Export->Grandle 以添加 gradle 文件
  2. 打开 Android Studio 并选择导入项目,然后选择我的带有 build.gradle 文件的项目文件夹
  3. 按完成并得到一个错误:未能找到目标 android-15(这是我项目的一部分)
  4. 我转到系统变量并更改为 %ANDROID_HOME% = d:\dev\android\android-studio\sdk\(从路径中删除平台工具)
  5. 并得到新错误:未能找到构建工具修订版 15.0.0
  6. 还创建了另一个新项目并为其更改了 Android SDK,但我仍然无法导入项目
  1. Go to Eclipse->Export->Grandle so it add gradle file
  2. Open Android Studio and select Import Project and select my project folder with build.gradle file
  3. Press Finish and get an Error: failed to find target android-15 (this is was parget of my project)
  4. I go to system variables and change to %ANDROID_HOME% = d:\dev\android\android-studio\sdk\ (remove platform-tools from path)
  5. And get new error: failed to find Build Tools revision 15.0.0
  6. Also create another New Project and change Android SDK for it, but I still cant import project

我探索了这个问题并找到了弱点:在文件 build.gradle 中我更改了下一行:

I explore this problem and find the weak point: in file build.gradle I change next lines:

  • 从 compileSdkVersion 15 到 compileSdkVersion "17"
  • 从 buildToolsVersion "15" 到 buildToolsVersion "17"
  • from compileSdkVersion 15 to compileSdkVersion "17"
  • from buildToolsVersion "15" to buildToolsVersion "17"

它解决了我的项目导入问题.我认为这是 Eclipse 导出功能的问题.构建工具仅从版本 17(在 ADT 22 中)开始,因此不可能找到版本 15.

And it fix my problem with project import. I think it's problem in Eclipse export function. Build tools starts only from version 17 (in ADT 22), so it's imposible to find version 15.

推荐答案

遇到同样的问题,现在可以使用了.我是这样做的:

Had same problem, now works. I did this:

打开安卓工作室:

Tools -> android -> SDK manager 然后安装 android 4.0.3 (API 15) 并完成.

Tools -> android -> SDK manager then install the android 4.0.3 (API 15) and done.

它对我有用.

这篇关于从 Eclipse 导入 Android Studio 中的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆