NativeScript / nativescript-cli

Command-line interface for building NativeScript apps
https://www.npmjs.com/package/nativescript
Apache License 2.0
1.04k stars 195 forks source link

plugin gradle fail #4825

Open farfromrefug opened 5 years ago

farfromrefug commented 5 years ago

If you have a plugin build.gradle like this:

def computeAndroidXVersion() {
    if(project.hasProperty("androidxVersion")) {
        return androidxVersion
    }
    else {
        return "1.0.0"
    }
}

dependencies {
    def androidxVersion = computeAndroidXVersion()

    compile "androidx.appcompat:appcompat:$androidxVersion"
    compile "com.google.android.material:material:1.1.0-alpha07"
}

it will fail to build because the method definition is not added the tempPlugin gradle file. So you end up with an error like this:

    * Where:
Build file '/Volumes/data/dev/nativescript/nativescript-material-components/demo-vue/platforms/tempPlugin/nativescript_material_button/build.gradle' line: 104

* What went wrong:
A problem occurred evaluating root project ‘nativescript_material_button’.
Could not find method computeAndroidXVersion() for arguments [] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
rosen-vladimirov commented 5 years ago

Related to: https://github.com/NativeScript/nativescript-cli/issues/3563