[SOLUTION] Error: resource android:attr/dialogCornerRadius not found.

29Jun, 2019

This error is actually more annoying than common.  One of the major reasons it is so annoying is because of the fact that it does not actually point to the exact line or file that caused the error.  It leaves it up to you to figure it out.

Cause

We still have not been able to point out what exactly triggers this error but it seems to have something to do with a mismatch in your Gradle dependencies.

Solution

There are different ways to fix this issue.  Not all of them will work for you.

  1. Check your build.gradle file to make sure your compileSdkVersion matches the version of your support libraries.

    The above code will possibly throw this error because the support library version does not match the compileSdkVersion.  So to fix this, upgrade your support library version.
  2. Migrate your entire project to AndroidX.  To migrate your project, follow these instructions:
    1.  Click on the Refractor menu item in Android Studio
    2.  Click on “Migrate to AndroidX”.
    3.  Follow screen instructions

The second solution could be problematic in large and complex projects.  You might be required to manually migrate some of your libraries.  However, this solution is guaranteed to solve this error as long as the migration is successfully completed.

Note

It is recommended that you backup your entire project before attempting to migrate to AndroidX.  This way, if something goes wrong, you can easily revert to a working version.

That’s all for now.

If you have any questions or contributions, feel free to post them in the comment box below :).


Why not Relax and let us bring your App to life. Click here to begin

Leave a Reply

Your email address will not be published. Required fields are marked *