Include Github Project into Android Studio 2 proje

2019-09-11 11:41发布

问题:

i have found this sdk: is24-restapi-java and i want to import it into my android studio project for further use. But i can't find a way to include it.

I did some searching through the github project i cannot find a simple jar or dependency that i can include into my project and all advances to generate a jar or something failed.

Can anyone give me a guid or something to include this sdk into my project or am i using the wrong approach?

回答1:

  • Goto File -> New -> Import Module.
  • Source Directory -> Browse the project path
  • Specify the Module Name – it is used for internal project reference.
  • Let Android Studio build the project.
  • Open build.gradle (Module:app) file.
  • Add the following line with your module name in place of “projectName” in the dependencies block:

     compile project(':projectName')
    

    After this Android Studio would start saying “gradle files have changed since last project sync”, press the “sync now” link to start a sync.