EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 448 forks source link

Build Error: 'android.useAndroidX' property is not enabled error although it's set in gradle.properties #1659

Closed martijnvanschie closed 3 years ago

martijnvanschie commented 3 years ago

After installing latest @nativescript/firebase (^11.0.0-rc.0) plugin i get the following build error.

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.core:core:1.0.1 ........ <a long list>

But when checking my gradle.properties is see the correct settings:

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx16384M

android.enableJetifier=true
android.useAndroidX=true

Am i missing something?

Regards, Martijn

ngocnt1 commented 3 years ago

i think it's NS7.0.4- issue, please try update to NS 7.0.6, and @nativescript/firebase@11.0.0-rc.5

martijnvanschie commented 3 years ago

Thanx @ngocnt1 that was indeed the case. I got it working now 👍

I had one additional error which was quickly fixed:

The Android Gradle plugin supports only Crashlytics Gradle plugin version 1.28.0 and higher.
The following dependencies do not satisfy the required version:
root project 'mysecondtestapp' -> io.fabric.tools:gradle:1.26.1
The Android Gradle plugin supports only Crashlytics Gradle plugin version 1.28.0 and higher.
The following dependencies do not satisfy the required version:
root project 'mysecondtestapp' -> io.fabric.tools:gradle:1.26.1

Command gradlew.bat failed with exit code 1

So i had to upgrade the version in build.gradle

dependencies {
    ...
    classpath "io.fabric.tools:gradle:1.28.0"
}