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!