Pages

Tuesday, June 24, 2014

[Android] Missing AppTheme (styles)

Although I use git to include most of the resources and libraries for deploying my Android project, sometimes I get stuck when importing my own project among different machines, even in the same OS.

There is a typical one:
in your res/values/styles.xml

error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.




It is because I did not include a library appcompat_vXXX correctly.  The fastest way to include it, though locally (you have to do it once on every machine), is load an suitable appcompat_vXXX project on your machine.


Right click on your project -> Properties -> Android -> (scroll down) Library



Then you will see an item X ../appcompat_vXXX in the window.  All we have to do is click the 'Add...' button to select one of them (in my case: appcompat_v7_4), and click 'Apply' and 'OK'.




If there no any appcompat_XXX available, then you have to download them via Android SDK Manager and download 'Android Support Library' first.


You can see more details in
http://developer.android.com/tools/support-library/index.html

No comments:

Post a Comment