Build Failed - AndroidX is not Enabled
See original GitHub issue- I ensured that I have the required setup - Java 10, API 28, NDK 14b, local.properties file well-configured, etc. I have Android Studio 3.6.2 installed on my computer (which runs Ubuntu 18.04).
- When I try to build the project by using Android Studio or by running
./gradlew build
, the compilation failed with the 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.test:monitor:1.2.0, androidx.test:core:1.2.0, androidx.lifecycle:lifecycle-common:2.0.0, androidx.annotation:annotation:1.0.0
Affected Modules: app, base-test, dictionaries, fileprovider, ime-addons, ime-base, nextword, overlay, pixel, prefs, remote
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.test:monitor:1.2.0, androidx.annotation:annotation:1.0.0
Affected Modules: api
I tried to fix that by adding the following lines to gradle.properties
file:
android.enableJetifier=true
android.useAndroidX=true
but they lead to other problems, and I’m quite sure that if I had to add those lines by myself then there is something wrong in my process.
I would like to get some help here, Thanks.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Android Studio 3.6.1 | Error: "This project uses AndroidX ...
This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.
Read more >This project uses AndroidX dependencies, but the 'android ...
This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled · Meeting SDK Android.
Read more >Android use androidx property is not enabled error [Solved]
When you build the project after adding android x features to your project after changing the xml files to android x support library,...
Read more >This project uses AndroidX dependencies - Error - YouTube
In this video we will see how to solve the Android Studio Error "This project uses ... useAndroidX' property is not enabled "....
Read more >Build fails with androidX and jetifier enabled · Issue #1395
Now I get the following error message on building the project: The given artifact contains a string literal with a package reference 'android....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
oh, yes, you should not use any version other than
3.5.3
. That’s the last version that works with the required NDK version we need.We will move forward to a newer NDK once the correct release is out.
BTW, You should be able to use Android Studio 3.6 and even 4.0, but make sure the Android Gradle Plugin is
3.5.3
.Seems definitely related to Androis Studio Gradle update.
@or-git , can you check inside you
build.gradle
file.Please check that your gradle dependencie line should look like this
classpath 'com.android.tools.build:gradle:3.5.3'
and not like this:
classpath 'com.android.tools.build:gradle:3.6.3'
That might solve the problem.
@menny, which line do you have ?