1

I had these two lines in my build.gradle file:

compileSdkVersion 20
buildToolsVersion '21.1.2'

I changed them to:

compileSdkVersion 23
buildToolsVersion '23.0.2'

And I also changed support library to match the build tools version:

compile 'com.android.support:support-v13:23.1.0'

Now, when building my project I get this error:

Error:(21, 33) No resource found that matches the given name (at 'paddingTop' with value '@dimen/abc_action_bar_default_height').

That relates to a line in a layout file:

android:paddingTop="@dimen/abc_action_bar_default_height"

How do I fix this?

Kaloyan Roussev
  • 14,515
  • 21
  • 98
  • 180

4 Answers4

3

You should be using ?attr/actionBarSizefor the actionbar size.

Like this android:paddingTop="?attr/actionBarSize"

The Support Library now hides xml resources. You need to use that if you want to get that dimension.

Shmuel
  • 3,916
  • 2
  • 27
  • 45
3

You should change from @dimen/abc_action_bar_default_height to ?attr/actionBarSize

As you changed your support library version, your dimens changed too. The values come from the resources in the support library, using ?attr/actionBarSize is the compatible way to avoid having this breaks.

You can better understand how the dimens and themes works in this answer. What is the size of ActionBar in pixels?

Community
  • 1
  • 1
Eduardo Cucharro
  • 525
  • 1
  • 4
  • 14
1

I had a similar problem and the issue was with other libraries that depend on app versions less than com.android.support:support-v13:23.1.0 , so what i suggest is go to the github/maven repo of the libraries that you have and see if they have updated their libraries to a newer version.if so then update your dependency list

Infamous
  • 744
  • 11
  • 25
0

You can delete the additional library of this project to have a try.

TanLingxiao
  • 402
  • 5
  • 7