When I run my app I am getting this error:
nativescript-plugin-firebase: building for same environment, not forcing prepare.
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':javaPreCompileRelease'.
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.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.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
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 9s
Failed to build plugin @nativescript/firebase :
Error: Command gradlew.bat failed with exit code 1
In my gradle.properties file I have:
android.useAndroidX=true
It is my firebase.nativescript.json file:
{
"using_ios": true,
"using_android": true,
"analytics": true,
"firestore": false,
"realtimedb": false,
"authentication": false,
"remote_config": false,
"performance_monitoring": false,
"external_push_client_only": false,
"messaging": true,
"in_app_messaging": false,
"crashlytics": false,
"storage": false,
"functions": false,
"facebook_auth": false,
"google_auth": false,
"admob": false,
"dynamic_links": false,
"ml_kit": false
}
and my package.json:
"dependencies": {
"@angular/animations": "~10.1.0",
"@angular/cdk": "^10.2.7",
"@angular/common": "~10.1.0",
"@angular/compiler": "~10.1.0",
"@angular/core": "~10.1.0",
"@angular/forms": "~10.1.0",
"@angular/material": "^10.2.7",
"@angular/platform-browser": "~10.1.0",
"@angular/platform-browser-dynamic": "~10.1.0",
"@angular/router": "~10.1.0",
"@nativescript/angular": "~10.1.0",
"@nativescript/core": "~7.1.0",
"@nativescript/datetimepicker": "^2.0.0",
"@nativescript/firebase": "^11.1.3",
"@nativescript/local-notifications": "^5.0.3",
"@nativescript/theme": "~3.0.0",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
....
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.1002.2",
"@angular/cli": "^10.2.1",
"@angular/compiler-cli": "~10.1.0",
"@nativescript/android": "7.0.1",
"@nativescript/types": "~7.0.0",
"@nativescript/webpack": "~4.0.0",
... },
How can I fix it? Please help.