Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot build library dependent project after update to ADT 14

Tags:

android

adt

In order to implement different versions of our UI we broke our program up into UI specific code and a common library project that has everything else. Up until yesterday when I updated to ADT 14 everything was working fine. Now I can't build. I keep getting the error "The container 'Library Projects' references non existing library 'path to the bin folder of my common project and the name of the project.jar'

I've been all over the web and tried everything I can think of to fix this to no avail. Can someone help me out? I'm basically stuck at this point.

like image 735
Physibeth Avatar asked Oct 20 '11 23:10

Physibeth


2 Answers

Maybe you have the same issues I had when switching to the new ADT:

In my previous setup I had some resources split between the library and the main project. The library project would not compile error free on its own but only in combination with the main project which added the missing resources.

It doesn't work like this any more.

The library project must compile completely error free now. When it does the build process will create a <lib_project_name>.jar in the bin folder of the library project.

If the jar file is not created ( thus the build process of the library project failed for some reason - eg. because the changes in the R.java file (see http://tools.android.com/recent/buildchangesinrevision14 )) you will get the error message you described.

Also, I had to manually remove the <lib_project>_src from the project.

like image 144
P.Melch Avatar answered Oct 21 '22 13:10

P.Melch


I've had a problem with a few different projects where I did the fixes suggested in the other answer, but they were only fixed temporarily.

Every time I reopened Eclipse or did a Clean on a project, the "Library Projects" directory would disappear, and I would have to open the project properties, remove the library, and add it again.

I solved this the hard way by creating a new project and copying everything into it.

Then I found an easy way to solve it. Right click the project, Refactor-->Rename. You can rename it back afterwards. This fixed it.

like image 30
Tenfour04 Avatar answered Oct 21 '22 11:10

Tenfour04