A third-party jar package is used for Android project development. Generally, follow the eclipse import jar package method (select a project, right-click build path, build path-> Add libraries-> User library-> next-> User libraries-> New-> Add jars, select a third-party jar package ), you can import the jar package to the project.
According to this packaging method, the eclipse compiler can also identify the jar package imported by ECLIPSE, that is, the project will not report errors due to the lack of jar packages, however, when running the android program, no package is found and an error is reported. The APK file is small, that is, the jar package is not packaged into the APK file.
Find the. classpath file in the android project and open it. The file code is as follows:
<?xml version="1.0" encoding="UTF-8"?><classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="gen"/> <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> <classpathentry kind="lib" path="E:/Code/android/Lib/MapApi.jar"/> <classpathentry kind="lib" path="E:/Code/android/Lib/xpp3_min-1.1.4c.jar"/> <classpathentry kind="lib" path="E:/Code/android/Lib/xstream-for-android-1.0.0.jar"/> <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> <classpathentry kind="output" path="bin/classes"/></classpath>
The following row contains exported
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
If you want to add it in Lib, modify it as follows:
<?xml version="1.0" encoding="UTF-8"?><classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="gen"/> <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> <classpathentry exported="true" kind="lib" path="E:/Code/android/Lib/MapApi.jar"/> <classpathentry exported="true" kind="lib" path="E:/Code/android/Lib/xpp3_min-1.1.4c.jar"/> <classpathentry exported="true" kind="lib" path="E:/Code/android/Lib/xstream-for-android-1.0.0.jar"/> <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> <classpathentry kind="output" path="bin/classes"/></classpath>
During packaging, the file becomes larger. Haha, the file should be packed in.
After testing, it is successful, but the next step is to know how to set it in eclipse.