Nativescript-plugin-firebase: Could not get unknown property 'VersionNumber'

Created on 17 May 2019  路  13Comments  路  Source: EddyVerbruggen/nativescript-plugin-firebase

* Where:
Build file 'PathToApp/platforms/tempPlugin/nativescript_plugin_firebase/build.gradle' line: 114

* What went wrong:
A problem occurred evaluating root project 'nativescript_plugin_firebase'.
> Could not get unknown property 'VersionNumber' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

I've searched through the codebase and been unable to find any mention of "DefaultDependencyHandler," "VersionNumber," or "build.gradel," so this could very likely not be an issue with this repo.

If you know where to start looking next, I'd appreciate the direction.

Most helpful comment

Can you check node_modules/nativescript-plugin-firebase/platforms/android/include.gradle? Search for VersionNumber. Does it say just VersionNumber, or org.gradle.util.VersionNumber? If it's the former, please remove node_modules and run npm i.

All 13 comments

Same problem

Woah. That was quick.

Did you just update nativescript as well?

This is the line in the gradle file which is generated into platform/tempPlugins

dependencies {
    def supportVersion = project.hasProperty("supportVersion") ? project.supportVersion : "26.1.0"
    def googlePlayServicesVersion = project.hasProperty('googlePlayServicesVersion') ? project.googlePlayServicesVersion : "16.0.1"

    if (googlePlayServicesVersion != '+' && VersionNumber.parse(googlePlayServicesVersion) < VersionNumber.parse('15.0.+')) {
        throw new GradleException(" googlePlayServicesVersion set too low, please update to at least 15.0.0 / 15.0.+ (currently set to $googlePlayServicesVersion)");
    }

This is the function VersionNumber. It appears to be part of the Gradle library. https://github.com/gradle/gradle/blob/master/subprojects/core/src/main/java/org/gradle/util/VersionNumber.java

Not sure why it isn't recognized.

At the top of the build.gradle file is this line:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

and the current version of gradle is 5.4.1, so I think this might be why VersionNumber does not exist

I can not find any way to modify this version number, and it is not specified in the plugin gradle file that I found at node_modules/nativescript-plugin-firebase/platforms/android/include.gradle

As a workaround you can remove these lines from the
node_modules/nativescript-plugin-firebase/platforms/android/include.gradle file:

if (googlePlayServicesVersion != '+' && VersionNumber.parse(googlePlayServicesVersion) < VersionNumber.parse('15.0.+')) {
throw new GradleException(" googlePlayServicesVersion set too low, please update to at least 15.0.0 / 15.0.+ (currently set to $googlePlayServicesVersion)");
}

@SuperAssassinNinja Good call. Thanks bud.

Well, this got it building, but now it hangs on the splash screen until eventually timing out

Unable to apply changes on device: emulator-5554. Error is: Socket connection timed out..

@SephReed
Some one fixed it but it's probably just not out yet
https://github.com/EddyVerbruggen/nativescript-plugin-firebase/pull/1250

same in here, any fixes yet?

Can you check node_modules/nativescript-plugin-firebase/platforms/android/include.gradle? Search for VersionNumber. Does it say just VersionNumber, or org.gradle.util.VersionNumber? If it's the former, please remove node_modules and run npm i.

Thanks Eddy, just added 'org.gradle.util' and it started to build :)

That should be fixed with 8.3.0, see #1250

Was this page helpful?
0 / 5 - 0 ratings