Error when adding component to project

I got this error when I tried to import a component into my project.
Somehow it can find Charts Lib when I import the component.

My strukture is as follow:
Project Component Extends
Base no.sws.base:base-global:0.1 -
Business no.sws.business:bus-global:0.1 Base
Vehicle no.sws.vehicle:vehicle-global:0.1 Business
Rental no.sws.rental:rental-global:0.1 Vehicle

When I open the last project Rental Cuba Studio complains.

Could not find com.haulmont.charts:charts-global:6.5.5.
This project is added to project “Business” and i want to use it in Business, Vehicle and Rental.

Need answer to this in a hurry.
See error log as attachment.

Errorlog.txt (50.3K)

Hi,
I have looked at your log and found the following. ‘‘Charts’’ component is searched in local Maven and https://repo.cuba-platform.com/content/groups/work. But it is located in the premium repo.
Check contents of the repositories block of your build.gradle.
Maybe premium repo is missed there.

 ext.cubaVersion = '6.5.5'
    repositories {
        maven {
            url 'https://repo.cuba-platform.com/content/groups/work'
            credentials {
                username(rootProject.hasProperty('repoUser') ? rootProject['repoUser'] : 'cuba')
                password(rootProject.hasProperty('repoPass') ? rootProject['repoPass'] : 'cuba123')
            }
        }
        maven {
            url 'https://repo.cuba-platform.com/content/groups/premium'
            credentials {
                username(rootProject.hasProperty('premiumRepoUser') ? rootProject['premiumRepoUser'] : System.getenv('CUBA_PREMIUM_USER'))
                password(rootProject.hasProperty('premiumRepoPass') ? rootProject['premiumRepoPass'] : System.getenv('CUBA_PREMIUM_PASSWORD'))
            }
        }
    }

It solved the problem by adding

maven {
            url 'https://repo.cuba-platform.com/content/groups/premium'
            credentials {
                username(rootProject.hasProperty('premiumRepoUser') ? rootProject['premiumRepoUser'] : System.getenv('CUBA_PREMIUM_USER'))
                password(rootProject.hasProperty('premiumRepoPass') ? rootProject['premiumRepoPass'] : System.getenv('CUBA_PREMIUM_PASSWORD'))
            }
        }

Into the project.
What I discovered is that, one have to check Chart and Report add-ons before adding the component.
This way the https://repo.cuba-platform.com/content/groups/premium maven repro is added to the project.
If https://repo.cuba-platform.com/content/groups/premium is added after adding the component, the checkboxes for Charts and Reports is disabled by default. No chance to turn it on or off in current project.
This will result in not adding “repo.cuba-platform.com/content/groups/premium” to the project and error occures.
Am I right?

Which version of Studio do you use?

When your project uses custom application component and this component has a premium addon the corresponding(to the addon) checkbox is set and disabled. It shows that the premium addon will be loaded by dependencies.
Studio also adds the premium repository to the build.gralde.
Probably some error occurred at the moment and the build.gradle became incorrect.
I have tried to reproduce the problem but in my environment, everything works well.
So if you have found the certain scenario when a component with premium addon is added but the premium repo does not appear, please share it.