Http://zhidao.baidu.com/link?url=W0zaTJAdd4qiJ2PwIGK39bqjQ3-a8CxA-EZb1M9FQZGnPHMfxPzn0h1AoPED-ix7GiSgfDV0EGKtl _9tjxyqaje0btctuz2voli8psoi4nq
Here are two ways to import a third-party class library.
1, for the class library of the jar, it is very simple, just create a new libs directory under the project root directory, and then copy the jar into the jar, right-click, select the Add as library, you can complete the dependency of the Add.
2, for GitHub and other Web sites downloaded from the Source class library, can not be added in this way. First put git clone down the entire folder into the project root directory, here in my own development package, for example, my development package name is Shunixdevkit, there is a Lib directory is the Real class library, So what we have to do is to manually add the Settings.gradle inside:
Include ': Shunixdevkit:lib '
Note that Gradle uses: as the path delimiter. In this way, Android Studio will know where our class library is, and of course this is not enough, for the project to use the class library, we also need to add this class library as a dependency on the project, select File->project Structure, and then select the name of the main module , click Dependencies, add: Shunixdevkit:lib on it, gradle build can be successful.
The above is the process of adding a third-party class library as a dependency. The place to note here is that the imported class Coogan directory Gradlew file must be executable, otherwise Android studio will prompt the error, and according to the error message difficult to find out the error, I myself because of this for a long time, I hope to be helpful.
Import third-party class libraries in Android Studio