Android Question Error using Preferences - Material Design Preferences by Corwin42

ernschd

Active Member
Licensed User
Hi,

I would like to test the Example of the Material Design Preferences Library, but I'm getting an error message when compiling the app:
...
Generating R file. (0.00s)
Compiling generated Java code. Error
src\de\amberhome\preferenceexample\prefs1.java:17: error: cannot access PreferenceFragmentCompat
public class prefs1 extends de.amberhome.preferences.AppCompatPreferenceActivity implements B4AActivity{
^
class file for androidx.preference.PreferenceFragmentCompat not found
1 error

javac 11.0.1
 

ernschd

Active Member
Licensed User
This delivers:
Compiling layouts code. (0.01s)
Organizing libraries. Error
Maven artifact not found: androidx.preference/preference

In the SDK manager, android:preference:preference (Google Maven) Version 1.1.0, is installed.
 
Upvote 0

DonManfred

Expert
Licensed User
In the SDK manager, android:preference:preference (Google Maven) Version 1.1.0, is installed.
You did realized that you have
android.preference:reference installed, but missing is
androidx.preference/preference

These are two different Artifacts. The one installed is from the support library, the missing one is a AndroidX Artifact.
 
Upvote 0

ernschd

Active Member
Licensed User
Sorry, that was a typo: androidx preference is installed.
The error Maven artifact not found: androidx.preference/preference is still displayed.
 
Last edited:
Upvote 0

ernschd

Active Member
Licensed User
Good news: after reinstalling the development environment including the SDK manager, everything now works as desired.
Many thanks to all for the help.
 
Upvote 0
Top