使用 build.gradle 文件将 Eclipse 项目导入 Android Studio 失败

编程入门 行业动态 更新时间:2024-09-26 04:20:57
本文介绍了使用 build.gradle 文件将 Eclipse 项目导入 Android Studio 失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在尝试使用 build.gradle 文件导入基于 Eclipse 的 Android 项目.我收到以下消息:未能找到构建工具修订版 18.0.0".但是,根据 Android SDK Manager,我安装了 Android SDK Build-tools 18.0.1.

I'm trying to import my Eclipse based Android project using the build.gradle file. I get the following message: "failed to find Build Tools revision 18.0.0". However, according to the Android SDK Manager, I have Android SDK Build-tools 18.0.1 installed.

如果相关的话,我正在 64 位 Windows 7 机器上执行所有这些操作.

I am doing all this on a 64-bit Windows 7 machine, if that's relevant.

我该如何解决这个问题?

How do I fix this?

更新:实际上我今天早上只更新到 Build-tools 18.0.1.然后我注意到,在 Android Studio 中创建新项目时,它不允许我使用 Android 4.3(4.2.2 是允许的最新版本)创建项目.我尝试将我的项目的目标版本删除到 Android 4.2.2,然后重新导出它.现在,当我尝试导入此项目时,Android Studio 抱怨找不到 Build-tools 18.0.1.

UPDATE: I actually only updated to Build-tools 18.0.1 this morning. I then noticed that, when making a new project in Android Studio, it wouldn't allow me to create a project using Android 4.3 (4.2.2 was the latest allowable version). I tried dropping the target version of my project to Android 4.2.2, and re-exporting it. Now Android Studio complains about not being able to find Build-tools 18.0.1 when I try to import this project.

推荐答案

直到 10 分钟前,我还是一个 Android Studio 处女.我遇到了同样的问题.如果您在 Android Studio(或我相信是 Eclipse)中检查您的 SDK 管理器,它将显示您安装了哪些工具.我也/曾经缺少构建工具 18.0.1 并收到错误....但那是因为我没有安装它们.

I was an Android Studio virgin too up until 10 minutes ago. I ran into the same problem. If you check your SDK Manager in Android Studio (or Eclipse I believe) it will show which tools you have installed. I am/was missing build tools 18.0.1 too and getting the error....but it was because I hadn't installed them.

因此无需修改 Gradle 构建文件,我就能够使用 SDK 管理器安装构建工具并使一切正常运行.

So without modifying the Gradle build files, I was able to install the build tools using the SDK Manager and get everything up and running.

看这张图片:

顺便说一句,我还必须更新 API 版本,因为它选择了一个未安装的 API 版本(我没有安装,因为它是在我用 Eclipse 编译时).

As an aside, I also had to update the API version as well because it selected an API version that wasn't installed (which I don't get because it was when I compiled with Eclipse).

希望这会有所帮助.

这篇关于使用 build.gradle 文件将 Eclipse 项目导入 Android Studio 失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-14 21:46:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/849927.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   项目   build   gradle   Studio

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!