Page 1 of 1

'android.useAndroidX' property is not enabled

Posted: Sun Oct 18, 2020 8:01 pm
by Chris..

I'm getting this build error when building an APK:

Code: Select all

Execution failed for task ':app:mergeDebugResources'.
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.slidingpanelayout:slidingpanelayout:1.0.0, androidx.fragment:fragment: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.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-viewmodel:2.0.0, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.legacy:legacy-support-v4:1.0.0, androidx.media:media:1.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

The project is called 'Ysgol Llanfyllin' and is shared with support.

Thanks!

Chris


Re: 'android.useAndroidX' property is not enabled

Posted: Tue Oct 20, 2020 12:09 pm
by Chris..

This turned out to be due to the Cordova SocialSharing plugin (https://github.com/EddyVerbruggen/Socia ... Gap-Plugin), which causes build errors in Android, but not iOS.


Re: 'android.useAndroidX' property is not enabled

Posted: Tue Oct 20, 2020 8:04 pm
by Chris..

Update for anyone having the same issue: I installed these two Cordova plugins alongside social sharing:

cordova-plugin-androidx
cordova-plugin-androidx-adapter

..as outlined here: https://stackoverflow.com/questions/566 ... x-in-ionic

It works for me.


-

Posted: Sun Dec 13, 2020 2:46 am
by Thomasmup

Weve not been able to reproduce this on iOS7 -- the input is working just fine.

What iOS device are you using iPad, iPhone, etc?


Re: 'android.useAndroidX' property is not enabled

Posted: Mon Dec 14, 2020 10:52 am
by Chris..

This is no longer an issue and related to an earlier resource library.