Android Studio Import External lib file

Source: Internet
Author: User
1. Put the jar package into the Lib folder in module. (Create Lib folder yourself)  

2. In project, select the Jar package and right click "Add as Library".

3, at this time the project is still unable to compile properly, then need in the project module of the Build.gradle file in the Dependencies section to add the following content



The address inside the files brackets here is relative to the Build.gradle file.
4, this time the project compiles and runs normally, but when you actually create a reference jar in your code of the class instance, it is possible that the system will throw an exception noclassdeffounderror, this time can follow the following steps:  

? Go to the Command Prompt window.
? Navigate to the root of the project, which is the directory where build.gradle resides.
? Run "{Android Studio installation directory}\sdk\tools\templates\gradle\wrapper\gradlew.bat" clean
? Recompile a running project

By doing this, you should be able to resolve the issue.

Android Studio Import External lib file

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.