I imported an Android project into Eclipse (Custom ADT). During the import process, I chose to copy project into Workspace.

My project could compile and run well but after sometime, it stopped working. When I check in the 'Problems' View, I see that it still looks for the BIN folder in the folder from which the project was imported and it can't find the library it wants to reference.

Aren't Libraries copied along with the project in Android? How do I fix this?

有帮助吗?

解决方案

A good way to add external JARs to your Android project or any Java project is:

  1. Create a folder called libs in your project's root folder - you already had this
  2. Copy your JAR files to the libs folder
  3. Now right click on the Jar file and then select Build Path > Add to Build Path, which will create a folder called 'Referenced Libraries' within your project

    By doing this, you will not lose your libraries that are being referenced on your hard drive whenever you transfer your project to another computer.

其他提示

You need to place the Libraries into your libs folder before you copy/import. Because if you just added the Library over the Build-path its just copy the Reference, not the Library itself.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top