Leif Ashley
Leif Ashley

Reputation: 275

Android Library is not working

Nothing too exotic. I have classes in a library project, which is set to "Is Library".

The target application project uses this library under the Project Properties/Android section. The project is set to version 2.1-Update (api 7).

None of the classes from the library are visible in the target project. i.e. import statements referencing the classes are underlined in red.

Any ideas?

Upvotes: 0

Views: 926

Answers (5)

JT.
JT.

Reputation: 633

Make sure the classes in your library are declared public. That fixed this problem for me.

Upvotes: 0

Ran
Ran

Reputation: 4157

In your project you have a src directory from your library. Try refreshing it.

Upvotes: 0

Juanin
Juanin

Reputation: 91

Using MOTODEV Studio 1.2 and with the same problem.

But changing from Api Level 7 to 8 and changing again (setting up the Lib again) it starts to work.

Upvotes: 0

JRL
JRL

Reputation: 78013

If your library name has a space in it, remove it.

Upvotes: 0

Konstantin Burov
Konstantin Burov

Reputation: 69238

Try restarting eclipse also try selecting and applying different API level for the project, then apply, then change API level back. I sometimes seen such a problem, usually these actions help.

Upvotes: 2

Related Questions