Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unsupported type 'add-resource' in Android Studio

I encountered a resource merging issue when running a gradle build command.

Logs as below:

Error:Execution failed for task ':frameworks:base:core:res:res-common:packageReleaseResources'.> Unsupported type 'add-resource' in file .../kk4_4/frameworks/base/core/res/res-common/res/values-XXX/dimens.xml

Environment:

  • Android Studio: 0.5.8
  • Android Plugin: 0.10.+
  • Gradle Version: all damned from 1.10 to 1.12

Resource:

<add-resource type="dimen" name="slidingmenu_menu_width"/>
<dimen name="slidingmenu_menu_width">232dip</dimen>

<add-resource type="dimen" name="card_list_item_padding_left" />
<dimen name="card_list_item_padding_left">13.5dip</dimen>

These <add-resource /> nodes are used for overlays in aapt, and I wonder if there's a way to pass gradle builds without removing them?

like image 724
L.J. Avatar asked Jan 24 '26 17:01

L.J.


1 Answers

I've solved this problem myself, here is the result: add-resource node is not supported when using android plugin 0.8.+ or later If we change

dependencies {
    classpath 'com.android.tools.build:gradle:0.9.+'
}

to

dependencies {
    classpath 'com.android.tools.build:gradle:0.5.+'
}

and use gradle 1.8 instead of the later versions

run gradle tasks in terminal, and all tasks turn to success

but the 'Gradle Sync' function will not work properly in the latest Android Studio,

Hope google deals with it soon.

like image 85
L.J. Avatar answered Jan 27 '26 05:01

L.J.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!