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

Cache Google Android libraries #4065

Closed
svenfuchs opened this issue Jun 10, 2015 · 21 comments
Closed

Cache Google Android libraries #4065

svenfuchs opened this issue Jun 10, 2015 · 21 comments

Comments

@svenfuchs
Copy link
Contributor

[Android build logs show]
14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
June 2014.
Do you accept the license 'android-sdk-license-5be876d5' [y/n]: y
And a lot of output like this, which slow down the build by like 5 minutes. Is there any way to cache these Google libraries for Android, and not have Travis prompt me to accept EULA every time?

Depending how big these files are, can we just store them locally? Would we be allowed to store them on S3, maybe with some extra token?

@IgorGanapolsky
Copy link

Also, the bigger issue is accepting EULA. I shouldn't have to see it go through the same process on every build - wasting 10 minutes. The EULA should be accepted and cached. Is that possible?

@IgorGanapolsky
Copy link

Actually, I see you have this on your instrutions page http://docs.travis-ci.com/user/languages/android/:
licenses: - 'android-sdk-preview-license-52d11cd2' - 'android-sdk-license-.+' - 'google-gdk-license-.+'

Does this do what we're asking here?

@danielpassos
Copy link

@IgorGanapolsky Have you tested adding the licenses?

licenses:
    - 'android-sdk-license-.+'
    - 'google-gdk-license-.+'

@IgorGanapolsky
Copy link

@danielpassos I just use
licenses: - '.+'
Would that work?

@danielpassos
Copy link

@IgorGanapolsky This is my question for you :P

@scana
Copy link

scana commented Jan 29, 2016

@IgorGanapolsky is the whole "accepting EULAs" process is really slowing down builds?
I've always thought that it was just downloading dependencies problem.

The documentation states that licenses command is just for creating a whitelist.

@IgorGanapolsky
Copy link

@scana If it's a whitelist, then why is there a time overhead on every C.I. build to accepting the eula's?

@scana
Copy link

scana commented Mar 4, 2016

@BanzaiMan is there anything that could be done with that?

@mickyzinho
Copy link

Any news on this issue?

@luispereira
Copy link

luispereira commented Nov 16, 2016

Also, I'm having this issue

@IgorGanapolsky
Copy link

IgorGanapolsky commented Nov 16, 2016

I have a feeling I know why this issue is happening. TravisCI uses Docker images to do your builds. Upon every build, it creates a fresh Docker image instance. Then it uses wget command to download the Android SDK, and then install all the SDK components with the android command. Naturally, this will cause EULA prompts to come up every time, and nothing in the SDK is cached before the next build.

I came to this conclusion upon playing with Bitbucket Pipelines, which follows a similar build strategy for Android builds. Am I way off about TravisCI?

@luispereira
Copy link

I've been playing with cache of travis on Android and without any successful cached build so far, Until now I have something like this:

language: android
jdk: oraclejdk8
env:
  global:
    - GRADLE_USER_HOME=${TRAVIS_BUILD_DIR}/gradle
    - ANDROID_HOME=${TRAVIS_BUILD_DIR}/android-sdk
    - SDK=${TRAVIS_BUILD_DIR}/android-sdk
    - PATH=${GRADLE_USER_HOME}/bin/:${SDK}/:${SDK}/tools/:${SDK}/platform-tools/:${PATH}
before_install:
  - export OLD_SDK=/usr/local/android-sdk-23.0.2;
                                           mkdir -p ${SDK};
                                           cp -u -R ${OLD_SDK}/platforms ${SDK}/platforms;
                                           cp -u -R ${OLD_SDK}/system-images ${SDK}/system-images;
                                           cp -u -R ${OLD_SDK}/tools ${SDK}/tools

cache:
  apt: true
  directories:
    - ${TRAVIS_BUILD_DIR}/gradle/caches/
    - ${TRAVIS_BUILD_DIR}/gradle/wrapper/dists/
    - ${TRAVIS_BUILD_DIR}/android-sdk/extras/
android:
  components:
     # Update Android SDK Tools
    - tools
    - platform-tools
    - build-tools-23.0.2
    - android-23    
    - add-on
    - extra

script:
   - ./gradlew check

@ChristofferKarlsson
Copy link

Any update on this?
Each build now wastes around 10 minutes to download the Android components (build-tools, android, extras, etc).

@acnagy
Copy link

acnagy commented Feb 8, 2017

Hey @ChristofferKarlsson! Unfortunately, no news on caching the Andriod components, but, you may have better luck using the GCE infrastructure, sudo: required, if you aren't already - better specs over there can help speed things up as compared to the default container-based (sudo: false)

@albodelu
Copy link

albodelu commented Apr 2, 2017

@luispereira I wrote these lines and it worked but now it's located in /usr/local/android-sdk-24.0.2.

If you use sudo: false or sudo: required, it's not necessary to copy Sdk to another folder, there was an issue about file system or permissions that I think it's already solved.

@mswolters
Copy link

Couldn't you just put the latest android sdk in the container instead of requiring everyone to download all dependencies on every build?

@stale
Copy link

stale bot commented Apr 13, 2018

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

@stale stale bot added the stale label Apr 13, 2018
@stale stale bot closed this as completed Apr 15, 2018
@ber4444
Copy link

ber4444 commented May 29, 2018

travis should disable its bots, the issue is still a pain

@luispereira
Copy link

yes I agree, this should be reopen once again

@lordhong
Copy link

90 days and guys are ignoring this annoying issue? unbelievable 🙄

@kaushal98
Copy link

kaushal98 commented Sep 18, 2018

I think this has been going on for about 5 mins now -

image

Can Travis do anything about this?

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

No branches or pull requests