Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix Android resource linking failed dialogCornerRadius not found

I'm developing an app where I have this issue.

Android gradle/caches/transforms

Android resource linking failed */appcompat-1.0.0/res/values-v28/values-v28.xml:5:5-8:13: AAPT: error: resource android:attr/dialogCornerRadius not found.

I've readed that this issue can be solved API 27 to 28. The problem I have is that if I update to 28 I lose the sense of my app, because all my app is made by Fragments and in the last version of Android Studio api the fragments are deprecated.

       v28/values-v28.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
          <style name="Base.Theme.AppCompat" parent="Base.V28.Theme.AppCompat"/>
          <style name="Base.Theme.AppCompat.Light" parent="Base.V28.Theme.AppCompat.Light"/>
          <style name="Base.V28.Theme.AppCompat" parent="Base.V26.Theme.AppCompat">
            <!-- We can use the platform styles on API 28+ -->
            <item name="dialogCornerRadius">?android:attr/dialogCornerRadius</item>
          </style>
          <style name="Base.V28.Theme.AppCompat.Light" parent="Base.V26.Theme.AppCompat.Light">
            <!-- We can use the platform styles on API 28+ -->
            <item name="dialogCornerRadius">?android:attr/dialogCornerRadius</item>
          </style>
</resources>

So, How can I run my app keeping the fragments (not updating to Android 9 api).

I want to modify item dialogCornerRadius

like image 703
Mauro Stancato Avatar asked Aug 30 '19 16:08

Mauro Stancato


1 Answers

if I update to 28 I lose the sense of my app because all my app is made by Fragment

Nothing is lost.
android.app.Fragment is deprecated in API 28, but it doesn't mean that it doesn't work. Also you can:

  • use android.support.v4.app.Fragment in support library
  • or better use androidx.fragment.app.Fragment in androidx library

In any case

/values-v28/values-v28.xml:5:5-8:13: AAPT: error: resource android:attr/dialogCornerRadius not found

requires compileSdkVersion 28.

You have these options:

  • use a support library v27 with compileSdkVersion 27
  • use a support library v28 with compileSdkVersion 28
  • migrate your project to androidx with compileSdkVersion 29 or compileSdkVersion 28
like image 194
Gabriele Mariotti Avatar answered Oct 28 '22 01:10

Gabriele Mariotti