Thursday 1 December 2011

Eclipse Android Library Error: Unable to get system library for the project

I downloaded some code via subclipse from the SVN server of Google to follow a tutorial. However, eclipse didn't know that it was an Android project and wouldn't let me build it as one no matter how many different ways I tried to add the android jar file. I found this great discussion on StackOverflow but this is what was wrong for me:
  • Right click on project > Properties > Android
  • Set Project build target (mine was ICS Android 4
  • Press Apply (I had to press apply 3 times for it to listen to me!)
  • Then go to Build Configuration and set the "Unable to get system library for the project" libraries Native folder to your Android jar (something like  C:/dev/AndroidSDK/platforms/android-14)
  • Right click on project > Android Tools > Fix Project Properties
  • Clean & Build
  • If nothing, try opening and closing the project
  • Also try pressing Apply on the build target some more
Sounds silly, but eclipse can be silly sometimes too!
Obviously check to make sure that you've set the Android SDK location in Window > Preferences > Android. My SDK location is C:\dev\AndroidSDK (not sure why eclipse holds the backslashes here and forward slashes above)

No comments:

Post a Comment