0

Iam trying to reference a Android project library to my application. I do this:-

1)File->Import->General->Existing project into workspace->Select project library->check copy to workspace.

2)Right click on project->Properties->Android-> Add-> Select project library-> Apply-> ok.

But when I again check if the library is added I get the following:-

enter image description here

How do I resolve this?

Pratik Butani
  • 51,868
  • 51
  • 228
  • 375
user3146095
  • 359
  • 2
  • 5
  • 25
  • possible duplicate of http://stackoverflow.com/questions/8248196/how-to-add-a-library-project-to-a-android-project – Giru Bhai Jun 09 '14 at 05:12
  • @user3146095 when I faced the same problem and wasted 1hr searching for the solution, eclipse restart did the job. Did you try that? I believe it has something to do with the project properties. – Archie.bpgc Jun 09 '14 at 05:19
  • @Archie yes tried restarting eclipse – user3146095 Jun 09 '14 at 05:24
  • 2
    Tried this solution? http://stackoverflow.com/questions/5167273/in-eclipse-unable-to-reference-an-android-library-project-in-another-android-pr#5167294 – Archie.bpgc Jun 09 '14 at 05:28
  • Check your First step, Use `Andorid -> Import Existing Android Code to WorkSpace .... .... ...` Try this one to import library or project – Pratik Butani Jun 09 '14 at 05:30

5 Answers5

0

Make sure the library project is checked as a library. Go to the library projects BuildConfig -> Android -> Check "is library"

Make sure your project and the library project have the same target/min SDK versions.

It's also a good idea to clean your workspace and Build the library project - Right click on library project -> "Build Project"

Sakiboy
  • 6,255
  • 6
  • 47
  • 63
0

Try this answer:

The project name needs match the folder name on the file system. What you are seeing in the Project Properties->Android->Library Reference is a relative file system path.

Reference:

In eclipse, unable to reference an android library project in another android project

Thanks to archie-bpgc for comment

Community
  • 1
  • 1
Pratik Butani
  • 51,868
  • 51
  • 228
  • 375
0

i am also facing this problem i have solve this problem like

  • when import lib in to workspace tick mark as show in picture (basically library project and your project both are in same workspace)

enter image description here

  • now add lib to your project and clean project
MilapTank
  • 9,383
  • 7
  • 35
  • 52
0

Make sure that your library has the same location with your project source files. It means that if your source is on your workspace , then your library should add into workspace. If not, you should copy your lib into same folder with source then mount it again.

kidnan1991
  • 359
  • 2
  • 12
0

you need to import the project to workspace and the library file into the same workspace.

Then you will not face this error. Kindly the root cause is not known. But this method works.

After all this .. one more way is you can alter the project properties last line where the library file path is specified.

Thank you.

code_Jammy
  • 17
  • 1
  • 8