简体   繁体   中英

Android and Eclipse - referencing Library

What is the correct way to reference a library?

I start a new Android application using Eclipse.

I add a new Library application.

I add the project in the Java Build Path for the main application.

This compiles fine, but at runtime I get an error because the "library" file is missing from the main application, so my question is, what is the "correct" way to get the library into the main application?

I am used to Visual Studio, and referencing another project automatically ensures that the reference copies the required DLLs to the project BIN folder.

I understand that the library file's JAR/APK must be in the LIB folder, but does Eclipse do this for you when you reference it? It appears not - so do I import?

First you need to build your library project, and only after that add it into main project as library. Please follow this post .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM