简体   繁体   中英

Error when trying to use Android AppCompat library

I have an Android project in which I'd like to use the appcompat library. I have read the following posts and followed their advice:

Could not find Library.apk!

"Could not find the XXX.apk" message in console while starting application with an Android lib linked

When trying to add the library project to my project, I get a green check indicating all is fine (see pic 1 below). After I press OK and open Properties again, this green check is replaced with a red X and there doesn't seem to be a way to get a textual error message (see pic 2). In pic 3 you see what libraries are on the Java build path.

Pics: http://imgur.com/a/7xcSX

Needless to say, I can't build my project. The line

android.support.v7.widget.Toolbar t;

gets the error "android.support.v7 cannot be resolved to a type". I don't see where my setup is wrong.

If i recall correctly you need to ensure the library is stored on the SAME drive letter as eclipse/your project (Probably C:/, looking at that picture, while the lib is on D:/)

edit: Also, you shouldn't really be importing the library project directly from your SDK folders, Google recommend making a copy in your local project directory

Try importing and copying the library project into your workspace, i think the problems is that the project doesn´t have the appcompat_v7.jar inside their /bin folder, thats why you have the red cross.

在此处输入图片说明

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