Flavor 'nativescript-telerik-ui' has unknown dimension 'nativescript-telerik-ui'


#1

When building I get this error:

Flavor 'nativescript-telerik-ui' has unknown dimension 'nativescript-telerik-ui'.

It happens only when using the pro version 2.0.1 through the @progress registry. Doesn’t happen with the local .tgz pro version 2.0.1.

I noticed the error has to do with the include.gradle file it generates. I read the following article: https://docs.nativescript.org/plugins/plugins#includegradle-specification

It says that when the plugin doesn’t have the include.gradle, at build time gradle creates a default one with default elements. When I saw the include.gradle it generated for the plugin it seems to have generated a default one like so:

android {
    productFlavors {
        "nativescript-telerik-ui" {
            dimension "nativescript-telerik-ui"
        }
    }
}

The include.gradle file of the local .tgz version of the plugin is like this:

android {
    productFlavors {
        "F6" {
            dimension "nativescripttelerikuipro"
        }
    }
}

I replaced the include.gradle that is generated for the plugin from @progress registry with the latter and it got past the error. I recreated the problem by following these steps:

  1. create a new hello world app: tns create HelloWorld --template nativescript-template-ng-tutorial.
  2. use command npm login --registry=https://registry.npm.telerik.com/ --scope=@progress (assuming you have the credentials to login).
  3. use the command npm install --save @progress/nativescript-telerik-ui-pro to install the plugin.
  4. use tns run android.

@deyan If it’s actually because of the include.gradle file being created, is there a way I can work around this problem? If not then at least wanted to make this issue known to the team. Thanks.


#2

@anram, we’re currently working on addressing this issue. A quick workaround is to go to the node_modules/@progress folder and move the nativescript-telerik-ui-pro folder directly under node_modules. Delete the platforms folder and rebuild.