Home > OS >  Unexpected resource type 'dimen' expected: string
Unexpected resource type 'dimen' expected: string

Time:01-26

I updated to API 33 and now there is an error in the designer "unexpected resource type 'dimen' expected: string". This error does not affect anything, but I would like to remove it.

This error appeared when I changed compileSdkVersion and targetSdkVersion in build.gradle from version 32 to version 33. (minSdkVersion uses version 24).

enter image description here

Resource file:

<resources>
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>
</resources>
  1. For the sake of experimentation, I tried changing dimen to string and it worked, but obviously it shouldn't be that type as Android Studio requests localization for other languages.
  2. I also tried to lower the API version and it helped.
  3. Also, I decided to create a new text project based on API 33 and there was the same error there too.

CodePudding user response:

Today there was an update for Android Studio and this bug has been fixed.

  • Related