1

I copy appcompat folder from Android SDK extras v7 folder and create a Android library module in my project. Compiling project I get errors, first one being

appcompat/res/layout/abc_action_mode_close_item.xml:17: error: Error: No resource found that matches the given name (at 'contentDescription' with value '@string/abc_action_mode_done').

Looks like appcompat needs mediarouter resources as well. So I create a Android library module mediarouter. I set mediarouter as a dependency for appcompat library. Compile. Now I get the error

mediarouter/res/values/styles.xml:18: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.ActionButton'.

I add depenency appcompat to mediarouter. Compile. Now I get the errors

appcompat/res/values/attrs.xml:32: error: Attribute "windowActionBar" has already been defined

Help!

user1687445
  • 79
  • 1
  • 4
  • Check this link, it solves a similar problem for GridLayout: http://stackoverflow.com/a/18916738/183575, just select `SDK\extras\android\support\v7\mediarouter` instead of `SDK\extras\android\support\v7\gridlayout`. – RedGlyph Sep 20 '13 at 12:28
  • http://stackoverflow.com/questions/17292812/how-to-add-android-support-v7-widget-gridlayout-into-intellijidea here is your answer – harsh_v Aug 04 '14 at 18:32
  • http://stackoverflow.com/questions/17292812/how-to-add-android-support-v7-widget-gridlayout-into-intellijidea – harsh_v Aug 04 '14 at 18:37

2 Answers2

0

You just need to add "@string/abc_action_mode_done" in your appcompat/res/values/strings.Do not "set mediarouter as a dependency for appcompat library".(In my case,"@string/abc_action_mode_done" already exists in the appcompat/res/values/strings.I don't know why you miss it.)

"add depenency appcompat to mediarouter" is necessary.

wangqi060934
  • 1,552
  • 16
  • 23
0

I stumbled across this problem and it seems to be a bug in IDEA: when you create the library module, IDEA will create some boilerplate files in the new module. During this operation, IDEA will overwrite the strings.xml resource file with some kind of template strings.xml-file intended for newly created android applications (IDEA will also create other stuff you don't want or need).

There are two workarounds: 1. Create the library module in IDEA first and copy the appcompat-resources afterwards into the existing library module directory 2. Just make the sub folders readonly before you create the library module in IDEA. This will prevent IDEA from changing the files in the library.

After that, the library module compiled on my machine.

hyperlord
  • 311
  • 1
  • 2