简体   繁体   中英

Referencing Android Library Project Error

I am having issues getting my project that references an Android Library to compile. I have exactly followed the instructions in the documentation here: http://developer.android.com/tools/projects/projects-eclipse.html

My android library is is marked as a library correctly, and I can see the jar file and all my .class files in my project. But the classes are not found when I try to reference them in my new project and it will not compile. What am I doing wrong?

Here is a screenshot (SoundGraphingLibrary is my library project and SoundGraphingLibrary is the project I need to use the library in):

在此处输入图片说明

确保项目和库项目在同一文件夹中。

First, run Project->Clean on the library, then your project as @iagreen suggests. Then go ahead and close and reopen eclipse. Wait for everything to build.

Assuming nothing is better at this point, click on the library and do Project->Properties->Android . Confirm that Is Library is checked. Now, delete any instance of the library *.jar in your project. Do Project->Properties->Android on your project. Click Add... and click on the library you want, OK , Apply , OK .

That should do it. Also, fire lemurs.

Not sure if this helps but i did the following

  • Remove and adding the library by going to Project->Properties->Android.
  • Clear the project by going to Project->Clean
  • Restart Eclipse and tata it works.

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