问题
I am using Android Studio 1.0.2 on Mac to develop an app for Google Glass. I have been trying to start with one of the recommended projects that Google supplies on github, but I'm running into a problem. The instructions say to open Android Studio, select Check Out Project from Version Control, select Git in the dropdown menu, choose a location for the files, and then paste the url to the github. So I paste the url and when I click the test button to check the vcs repository url, it says the connection is successful. The problem occurs after I click Clone in this window. All documentation that I have read states that one or two more windows should pop up and that I should select OK in both of them, however, nothing ever shows up. The project never opens, and when I try to find the project following the path I chose, there is only an empty folder with the name "gdk-stopwatch-sample". So, what's going wrong?
I have also tried downloading the zip file from github and then trying to open it via another selection in the Android Studio Startup window like Open an Existing Android Studio Project or Import Non-Android Studio Project but I am very new to Android development and I cannot seem to choose the correct gradle import settings so the projects never run or build correctly if I can manage to open them. I am convinced that the easiest way to start this process will be to check the project out through version control, but I don't understand what's going wrong and I can't find any documentation that discusses this problem. I would greatly appreciate any help on how to get this going.
App found here: https://github.com/googleglass/gdk-stopwatch-sample
Instructions found here under Before You Begin: https://developers.google.com/glass/develop/patterns/ongoing-task
回答1:
I've met with the same problem as you. (also Android Studio 1.0.2, but on windows)
Here's the solution I've found:
- for Check-out/clone issue, make sure you've installed git and it is accessible in your android_studio.
At Android_studio, set the git in the following settings page (My path is under Windows...)
to open the gdk-stopwatch-sample project (using the local gradle_2.2.1),
make the following modifications(1). \gdk-stopwatch-sample\app\build.gradle
(old) runProguard false
(new) minifyEnabled false(2). \gdk-stopwatch-sample\build.gradle
(old) classpath 'com.android.tools.build:gradle:0.12.+'
(new) classpath 'com.android.tools.build:gradle:1.0.0+'(3). install SDK Build tools v20 (from SDK manager), if not yet.
回答2:
If your gradle plugin version is 0.14.0 or higher, you have to go to your build.gradle file and change "runProguard" to "minifyEnabled". You can read more about the recent changes here: http://tools.android.com/tech-docs/new-build-system
来源:https://stackoverflow.com/questions/27945403/check-out-project-from-version-control-fails