How Android Studio Imports jars correctly

Source: Internet
Author: User

Recently started to do Android, using Android Studio encountered the import jar did not respond to the problem, checked the data practice to conquer, and now specifically write a blog. Want to be helpful to just using a friend of Android studio.

1. First import your jar package into the Libs (directly copy it directly over).

2. In the Build.gradle

dependencies{} inside
Write on
Compile files (' Libs/xx your jar package. Jar '), write like this.

dependencies {        compile files (' Libs/qqbrowser_sdk_v1.2.jar ')}
3. This is assumed to be more jars. You can also directly in  build.gradle 
dependencies{} inside 
write on
Compile Filetree (include: [' *.jar 'dir' Libs ')
, write like this
dependencies {    Compile filetree (include: [' *.jar 'dir' Libs ')     }
He would take his own initiative to import all the jars under the Libs into the model.
4. All steps are finished, and once again the Gradle is generated (select model, click here to do so.)

, you can see if it's enough to quote.

How Android Studio Imports jars correctly

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.