Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to speed up install of licenses? #115

Closed
Marty opened this issue Dec 10, 2020 · 9 comments
Closed

Any way to speed up install of licenses? #115

Marty opened this issue Dec 10, 2020 · 9 comments

Comments

@Marty
Copy link

Marty commented Dec 10, 2020

My gitlab runner takes quite a few moments for these things:

Running Gradle task 'bundleDebug'...    
Checking the license for package Android SDK Build-Tools 28.0.3 in /opt/android-sdk-linux/licenses
License for package Android SDK Build-Tools 28.0.3 accepted.
Preparing "Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)".
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" ready.
Installing Android SDK Build-Tools 28.0.3 in /opt/android-sdk-linux/build-tools/28.0.3
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" complete.
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" finished.
Checking the license for package Android SDK Platform 28 in /opt/android-sdk-linux/licenses
License for package Android SDK Platform 28 accepted.
Preparing "Install Android SDK Platform 28 (revision: 6)".
"Install Android SDK Platform 28 (revision: 6)" ready.
Installing Android SDK Platform 28 in /opt/android-sdk-linux/platforms/android-28
"Install Android SDK Platform 28 (revision: 6)" complete.
"Install Android SDK Platform 28 (revision: 6)" finished.
Checking the license for package Android SDK Platform 29 in /opt/android-sdk-linux/licenses
License for package Android SDK Platform 29 accepted.
Preparing "Install Android SDK Platform 29 (revision: 5)".
"Install Android SDK Platform 29 (revision: 5)" ready.
Installing Android SDK Platform 29 in /opt/android-sdk-linux/platforms/android-29
"Install Android SDK Platform 29 (revision: 5)" complete.
"Install Android SDK Platform 29 (revision: 5)" finished.

Is there any way to speed this up, either via caching a certain directory or by doing this when the image is built?

@Leystryku
Copy link

Leystryku commented Jan 8, 2021

Can confirm, I am having the same issue.
I believe the Dockerfile needs to

  1. Excute flutter precache
  2. Somehow Pre-install the Android SDK stuff

@fkorotkov
Copy link
Contributor

Could you please provide your YAML configuration?

@Leystryku
Copy link

Sure, here's mine which causes the same issue within the build stage.

image: cirrusci/flutter:stable

stages:
    - build
    - analyze
    - test

before_script:
    - flutter clean
    - flutter pub get


build:
    tags:
        - build
    stage: build
    script:
        - flutter build apk --target-platform android-arm --split-per-abi --release

unit_test:
    tags:
        - test
    stage: test
    script:
        - flutter pub global activate junitreport
        - export PATH=~/.pub-cache/bin:${PATH}
        - flutter test --machine | tojunit > test_report.xml
    artifacts:
        when: always
        reports:
            junit: test_report.xml
analyze:
    tags:
        - analyze
    stage: analyze
    script:
        - flutter analyze

@Leystryku
Copy link

Leystryku commented Jan 8, 2021

I believe you have to run these commands, the SDK this depends on uses version 30, flutter however uses 28. Plus the SDK does not have the platform-tools preinstalled.

How to fix it in commandline:

  flutter precache
  sdkmanager "--update" "--verbose" 
  sdkmanager "build-tools;28.0.3" "platform-tools" "platforms;android-28" "platforms;android-29" "extras;android;m2repository" "extras;google;google_play_services" "extras;google;m2repository"

@Leystryku
Copy link

Leystryku commented Jan 8, 2021

@fkorotkov
I have created a PR which fixes the issue
#120

@fkorotkov
Copy link
Contributor

Looks like this is a related issue flutter/flutter#63533

@kjeremy
Copy link

kjeremy commented May 30, 2021

I'm hitting this too along with the installation of the ndk and cmake for the bitmap package. Is there a way maybe to move the sdk components somewhere where gitlab can cache them and then move them back at the start of the build?

@fkorotkov
Copy link
Contributor

Until flutter/flutter#63533 is fixed I think the best workaround is to build your own Docker image based of cirrusci/flutter.

For folks using using Cirrus CI, Dockerfile as CI environment feature might be very handy.

@bartekpacia
Copy link
Contributor

Dear future readers: I made a small investigation of this issue, I hope it helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants