How to open the project from GitHub in Android studio? Troubles with Maven and android support libraries.

后端 未结 2 1227
闹比i
闹比i 2021-01-23 12:04

I\'m starting to use Android Studio. I\'d like to open project from GitHub https://github.com/TonicArtos/StickyGridHeaders

On first screen I click \'Check out from Versi

2条回答
  •  囚心锁ツ
    2021-01-23 12:38

    There are several SO questions on this topic, but @MartinRevert's answer (https://stackoverflow.com/a/24978323/5025060) is the only one I found mentioning Android Studio's (AS's) Gradle dependency. If the Github project was built with Eclipse, importing it to AS will work but the result will not be buildable with AS (indication: the project's "Make project" icon is grayed out in AS).

    Building on Martin's answer, and using IntelliJ's Migrating From Eclipse Projects page as a reference, I found a simple and transparent way to import an Eclipse-based Github project into AS 2.1.2:

    1. Import the Github project using AS: File->New->Project from Version Control->Github This clones the Github project, but if it is not a Gradle Project (see above), follow these additional steps:
    2. Create a new project using: File->New->Import Project and click on the folder you stored the project to in step (1) above. Accept all of the defaults and AS will "import" the Eclipse project to a Gradle project which it will now be able to build.
    3. You may now delete (using a native directory removal tool) the project you created in (1) above.

    Related questions:

    • Android Studios - import project from GitHub
    • How to import an existing project from github into Android Studio

提交回复
热议问题