How to introduce jar packages in Andriod Development

Source: Internet
Author: User

In andriod, if the jar package is introduced incorrectly, some strange errors may occur.
At work, a jar package needs to be called, and the result takes a long time to solve the bug.
At the beginning, it was referenced as follows (eclipse ):
Right-click the project, Build path, java build path,
Select libraries and click "Add External JARs" in the button on the right ",
Then select the appropriate jar package (most people should do this ).
Result The console immediately reports an error: conversion to dalvik format failed with error 1.
In addition, there will be a Red Cross in the project, although there is no error in the project.
Clean: The project is normal, but the apk and dex files in the bin are missing. When you run the project, an error occurs: Can not find **. the reason why apk was found later is that the jar package import method is incorrect.

The correct method is as follows:
1. Right-click the project, Build path, java build path,
2. Select libraries and click "Add Library" in the button on the right"
3. Select "User library" and click "Next"
4. Click "User librarys" and click "New..." on the displayed page. <
In the pop-up interface, enter a name and click "OK"
5. Click "Add jars" to select a third-party jar package,
Click "OK" to complete the operation. In this case, the jar package will be packaged into the apk together, and the problem will be solved!

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.