Search code examples
androidsettingsandroidxpreferenceactivity

Android preference defautvalue duplicate resource


I want to make a settings activity for an android app. I used the standard activity for the settings but I keep getting the error:

\.gradle\caches\transforms-2\files-2.1\e3ce7e7cf0568bf54350349961cc10db\preference-1.1.1\res\values\values.xml:257:5-336:25: AAPT: error: duplicate value for resource 'attr/defaultValue' with config ''.

I think it has something to do with the androidx.preference.PreferenceFragmentCompat because the error disappears when I remove the dependency on android.preference:preference:1.1.1. Do you know how to fix this?


Solution

  • I figured it out. The DevaultValue was already defined by me in the res/attr/ folder. deleting this value makes it work.