摇篮项目同步失败 - Android的工作室 [英] Gradle Project Sync Failed - Android Studio

查看:201
本文介绍了摇篮项目同步失败 - Android的工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直对Android应用程序通过Android电子工作室约一个月了。我最近买了一台新电脑,并试图打开计算机上的应用程序文件。当我打开它,我得到一个错误横幅,上面写着

I have been working on an android app through android studio for about a month now. I recently got a new computer, and tried to open the app files on that computer. When I open it I get an error banner saying

摇篮项目同步失败。基本功能(例如编辑,调试)将无法正常工作。

Gradle Project Sync Failed. Basic functionality (e.g. editing, debugging) will not work properly.

当我点击重试按钮,在控制台中的错误读取以下:

When I click the try again button the error in the console reads the following:

错误:未能找到目标的android-21:
  C:\\用户\\ COMPU \\应用程序数据\\本地\\的Andr​​oid \\ SDK
  安装缺少的平台(S)和同步项目

Error:failed to find target android-21 : C:\Users\compu\AppData\Local\Android\sdk Install missing platform(s) and sync project

我没有访问我创造了这个项目的计算机。有一个简单的方法来解决这个问题?

I don't have access to the computer I created this project on. Is there a simple way to fix this?

推荐答案

这是因为你可能会建立一个项目,说的是Android 5.1,但你没有必要的SDK API,即2​​1。

This is because you might be building a project say Android 5.1 , but you don't have the required SDK i.e. API 21.

转到您的SDK管理器和检查,如果你有需要的SDK下载。出于安全下载API 21和22,然后再创建程序,看看你是否仍然出现错误

Go to your SDK manager and check if you have the required SDK downloaded. For safety download API 21, and 22 and then create the program again and see if you still get the error

或更改设置的目标是可以在你的机器。

or change the target from settings which is available at yours machine.

此外,其中到底有没有你把SDK包的文件夹,你在Android网站下载的吗?在您的桌面?

Also where exactly have you put the SDK bundle folder the one you downloaded from Android website? On your desktop?

这篇关于摇篮项目同步失败 - Android的工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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