2012. 5. 8. 23:30

Classpath problem using Eclipse for Android platform development

Android 프레임워크 소스를 Eclipse 에 로딩시 Classpath 문제에 대한 해결책을 제공하는 글입니다. 


에러 메시지


Project 'Generic-Android' is missing required library: 'out/target/
common/obj/JAVA_LIBRARIES/google-common_intermediates/javalib.jar'
Project 'Generic-Android' is missing required library: 'out/target/
common/obj/JAVA_LIBRARIES/gsf-client_intermediates/javalib.jar'  


출처: https://groups.google.com/forum/#!topic/android-contrib/wEpciQkEUlA/discussion


It seems like the sample .classpath file from development/ide/eclipse 
is outdated. Eclipse complains about some missing JAR libraries (out/ 
target/common/obj/JAVA_LIBRARIES/google-common_intermediates/ 
javalib.jar and out/target/common/obj/JAVA_LIBRARIES/gsf- 
client_intermediates/javalib.jar). Searching on the groups, I found 
that google-common_intermediates has been moved to android- 
common_intermediates, and gsf-client_intermediates is not used 
anymore. 


After this, the build path errors were gone, but I got 197 errors 
referring to missing types. Ouch! Since running make was hassle free, 
this could only be another classpath problem for Eclipse. So I hunted 
down the missing types, and after adding them to the .classpath file, 
building was a success. Here are the extra libraries, that we have to 
add to the .classpath file: 


<classpathentry kind="lib" path="out/target/common/obj/JAVA_LIBRARIES/ 
android-support-v13_intermediates/javalib.jar"/> 
<classpathentry kind="lib" path="out/target/common/obj/JAVA_LIBRARIES/ 
filterfw_intermediates/classes-jarjar.jar"/> 


Don't forget to refresh your project :)