eclipse - What is the correct way to add an Android Library to an Android Project? -



eclipse - What is the correct way to add an Android Library to an Android Project? -

i trying add together android-support-v7-appcompat newly created android project.

following back upwards library setup documentation (developer.android.com/tools/support-library/setup.html), section adding libraries resources, have created android-support-v7-appcompat project, before adding android dependency.

edit: here more details on process followed add together library project android dependency main project:

in project explorer, right-click project , select properties. in category panel on left side of dialog, select android. in library pane, click add together button. select library project , click ok.

however, if dependency correctly recognized, eclipse still sees compatibility references, such actionbaractivity, errors, forbidding me build project. (see image here).

to solve problem, tried solutions accepted similar questions on se, i.e. adding android-support-v7-appcompat project's build path, silents errors prevented me compile earlier.

however, when building , deploying project, error: app crashes @ launch, , console displays error message: could not find android-support-v7-appcompat.apk! (see image here).

to resume, first configuration not able compile eclipse, while second configuration can't launch application.

therefore, have 2 questions:

first, how should adding library project, can @ same time build project and able utilize library's additions in code in eclipse?

secondly, sense missing theoretical knowledge on how eclipse handles dependencies. difference between adding library android dependency vs java dependency / vs adding project or jar build path?

first, how should adding library project, can @ same time build project , able utilize library's additions in code in eclipse?

your first approach should fine, indicate there other problem. example, there may errors in appcompat library project preventing beingness compiled. however, given error sec approach, either running appcompat library (which not work) or else more fundamentally broken in project setup, app thinks supposed build android-support-v7-appcompat.apk, when there no such apk.

what difference between adding library android dependency vs java dependency / vs adding project or jar build path?

never manually modify build path in eclipse android project. while satisfy compiler, contents of jar(s) not packaged apk utilize @ runtime, resulting in runtime crashes (e.g., verifyerror).

"java dependency" pure java source code. not not have source code appcompat sdk, android library project includes android resources (and, @ to the lowest degree on android studio, assets , optional manifest file).

for eclipse, library projects attached via approach describe first approach in question. eclipse, plain jars dropped libs/ in project root, , automatically added compile-time , runtime classpaths.

android eclipse dependencies libraries appcompat

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -