Import third-party class libraries in Android Studio

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.