Solution 1) I clicked on Android Dependencies in Package Explorer and pressed F5 (refresh) and built the main project and problem solved.
Solution 2) this answer also works for this problem. It says you can add the project to the build path. ( Right click on project -> properties -> java build path -> Projects -> Add).
Under the Order and Export section, make sure the library is above the Android Dependencies.