1. Recently downloaded open source code is all from GitHub, has been developed with Eclipse, for Android Studio is a new
2. Import a project in eclipse that is so eassy, import choose to be able.
3, into the Android studio inside, import that would cost a lot.
Import a few times with the same as dead, only see progress bar move, in fact, Android Studio is in the download file Gradle
Try:
All new one Hello project, fix, no problem, compile successfully
The catalog of the project is shown above
Open the project and discover that there are several places different from the open source code on GitHub, according to the configuration file, Android Studio (AS) dude can't find it,
So he did his best to find the network download and then download the SDK, so he stopped there.
------------------------------------------------------------------------------------------------------------
Take the Android-floating-action-button-master downloaded online for reference.
Https://github.com/shamanland/floating-action-button
As long as the preparation of the open source files downloaded from GitHub is modified to the formulation of our new project, it's OK.
1) First Find Android-floating-action-button-master\build.gradle (1, root directory of Build.gradle)
Open the self-built Hello,
Change the above 1.1.0 to 1.5.0.
2) Locate the Settings.gradle in the root directory and open the file display
Include ': library ', ': Sample '
In other words, the Library and sample Build.gradle tell the system with what SDK, and we compile, please change to the new hello consistent with the line
Also, take the part of the red frame out of the//apply from: './gradle-mvn-push.gradle '
The Build.gradle in the sample directory is also adjusted accordingly.
Modify Future Files Build.gradle
3) Find Android-floating-action-button-master\gradle\wrapper\gradle-wrapper.properties
Will draw the red box to the new project Hello, or the system to download the file, slow long wait.
After the above steps, the preparation of the document is almost changed, the following is the import
Then, if you choose, OK wait a moment to succeed. Run Sample, get a picture.
Android Studio opens GitHub open source code