简体   繁体   中英

Android eclipse - android.jar duplicated in libs folder and Referenced Libraries

I am using the android SDK with eclipse. I am sharing my project using git with other team members. Originally the android.jar file in 'Android Dependencies' is referenced absolutely (ie relative to my home directory). To make it relative tot he project directory I copied the android.jar to a libs/ folder in the project, right clicked and added to build path. However my project now has two android.jar, the one in the /libs/ folder and one that keeps reappearing in 'Android Dependencies'. I need to keep deleting 'Android Dependencies' in order to stop errors arising from having two android.jar files. Is there a proper way to go about what I am trying to achieve?

In essence, what I am trying to achieve is for the android.jar in 'Android Dependencies' to be the .jar in the /libs/ folder, not the .jar in the /my-home-directory/android-sdk-linux/platforms...etc.

Many thanks!

"Why you want to do that?". 'android.jar' should come from the installed SDK. This path can be different for every developer thats why it is absolute.

If you are using ant, then every developer should have 'local.properties' file in the project root folder. Snippet of the file (this files should not be part of VCS).

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.

# location of the SDK. This is only used by Ant
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=/install/android-sdks

If you are using Eclipse, then every one will set there preferences (Eclipse > Preferences > Android > SDK Location) separately.

In both cases, everyone should be able to use your project if they have the SDK installed. NO NEED to check in the android.jar in VCS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM