question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build Failed - AndroidX is not Enabled

See original GitHub issue
  1. 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).
  2. 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:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mennycommented, Jun 14, 2020

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.

0reactions
lubenardcommented, Jun 10, 2020

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 ?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found