12

I'm trying to set up my SettingsFragment but

import PreferenceFragmentCompat hasn't been working.

Is there a way of doing this with AndroidX?

Dependency

implementation 'androidx.preference:preference:1.0.0-rc02'

Gradle flie

    apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.idealorb.payrollapp"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        android.defaultConfig.vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.0-rc02'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0-rc02'
    implementation 'com.google.android.gms:play-services-auth:16.0.0'
    implementation 'com.google.firebase:firebase-auth:16.0.3'
    implementation 'com.google.firebase:firebase-core:16.0.3'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0-rc02'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0-rc01'
    implementation 'android.arch.navigation:navigation-fragment:1.0.0-alpha05'
    implementation 'android.arch.navigation:navigation-ui:1.0.0-alpha05'
    implementation 'androidx.preference:preference:1.0.0-rc02'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
}
Ismail
  • 445
  • 1
  • 5
  • 20

1 Answers1

1
compileSdkVersion 28

You have to set compileSdkVersion to 29 in order to use androidx-namespaced libraries

Anatolii Shuba
  • 4,614
  • 1
  • 16
  • 17