如何从不同的PC开放的Andr​​oid Studio项目时,改变摇篮\ SDK设置 [英] How to change Gradle\SDK settings when opening Android Studio project from a different PC

查看:123
本文介绍了如何从不同的PC开放的Andr​​oid Studio项目时,改变摇篮\ SDK设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我复制我的Andr​​oid Studio项目从我的工作电脑并将其复制到我的家用电脑。 当我打开的项目,我得到了以下错误:

I Copied my Android Studio project from my work PC and copied it to my home PC. When I opened the project I got the following error:

无法导入摇篮工程:无法获取类型的模型   IdeaProject使用摇篮分布    http://services.gradle.org/distributions/gradle-1.6-bin。拉链。建立   文件   C:\用户\汤姆\ AndroidStudioProjects \ CongressProject \国会\ build.gradle   行:9出现评估项目中的问题:美国国会。一个问题   发生评估项目:美国国会。该SDK目录D:\ PROGRAM   文件\机器人\机器人工作室\ SDK不存在。

Failed to import Gradle project: Could not fetch model of type 'IdeaProject' using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'. Build file 'C:\Users\Tom\AndroidStudioProjects\CongressProject\Congress\build.gradle' line: 9 A problem occurred evaluating project ':Congress'. A problem occurred evaluating project ':Congress'. The SDK directory 'D:\Program Files\Android\android-studio\sdk' does not exist.

我想这是因为我的所有SDK \ JDK和所有其他设置都在我的工作电脑和家用电脑不同的位置。 我得到这个错误所有的时间我尝试重建我的项目。

I guess that's because all my SDK\JDK and all other settings are in different locations in my work PC and home PC. I get this error all the time I try to rebuild my project.

我该如何解决这个问题,所以我可以在同一个项目在家里工作和工作? 我想可以很容易地将项目从我的2个不同电脑的复制。

How do I fix this so I can work on the same project from home and work? I want to make it easy to copy the project from my 2 different PC's.

谢谢!

推荐答案

我发现了一个类似的问题在: <一href="http://stackoverflow.com/questions/17125175/gradle-build-errors-after-updating-android-studio">Gradle更新后生成错误的Andr​​oid工作室

I found a similar question in: Gradle build errors after updating Android Studio

在项目的根目录local.properties文件,更改sdk.dir值。

in the local.properties file in the root of the project, change the sdk.dir value.

这篇关于如何从不同的PC开放的Andr​​oid Studio项目时,改变摇篮\ SDK设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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