Salah
Salah

Reputation: 131

ERROR: This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.prop

I want to use firebase remote config library(com.google.firebase:firebase-config:19.1.4). When I add its dependency into app gradle, I'm getting following error.

    ERROR: This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
The following AndroidX dependencies are detected: androidx.versionedparcelable:versionedparcelable:1.0.0, androidx.fragment:fragment:1.0.0, androidx.slidingpanelayout:slidingpanelayout:1.0.0, androidx.core:core:1.0.0, androidx.customview:customview:1.0.0, androidx.swiperefreshlayout:swiperefreshlayout:1.0.0, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.drawerlayout:drawerlayout:1.0.0, androidx.viewpager:viewpager:1.0.0, androidx.collection:collection:1.0.0, androidx.localbroadcastmanager:localbroadcastmanager:1.0.0, androidx.lifecycle:lifecycle-common:2.0.0, androidx.arch.core:core-common:2.0.0, androidx.annotation:annotation:1.1.0, androidx.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.lifecycle:lifecycle-viewmodel:2.0.0, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.arch.core:core-runtime:2.0.0, androidx.legacy:legacy-support-core-utils:1.0.0, androidx.documentfile:documentfile:1.0.0, androidx.cursoradapter:cursoradapter:1.0.0, androidx.lifecycle:lifecycle-runtime:2.0.0, androidx.coordinatorlayout:coordinatorlayout:1.0.0, androidx.asynclayoutinflater:asynclayoutinflater:1.0.0, androidx.print:print:1.0.0
Affected Modules: app

My app gradle is as follows:

android {
compileSdkVersion 27
defaultConfig {
    applicationId "in.co.gramafone.client"
    minSdkVersion 16
    targetSdkVersion 27
    versionCode 19
    versionName "1.1.1"
    vectorDrawables.useSupportLibrary = true
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
}
...
}

I'm extensively using android support libraries(com.android.support:appcompat-v7:27.1.1). So, if I'm enabling androidX by putting below lines to solve this, there are a lot of other library conflicts are reporting(I can post if those errors are necessary)

android.useAndroidX=true
android.enableJetifier=true

Please let me know if any other information is necessary to understand the actual issue.

NB:I'm a newbie in the world of android

Upvotes: 3

Views: 16709

Answers (2)

Sarwar Ahmed
Sarwar Ahmed

Reputation: 712

first Open your Project gradle scripts>> then open gradle.properties And Finally paste this two line code

android.useAndroidX=true

android.enableJetifier=true

enter image description here

Upvotes: 3

Aminu Abdusalam
Aminu Abdusalam

Reputation: 41

android.useAndroidX=true

android.enableJetifier=true

You need to add these to your gradle.properties file in your Gradle Scripts Folder.

I am not 100% sure, but this should work.

Upvotes: 4

Related Questions