Unable to download extra-android-m2repository neither extra-google-m2repository #2470

Closed
ignasi opened this Issue Jun 27, 2014 · 26 comments

Comments

Projects
None yet
@ignasi

ignasi commented Jun 27, 2014

Hi, I'm using gradle on my apps and GCM, that is included at Google Play Services library. Gradle uses a custom maven repository to get this library.

Travis tries to download it with the next command:

android update sdk --no-ui --all --filter extra-google-m2repository

And this is the output of the update command at travis:

$ android-update-sdk --components=extra-google-m2repository --accept-licenses='android-sdk-license-5be876d5|android-sdk-preview-license-52d11cd2'
Installing extra-google-m2repository
spawn android update sdk --no-ui --all --filter extra-google-m2repository
Refresh Sources:
  Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xml
  Validate XML
  Parse XML
  Fetched Add-ons List successfully
  Refresh Sources
  Fetching URL: https://dl-ssl.google.com/android/repository/repository-9.xml
  Validate XML: https://dl-ssl.google.com/android/repository/repository-8.xml
  Parse XML:    https://dl-ssl.google.com/android/repository/repository-8.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/addon.xml
  Validate XML: https://dl-ssl.google.com/android/repository/addon.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/addon-6.xml
  Validate XML: https://dl-ssl.google.com/android/repository/addon-6.xml
  Parse XML:    https://dl-ssl.google.com/android/repository/addon-6.xml
  Fetching URL: https://dl-ssl.google.com/glass/gdk/addon.xml
  Validate XML: https://dl-ssl.google.com/glass/gdk/addon.xml
  Parse XML:    https://dl-ssl.google.com/glass/gdk/addon.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/extras/intel/addon.xml
  Validate XML: https://dl-ssl.google.com/android/repository/extras/intel/addon.xml
  Parse XML:    https://dl-ssl.google.com/android/repository/extras/intel/addon.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/sys-img/android/sys-img.xml
  Validate XML: https://dl-ssl.google.com/android/repository/sys-img/android/sys-img.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/sys-img/android-wear/sys-img.xml
  Validate XML: https://dl-ssl.google.com/android/repository/sys-img/android-wear/sys-img.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/sys-img/android-tv/sys-img.xml
  Validate XML: https://dl-ssl.google.com/android/repository/sys-img/android-tv/sys-img.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/sys-img/x86/addon-x86.xml
  Validate XML: https://dl-ssl.google.com/android/repository/sys-img/x86/addon-x86.xml
  Parse XML:    https://dl-ssl.google.com/android/repository/sys-img/x86/addon-x86.xml
Refresh Sources:
  Fetching URL: https://dl-ssl.google.com/android/repository/addon.xml
  Validate XML: https://dl-ssl.google.com/android/repository/addon.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/sys-img/android/sys-img.xml
  Validate XML: https://dl-ssl.google.com/android/repository/sys-img/android/sys-img.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/sys-img/android-wear/sys-img.xml
  Validate XML: https://dl-ssl.google.com/android/repository/sys-img/android-wear/sys-img.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/sys-img/android-tv/sys-img.xml
  Validate XML: https://dl-ssl.google.com/android/repository/sys-img/android-tv/sys-img.xml
Error: Ignoring unknown package filter 'extra-google-m2repository'
Warning: The package filter removed all packages. There is nothing to install.
         Please consider trying to update again without a package filter.

And this is the output when I run the same command at my local machine:

 android update sdk --no-ui --all --filter extra-android-m2repository                                                                                                              
Refresh Sources:
  Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xml
  Validate XML
  Parse XML
  Fetched Add-ons List successfully
  Refresh Sources
  Fetching URL: https://dl-ssl.google.com/android/repository/repository-10.xml
  Validate XML: https://dl-ssl.google.com/android/repository/repository-10.xml
  Parse XML:    https://dl-ssl.google.com/android/repository/repository-10.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/addon.xml
  Validate XML: https://dl-ssl.google.com/android/repository/addon.xml
  Parse XML:    https://dl-ssl.google.com/android/repository/addon.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/addon-6.xml
  Validate XML: https://dl-ssl.google.com/android/repository/addon-6.xml
  Parse XML:    https://dl-ssl.google.com/android/repository/addon-6.xml
  Fetching URL: https://dl-ssl.google.com/glass/gdk/addon.xml
  Validate XML: https://dl-ssl.google.com/glass/gdk/addon.xml
  Parse XML:    https://dl-ssl.google.com/glass/gdk/addon.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/extras/intel/addon.xml
  Validate XML: https://dl-ssl.google.com/android/repository/extras/intel/addon.xml
  Parse XML:    https://dl-ssl.google.com/android/repository/extras/intel/addon.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/sys-img/android/sys-img.xml
  Validate XML: https://dl-ssl.google.com/android/repository/sys-img/android/sys-img.xml
  Parse XML:    https://dl-ssl.google.com/android/repository/sys-img/android/sys-img.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/sys-img/android-wear/sys-img.xml
  Validate XML: https://dl-ssl.google.com/android/repository/sys-img/android-wear/sys-img.xml
  Parse XML:    https://dl-ssl.google.com/android/repository/sys-img/android-wear/sys-img.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/sys-img/android-tv/sys-img.xml
  Validate XML: https://dl-ssl.google.com/android/repository/sys-img/android-tv/sys-img.xml
  Parse XML:    https://dl-ssl.google.com/android/repository/sys-img/android-tv/sys-img.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/sys-img/x86/addon-x86.xml
  Validate XML: https://dl-ssl.google.com/android/repository/sys-img/x86/addon-x86.xml
  Parse XML:    https://dl-ssl.google.com/android/repository/sys-img/x86/addon-x86.xml
-------------------------------
License id: android-sdk-preview-license-52d11cd2
Used by:
 - Android Support Repository, revision 6
-------------------------------
// All the license text... accept

Installing Archives:
  Preparing to install archives
  Downloading Android Support Repository, revision 6
  Installing Android Support Repository, revision 6
    Installed Android Support Repository, revision 699%)
  Done. 1 package installed.

I got the same result trying to update extra-android-m2repository. If can help, here is my .travis.yml file:

language: android

android:
  components:
    - platform-tools
    - build-tools-19.1.0
    - android-19
    - extra-google-m2repository
    - extra-android-m2repository
  licenses:
    - android-sdk-license-5be876d5
    - android-sdk-preview-license-52d11cd2

notifications:
  email: false

before_script:
# - chmod +x ci/wait_for_emulator.sh
# - ci/wait_for_emulator.sh
# - adb shell input keyevent 82 &

script:
  - gradle assembleDebug

I suppose it could be workarounded adding google play services project as a module of the project, but I haven't tried it yet.

Thanks,
Ignasi

@abaker

This comment has been minimized.

Show comment
Hide comment
@abaker

abaker Jun 27, 2014

I'm experiencing the same issue

Travis:

$ spawn android update sdk --no-ui --all --filter build-tools-20.0.0
...
> failed to find Build Tools revision 20.0.0

Locally using revision 23 of the Android SDK Tools:

$ android update sdk --no-ui --all --filter build-tools-20.0.0
...
Do you accept the license 'android-sdk-license-5be876d5' [y/n]: y

Installing Archives:
  Preparing to install archives
  Downloading Android SDK Build-tools, revision 20
  Installing Android SDK Build-tools, revision 20
    Installed Android SDK Build-tools, revision 2099%)
  Done. 1 package installed.

My .travis.yml

language: android
jdk: oraclejdk7
env:
  matrix:
    - ANDROID_SDKS=android-19,sysimg-19 ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
android:
  components:
    - build-tools-20.0.0
  licenses:
    - android-sdk-license-5be876d5
    - android-sdk-preview-license-52d11cd2

...

abaker commented Jun 27, 2014

I'm experiencing the same issue

Travis:

$ spawn android update sdk --no-ui --all --filter build-tools-20.0.0
...
> failed to find Build Tools revision 20.0.0

Locally using revision 23 of the Android SDK Tools:

$ android update sdk --no-ui --all --filter build-tools-20.0.0
...
Do you accept the license 'android-sdk-license-5be876d5' [y/n]: y

Installing Archives:
  Preparing to install archives
  Downloading Android SDK Build-tools, revision 20
  Installing Android SDK Build-tools, revision 20
    Installed Android SDK Build-tools, revision 2099%)
  Done. 1 package installed.

My .travis.yml

language: android
jdk: oraclejdk7
env:
  matrix:
    - ANDROID_SDKS=android-19,sysimg-19 ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
android:
  components:
    - build-tools-20.0.0
  licenses:
    - android-sdk-license-5be876d5
    - android-sdk-preview-license-52d11cd2

...

@BanzaiMan BanzaiMan added the android label Jun 30, 2014

@jhbruhn

This comment has been minimized.

Show comment
Hide comment
@jhbruhn

jhbruhn Jun 30, 2014

I also have the problem described in the issue.

jhbruhn commented Jun 30, 2014

I also have the problem described in the issue.

@roidrage

This comment has been minimized.

Show comment
Hide comment
@roidrage

roidrage Jun 30, 2014

Member

@gildegoma Do you have any hints on what could be the issue here?

Member

roidrage commented Jun 30, 2014

@gildegoma Do you have any hints on what could be the issue here?

@gildegoma

This comment has been minimized.

Show comment
Hide comment
@gildegoma

gildegoma Jun 30, 2014

Member

The Travis build environment is currently pre-installed with Android SDK 22.6.2, which apparently cannot fetch the latest revisions of extra-android-m2repository and extra-google-m2repository. Same problem for build-tools-20.0.0 which also requires Android SDK 23. I am not sure if this "fetching problem" will systematically happen when Google releases a new SDK version, but in this case the upgrade seems to be necessary.

Due to some other bugs (#2279, #2466) in the Beta environment and the fact that android.components list defined in .travis.yml are installed very early by the Travis build script (in setup stage), the actual workaround is a bit tricky (but should work):

language: android
before_install:

  # workaround for travis-ci/travis-ci#2279
  - 'sudo mv /usr/local/android-sdk/tools/android-* /usr/local/bin'
  # Accept all licenses (workaround for travis-ci/travis-ci#2466)
  # Upgrade 'platform-tools' before 'tools' (workaround for travis-ci/travis-ci#2470)
  # Run dinstinct 'android update sdk' commands
  - "android-update-sdk --components='platform-tools,tools' --accept-licenses='.+'"
  - "android-update-sdk --components='build-tools-20.0.0' --accept-licenses='.+'"
  - "android-update-sdk --components='android-20' --accept-licenses='.+'"
  - "android-update-sdk --components='extra-android-m2repository,extra-google-m2repository' --accept-licenses='.+'"

# Don't make any component setup via `android.components` (due to travis-ci/travis-ci#2279)
#android:
#  components:
#    - android-20
#    - android-19

Upgrade to Android SDK 23 and various bug fixes are being prepared (see travis-ci/travis-cookbooks#337).

Please @ignasi @jhbruhn @abaker give us feedbacks, so we can improve and make the next SDK update sweeter!

Member

gildegoma commented Jun 30, 2014

The Travis build environment is currently pre-installed with Android SDK 22.6.2, which apparently cannot fetch the latest revisions of extra-android-m2repository and extra-google-m2repository. Same problem for build-tools-20.0.0 which also requires Android SDK 23. I am not sure if this "fetching problem" will systematically happen when Google releases a new SDK version, but in this case the upgrade seems to be necessary.

Due to some other bugs (#2279, #2466) in the Beta environment and the fact that android.components list defined in .travis.yml are installed very early by the Travis build script (in setup stage), the actual workaround is a bit tricky (but should work):

language: android
before_install:

  # workaround for travis-ci/travis-ci#2279
  - 'sudo mv /usr/local/android-sdk/tools/android-* /usr/local/bin'
  # Accept all licenses (workaround for travis-ci/travis-ci#2466)
  # Upgrade 'platform-tools' before 'tools' (workaround for travis-ci/travis-ci#2470)
  # Run dinstinct 'android update sdk' commands
  - "android-update-sdk --components='platform-tools,tools' --accept-licenses='.+'"
  - "android-update-sdk --components='build-tools-20.0.0' --accept-licenses='.+'"
  - "android-update-sdk --components='android-20' --accept-licenses='.+'"
  - "android-update-sdk --components='extra-android-m2repository,extra-google-m2repository' --accept-licenses='.+'"

# Don't make any component setup via `android.components` (due to travis-ci/travis-ci#2279)
#android:
#  components:
#    - android-20
#    - android-19

Upgrade to Android SDK 23 and various bug fixes are being prepared (see travis-ci/travis-cookbooks#337).

Please @ignasi @jhbruhn @abaker give us feedbacks, so we can improve and make the next SDK update sweeter!

@ignasi

This comment has been minimized.

Show comment
Hide comment
@ignasi

ignasi Jun 30, 2014

@gildegoma I have tried the workaround and it's working, thank you!

ignasi commented Jun 30, 2014

@gildegoma I have tried the workaround and it's working, thank you!

@gildegoma

This comment has been minimized.

Show comment
Hide comment
@gildegoma

gildegoma Jun 30, 2014

Member

From http://developer.android.com/tools/revisions/platforms.html

Important: To download the most recent Android system components from the Android SDK Manager, you must first update the SDK Tools to the most recent release and restart the SDK Manager. If you do not, the latest Android system components will not be available for download.

It looks like this note also applies to other components like Google APIs or extra-android-m2repository.

A "wasteful but safe" approach could consist in systematically run android-update-sdk --components='platform-tools,tools' on the begin of each build. @rkistner Do you see any better way to solve this kind of problems in the future?


For the records:

Instead of 99 components on May 14th, an Android SDK 22.6.2 installation only can get 52 components (after that Android SDK revision 23 has been released):

tools
platform-tools
build-tools-19.1.0
build-tools-19.0.3
build-tools-19.0.2
build-tools-19.0.1
build-tools-19.0.0
build-tools-18.1.1
build-tools-18.1.0
build-tools-18.0.1
build-tools-17.0.0
doc-19
android-19
android-18
android-17
android-16
android-15
android-14
android-13
android-12
android-11
android-10
android-9
android-8
android-7
android-6
android-5
android-4
android-3
android-2
sample-19
sample-18
sample-17
sample-16
sample-15
sample-14
sample-13
sample-12
sample-11
sample-10
sample-9
sample-8
sample-7
addon-google_apis_x86-google-19
addon-google_gdk-google-19
source-19
source-18
source-17
source-16
source-15
source-14
extra-android-support

There are now 109 components available with Android SDK 23:

tools
platform-tools
build-tools-20.0.0
build-tools-19.1.0
build-tools-19.0.3
build-tools-19.0.2
build-tools-19.0.1
build-tools-19.0.0
build-tools-18.1.1
build-tools-18.1.0
build-tools-18.0.1
build-tools-17.0.0
doc-L
android-20
android-L
android-19
android-18
android-17
android-16
android-15
android-14
android-13
android-12
android-11
android-10
android-9
android-8
android-7
android-6
android-5
android-4
android-3
android-2
sample-20
sample-L
sample-19
sample-18
sample-17
sample-16
sample-15
sample-14
sample-13
sample-12
sample-11
sample-10
sample-9
sample-8
sample-7
sys-img-armeabi-v7a-android-wear-20
sys-img-x86-android-wear-20
sys-img-armeabi-v7a-android-tv-l
sys-img-x86-android-tv-l
sys-img-armeabi-v7a-android-l
sys-img-x86-android-l
sys-img-armeabi-v7a-android-19
sys-img-x86-android-19
sys-img-armeabi-v7a-android-18
sys-img-x86-android-18
sys-img-armeabi-v7a-android-17
sys-img-x86-android-17
sys-img-mips-android-17
sys-img-armeabi-v7a-android-16
sys-img-x86-android-16
sys-img-mips-android-16
sys-img-armeabi-v7a-android-15
sys-img-x86-android-15
sys-img-mips-android-15
sys-img-armeabi-v7a-android-14
sys-img-x86-android-10
addon-google_apis_x86-google-19
addon-google_apis-google-19
addon-google_gdk-google-19
addon-google_apis-google-18
addon-google_apis-google-17
addon-google_apis-google-16
addon-google_apis-google-15
addon-google_apis-google-14
addon-google_apis-google-13
addon-google_tv_addon-google-13
addon-google_apis-google-12
addon-google_tv_addon-google-12
addon-google_apis-google-11
addon-google_apis-google-10
addon-google_apis-google-9
addon-google_apis-google-8
addon-google_apis-google-7
addon-google_apis-google-6
addon-google_apis-google-5
addon-google_apis-google-4
addon-google_apis-google-3
source-20
source-19
source-18
source-17
source-16
source-15
source-14
extra-android-m2repository
extra-android-support
extra-google-admob_ads_sdk
extra-google-analytics_sdk_v2
extra-google-gcm
extra-google-google_play_services_froyo
extra-google-google_play_services
extra-google-m2repository
extra-google-play_apk_expansion
extra-google-play_billing
extra-google-play_licensing
extra-google-webdriver
Member

gildegoma commented Jun 30, 2014

From http://developer.android.com/tools/revisions/platforms.html

Important: To download the most recent Android system components from the Android SDK Manager, you must first update the SDK Tools to the most recent release and restart the SDK Manager. If you do not, the latest Android system components will not be available for download.

It looks like this note also applies to other components like Google APIs or extra-android-m2repository.

A "wasteful but safe" approach could consist in systematically run android-update-sdk --components='platform-tools,tools' on the begin of each build. @rkistner Do you see any better way to solve this kind of problems in the future?


For the records:

Instead of 99 components on May 14th, an Android SDK 22.6.2 installation only can get 52 components (after that Android SDK revision 23 has been released):

tools
platform-tools
build-tools-19.1.0
build-tools-19.0.3
build-tools-19.0.2
build-tools-19.0.1
build-tools-19.0.0
build-tools-18.1.1
build-tools-18.1.0
build-tools-18.0.1
build-tools-17.0.0
doc-19
android-19
android-18
android-17
android-16
android-15
android-14
android-13
android-12
android-11
android-10
android-9
android-8
android-7
android-6
android-5
android-4
android-3
android-2
sample-19
sample-18
sample-17
sample-16
sample-15
sample-14
sample-13
sample-12
sample-11
sample-10
sample-9
sample-8
sample-7
addon-google_apis_x86-google-19
addon-google_gdk-google-19
source-19
source-18
source-17
source-16
source-15
source-14
extra-android-support

There are now 109 components available with Android SDK 23:

tools
platform-tools
build-tools-20.0.0
build-tools-19.1.0
build-tools-19.0.3
build-tools-19.0.2
build-tools-19.0.1
build-tools-19.0.0
build-tools-18.1.1
build-tools-18.1.0
build-tools-18.0.1
build-tools-17.0.0
doc-L
android-20
android-L
android-19
android-18
android-17
android-16
android-15
android-14
android-13
android-12
android-11
android-10
android-9
android-8
android-7
android-6
android-5
android-4
android-3
android-2
sample-20
sample-L
sample-19
sample-18
sample-17
sample-16
sample-15
sample-14
sample-13
sample-12
sample-11
sample-10
sample-9
sample-8
sample-7
sys-img-armeabi-v7a-android-wear-20
sys-img-x86-android-wear-20
sys-img-armeabi-v7a-android-tv-l
sys-img-x86-android-tv-l
sys-img-armeabi-v7a-android-l
sys-img-x86-android-l
sys-img-armeabi-v7a-android-19
sys-img-x86-android-19
sys-img-armeabi-v7a-android-18
sys-img-x86-android-18
sys-img-armeabi-v7a-android-17
sys-img-x86-android-17
sys-img-mips-android-17
sys-img-armeabi-v7a-android-16
sys-img-x86-android-16
sys-img-mips-android-16
sys-img-armeabi-v7a-android-15
sys-img-x86-android-15
sys-img-mips-android-15
sys-img-armeabi-v7a-android-14
sys-img-x86-android-10
addon-google_apis_x86-google-19
addon-google_apis-google-19
addon-google_gdk-google-19
addon-google_apis-google-18
addon-google_apis-google-17
addon-google_apis-google-16
addon-google_apis-google-15
addon-google_apis-google-14
addon-google_apis-google-13
addon-google_tv_addon-google-13
addon-google_apis-google-12
addon-google_tv_addon-google-12
addon-google_apis-google-11
addon-google_apis-google-10
addon-google_apis-google-9
addon-google_apis-google-8
addon-google_apis-google-7
addon-google_apis-google-6
addon-google_apis-google-5
addon-google_apis-google-4
addon-google_apis-google-3
source-20
source-19
source-18
source-17
source-16
source-15
source-14
extra-android-m2repository
extra-android-support
extra-google-admob_ads_sdk
extra-google-analytics_sdk_v2
extra-google-gcm
extra-google-google_play_services_froyo
extra-google-google_play_services
extra-google-m2repository
extra-google-play_apk_expansion
extra-google-play_billing
extra-google-play_licensing
extra-google-webdriver
@BanzaiMan

This comment has been minimized.

Show comment
Hide comment
@BanzaiMan

BanzaiMan Jul 1, 2014

Member

@gildegoma So, until travis-ci/travis-cookbooks#337 is merged and VM updated, some components are simply unavailable, is that right?

Member

BanzaiMan commented Jul 1, 2014

@gildegoma So, until travis-ci/travis-cookbooks#337 is merged and VM updated, some components are simply unavailable, is that right?

@gildegoma

This comment has been minimized.

Show comment
Hide comment
@gildegoma

gildegoma Jul 1, 2014

Member

Android SDK revision 23 is required to fetch these components. So yes, the optimal fix will be to deliver the updated VM image as soon as possible. In the meantime the above workaround can be used to upgrade Android SDK as well, but it is quite ugly and annoying.

Below a bit more TL;DR stuff about possible improvements in the near future... To Android developers: please read and give your thoughts!


The new VM image will also include the fix for #2279, which means that in the future, it will be possible to do the following:

android:
  components:
    # Force update platform-tools and tools, to always run with the latest revision of Android SDK
    - platform-tools
    - tools
    # List of components that are not preinstalled on Travis VM, or that need to be updated
    - build-tools-20.0.0
    - ...

We maybe should consider offering a .travis.yml option, to allow to opt-out (or opt-in) the steps to force Android SDK update, as illustrated in following draft:

android:
  # Option to force the update of platform-tools and tools, 
  # to always run with the latest revision of Android SDK
  update_sdk: true
  components:
    # List of components that are not preinstalled on Travis VM, or that need to be updated
    - build-tools-20.0.0
    - ...

I see two approaches to improve on that points:

  1. head-style Pre-install less stuff (no more system images components, etc.) and auto-update to latest SDK revision by default.
    • Cons: That will result with more download time and potential broken builds when the code base is no longer compatible with latest SDK (or when component names change).
    • Pros: Travis CI tests will strongly help to detect incompatibility issues in your projects, VM image upgrade won't be mandatory.
  2. frozen-style (that cannot be named stable-style) Pre-install most popular components, assuming that projects can rely on a stable set of components. This could makes sense if using additional or updated components is not frequent.
    • Cons: It will be difficult to maintain this list of these "popular components" (including breaking removals) and new VM image will be requested after each new release of Android SDK.
    • Pros: faster build time (less downloads), some breaking changes components might be solved upstream in travis-cookbooks (but after VM updates!).

At first glance, I clearly prefer the first approach as I don't see real advantage to temporarily "hide" Google breaking changes. It is well known in Android community that such things frequently happen, so having to update the set of android components in .travis.yml should be expected.

Any other thoughts?

Member

gildegoma commented Jul 1, 2014

Android SDK revision 23 is required to fetch these components. So yes, the optimal fix will be to deliver the updated VM image as soon as possible. In the meantime the above workaround can be used to upgrade Android SDK as well, but it is quite ugly and annoying.

Below a bit more TL;DR stuff about possible improvements in the near future... To Android developers: please read and give your thoughts!


The new VM image will also include the fix for #2279, which means that in the future, it will be possible to do the following:

android:
  components:
    # Force update platform-tools and tools, to always run with the latest revision of Android SDK
    - platform-tools
    - tools
    # List of components that are not preinstalled on Travis VM, or that need to be updated
    - build-tools-20.0.0
    - ...

We maybe should consider offering a .travis.yml option, to allow to opt-out (or opt-in) the steps to force Android SDK update, as illustrated in following draft:

android:
  # Option to force the update of platform-tools and tools, 
  # to always run with the latest revision of Android SDK
  update_sdk: true
  components:
    # List of components that are not preinstalled on Travis VM, or that need to be updated
    - build-tools-20.0.0
    - ...

I see two approaches to improve on that points:

  1. head-style Pre-install less stuff (no more system images components, etc.) and auto-update to latest SDK revision by default.
    • Cons: That will result with more download time and potential broken builds when the code base is no longer compatible with latest SDK (or when component names change).
    • Pros: Travis CI tests will strongly help to detect incompatibility issues in your projects, VM image upgrade won't be mandatory.
  2. frozen-style (that cannot be named stable-style) Pre-install most popular components, assuming that projects can rely on a stable set of components. This could makes sense if using additional or updated components is not frequent.
    • Cons: It will be difficult to maintain this list of these "popular components" (including breaking removals) and new VM image will be requested after each new release of Android SDK.
    • Pros: faster build time (less downloads), some breaking changes components might be solved upstream in travis-cookbooks (but after VM updates!).

At first glance, I clearly prefer the first approach as I don't see real advantage to temporarily "hide" Google breaking changes. It is well known in Android community that such things frequently happen, so having to update the set of android components in .travis.yml should be expected.

Any other thoughts?

@gildegoma gildegoma referenced this issue in travis-ci/travis-cookbooks Jul 1, 2014

Merged

Android SDK Updates and Bug Fixes #337

@barbeau barbeau referenced this issue in OneBusAway/onebusaway-android Jul 1, 2014

Closed

Travis builds are failing #145

@stefanhoth

This comment has been minimized.

Show comment
Hide comment
@stefanhoth

stefanhoth Jul 2, 2014

Sorry but even after reading this thread I don't understand why you can't update extra-android-m2repository and extra-google-m2repository. It's basically a folder with poms and jars in it so there shouldn't be any backdraw from this but enables most developers running on gradle to use their current config on travis.

Sorry but even after reading this thread I don't understand why you can't update extra-android-m2repository and extra-google-m2repository. It's basically a folder with poms and jars in it so there shouldn't be any backdraw from this but enables most developers running on gradle to use their current config on travis.

@roidrage

This comment has been minimized.

Show comment
Hide comment
@roidrage

roidrage Jul 2, 2014

Member

@stefanhoth that update requires building a new build environment image, and we're working on figuring out the best path forward to update the repositories and ship that image.

Member

roidrage commented Jul 2, 2014

@stefanhoth that update requires building a new build environment image, and we're working on figuring out the best path forward to update the repositories and ship that image.

@stefanhoth

This comment has been minimized.

Show comment
Hide comment
@stefanhoth

stefanhoth Jul 2, 2014

@roidrage I see. How about read only access to a network drive that contains the shared directories?

@roidrage I see. How about read only access to a network drive that contains the shared directories?

@roidrage

This comment has been minimized.

Show comment
Hide comment
@roidrage

roidrage Jul 2, 2014

Member

We don't have a network drive at this point which is available for sharing, sorry.

Member

roidrage commented Jul 2, 2014

We don't have a network drive at this point which is available for sharing, sorry.

@stefanhoth

This comment has been minimized.

Show comment
Hide comment
@stefanhoth

stefanhoth Jul 2, 2014

@roidrage I see. And what's the problem with generating an updated image once a day or so?

@roidrage I see. And what's the problem with generating an updated image once a day or so?

@stefanhoth

This comment has been minimized.

Show comment
Hide comment
@stefanhoth

stefanhoth Jul 2, 2014

Mind you I'm only talking about the components you're naming as "pre-installed". These should reflect the current state and not some old version.

Mind you I'm only talking about the components you're naming as "pre-installed". These should reflect the current state and not some old version.

@roidrage

This comment has been minimized.

Show comment
Hide comment
@roidrage

roidrage Jul 2, 2014

Member

They reflect the state of when the image was build, and in accordance with our overall practice with languages and libraries, they'll probably never reflect the most recent of everything, which definitely has its ups and downs.

We're working with @gildegoma to finish things up and get an updated image out.

Member

roidrage commented Jul 2, 2014

They reflect the state of when the image was build, and in accordance with our overall practice with languages and libraries, they'll probably never reflect the most recent of everything, which definitely has its ups and downs.

We're working with @gildegoma to finish things up and get an updated image out.

@stefanhoth

This comment has been minimized.

Show comment
Hide comment
@stefanhoth

stefanhoth Jul 2, 2014

@roidrage Ok, let me know if/how I can help.

PS: I'd prefer a setup that doesn't require a sort-of-manual update of the environment on each build.

@roidrage Ok, let me know if/how I can help.

PS: I'd prefer a setup that doesn't require a sort-of-manual update of the environment on each build.

@gildegoma

This comment has been minimized.

Show comment
Hide comment
@gildegoma

gildegoma Jul 2, 2014

Member

There were a cascade of troubles:

  • With the last releases, android update sdk is broken when using an older installation (e.g. 22.6.2 in current VM image)
  • Unfortunately, it is not possible to upgrade to 23 on the build fly, because of bug #2279

The above problems will be fixed in new VM image, but we also want to adopt a maintenance strategy (#2296) able to better resist to the next changes introduced by Google in the future. That is this question that is delaying a bit the creation of the new VM image.

@stefanhoth Thanks for offering your help, your opinion on the proposal below would be great!

My naive assumption (to be (in)validated): it is (almost) always preferable to run the CI tests against the latest revisions of all android SDK components. As an example: gdg-x/frisbee@77dcb93

If the above hypothesis is correct (for a majority of projects), having preinstalled components is not optimal at all. I therefore suggest to not preinstall anything on the VM image to force each project to explicitly specify its dependencies.

Below an example of what Android .travis.yml would look like in the future:

language: android
android:
  components:
    # Ensure that latest Android SDK is used
    # Note: comment these lines if you prefer to keep using SDK version installed on the Travis VM.
    - platform-tools
    - tools

    # Proposal: VM image does not contain any pre-installed component, 
    # All dependencies must be explicitly declared in .travis.yml
    - build-tools-19.1.0
    - android-19
    - extra-android-m2repository
    - extra-google-m2repository    

# Upcoming: All licenses will be accepted by default (uncomment if whitelist is required)
#  licenses:
#    - android-sdk-license-bcbbd656
#    - '.*intel.+'
Member

gildegoma commented Jul 2, 2014

There were a cascade of troubles:

  • With the last releases, android update sdk is broken when using an older installation (e.g. 22.6.2 in current VM image)
  • Unfortunately, it is not possible to upgrade to 23 on the build fly, because of bug #2279

The above problems will be fixed in new VM image, but we also want to adopt a maintenance strategy (#2296) able to better resist to the next changes introduced by Google in the future. That is this question that is delaying a bit the creation of the new VM image.

@stefanhoth Thanks for offering your help, your opinion on the proposal below would be great!

My naive assumption (to be (in)validated): it is (almost) always preferable to run the CI tests against the latest revisions of all android SDK components. As an example: gdg-x/frisbee@77dcb93

If the above hypothesis is correct (for a majority of projects), having preinstalled components is not optimal at all. I therefore suggest to not preinstall anything on the VM image to force each project to explicitly specify its dependencies.

Below an example of what Android .travis.yml would look like in the future:

language: android
android:
  components:
    # Ensure that latest Android SDK is used
    # Note: comment these lines if you prefer to keep using SDK version installed on the Travis VM.
    - platform-tools
    - tools

    # Proposal: VM image does not contain any pre-installed component, 
    # All dependencies must be explicitly declared in .travis.yml
    - build-tools-19.1.0
    - android-19
    - extra-android-m2repository
    - extra-google-m2repository    

# Upcoming: All licenses will be accepted by default (uncomment if whitelist is required)
#  licenses:
#    - android-sdk-license-bcbbd656
#    - '.*intel.+'
@stefanhoth

This comment has been minimized.

Show comment
Hide comment
@stefanhoth

stefanhoth Jul 2, 2014

@gildegoma Hmm, I can see your point but your solution would increase the build time for every Android build to tackle a problem that occurs maybe once every two weeks. While Google is busy building the Android SDK Tools they are far from releasing a new version every day. Normally every 1-2 weeks something gets added.

Updating the SDK is something every Android developer usually does once a certain release has been announced or a certain time frame, say 1 month, has passed. It's not at all the case that we'll check the SDK for updates daily or even more often. My commit you mentioned before was a test on a theory on how you set up the environment. And it failed. 😉

My proposal would be to rebuild the image every X hours (24 / 12 / 6) with all components updated to the current state. This would lead to all Android builds using the newest releases only being broken for a few hours yet after that they'll enjoy a quicker build time.

Is there a reason why this isn't feasible?

@gildegoma Hmm, I can see your point but your solution would increase the build time for every Android build to tackle a problem that occurs maybe once every two weeks. While Google is busy building the Android SDK Tools they are far from releasing a new version every day. Normally every 1-2 weeks something gets added.

Updating the SDK is something every Android developer usually does once a certain release has been announced or a certain time frame, say 1 month, has passed. It's not at all the case that we'll check the SDK for updates daily or even more often. My commit you mentioned before was a test on a theory on how you set up the environment. And it failed. 😉

My proposal would be to rebuild the image every X hours (24 / 12 / 6) with all components updated to the current state. This would lead to all Android builds using the newest releases only being broken for a few hours yet after that they'll enjoy a quicker build time.

Is there a reason why this isn't feasible?

@roidrage

This comment has been minimized.

Show comment
Hide comment
@roidrage

roidrage Jul 2, 2014

Member

@stefanhoth there are quite a few, we just won't be able to ship updates at that speed at this time. The build environment update process isn't that complex, but every 24 hours is currently not within our reach, sorry.

Member

roidrage commented Jul 2, 2014

@stefanhoth there are quite a few, we just won't be able to ship updates at that speed at this time. The build environment update process isn't that complex, but every 24 hours is currently not within our reach, sorry.

@stefanhoth

This comment has been minimized.

Show comment
Hide comment
@stefanhoth

stefanhoth Jul 2, 2014

@roidrage Ok, if that's the case then I'll take any other solution that brings a working environment. Please just keep my ideas in mind in order to streamline the process. Thanks for your work!

@roidrage Ok, if that's the case then I'll take any other solution that brings a working environment. Please just keep my ideas in mind in order to streamline the process. Thanks for your work!

@nenick

This comment has been minimized.

Show comment
Hide comment
@nenick

nenick Jul 3, 2014

here is an old solution to get android projects compile. this should work when you replace it with the new versions

language: java
jdk: oraclejdk7
before_install:
    - wget http://dl.google.com/android/android-sdk_r22.3-linux.tgz
    - tar xzf android-sdk_r22.3-linux.tgz
    - export ANDROID_HOME=$PWD/android-sdk-linux
    - export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
    - echo y | android update sdk --filter platform-tools,android-19,addon-google_apis-google-18,extra
android-m2repository --no-ui --force
install:
  - true
script:
  - TERM=dumb ./gradlew assembleDebug :UnitTestsRobolectric:testDebug

nenick commented Jul 3, 2014

here is an old solution to get android projects compile. this should work when you replace it with the new versions

language: java
jdk: oraclejdk7
before_install:
    - wget http://dl.google.com/android/android-sdk_r22.3-linux.tgz
    - tar xzf android-sdk_r22.3-linux.tgz
    - export ANDROID_HOME=$PWD/android-sdk-linux
    - export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
    - echo y | android update sdk --filter platform-tools,android-19,addon-google_apis-google-18,extra
android-m2repository --no-ui --force
install:
  - true
script:
  - TERM=dumb ./gradlew assembleDebug :UnitTestsRobolectric:testDebug

@gildegoma gildegoma referenced this issue in travis-ci/docs-travis-ci-com Jul 3, 2014

Merged

Update Android Guide #91

@smvv

This comment has been minimized.

Show comment
Hide comment
@smvv

smvv Jul 7, 2014

Using this Travis config solved my problem with the missing Google Play Services while building on Travis: https://github.com/daimajia/AndroidImageSlider/blob/master/.travis.yml

The config uses android sdk version 23 instead of 22 (which is used in the config from @nenick).

(but it's still a temporarily workaround for Travis rather than a fix)

smvv commented Jul 7, 2014

Using this Travis config solved my problem with the missing Google Play Services while building on Travis: https://github.com/daimajia/AndroidImageSlider/blob/master/.travis.yml

The config uses android sdk version 23 instead of 22 (which is used in the config from @nenick).

(but it's still a temporarily workaround for Travis rather than a fix)

barbeau added a commit to CUTR-at-USF/onebusaway-android that referenced this issue Jul 7, 2014

daniele-athome added a commit to kontalk/androidclient that referenced this issue Jul 12, 2014

Workaround Android SDK update (travis-ci/travis-ci#2470)
Signed-off-by: Daniele Ricci <daniele.athome@gmail.com>

maurizi added a commit to maurizi/otm-android that referenced this issue Jul 18, 2014

Downgrade to older build tools to support Travis CI
There is an open issue with the latest verison of the Android SDK on Travis
travis-ci/travis-ci#2470

maurizi added a commit to maurizi/otm-android that referenced this issue Jul 18, 2014

Downgrade to older build tools to support Travis CI
There is an open issue with the latest verison of the Android SDK on Travis
travis-ci/travis-ci#2470

maurizi added a commit to maurizi/otm-android that referenced this issue Jul 18, 2014

Downgrade to older build tools to support Travis CI
There is an open issue with the latest verison of the Android SDK on Travis
travis-ci/travis-ci#2470

@adesugbaa adesugbaa referenced this issue in appcelerator-modules/ci Jul 29, 2014

Merged

Fix ci.travis - Return status and Android SDK. #2

@BanzaiMan

This comment has been minimized.

Show comment
Hide comment
@BanzaiMan

BanzaiMan Jul 31, 2014

Member

We've updated the Android build environment yesterday, and I believe this issue is fixed. If you see a problem, please open a new issue. Thank you.

Member

BanzaiMan commented Jul 31, 2014

We've updated the Android build environment yesterday, and I believe this issue is fixed. If you see a problem, please open a new issue. Thank you.

@BanzaiMan BanzaiMan closed this Jul 31, 2014

@vikram1023

This comment has been minimized.

Show comment
Hide comment
@vikram1023

vikram1023 Jan 10, 2015

I am having the same issue with latest andriod studio so i beleive this is not fixed.

I am having the same issue with latest andriod studio so i beleive this is not fixed.

@andrewdavidmackenzie

This comment has been minimized.

Show comment
Hide comment
@andrewdavidmackenzie

andrewdavidmackenzie Jan 10, 2015

Me also...here is my .travis.yml

android:
components:
- build-tools-21.1.1
- platform-tools
- tools
- android-21
- extra-google-google_play_services
- addon-google_apis-google-21
- extra-android-support

and it fails the build here:
.....deleted stuff.....
:copyDebugLint UP-TO-DATE
:preBuild FAILED
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':preBuild'.

    failed to find Build Tools revision 20.0.0

this is the project URL
https://travis-ci.org/andrewdavidmackenzie/CastCompanionLibrary-android

Me also...here is my .travis.yml

android:
components:
- build-tools-21.1.1
- platform-tools
- tools
- android-21
- extra-google-google_play_services
- addon-google_apis-google-21
- extra-android-support

and it fails the build here:
.....deleted stuff.....
:copyDebugLint UP-TO-DATE
:preBuild FAILED
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':preBuild'.

    failed to find Build Tools revision 20.0.0

this is the project URL
https://travis-ci.org/andrewdavidmackenzie/CastCompanionLibrary-android

@chrlie chrlie referenced this issue in forcedotcom/SalesforceMobileSDK-Android Nov 12, 2015

Merged

RestResponses can now be consumed as InputStreams #986

@babarqb

This comment has been minimized.

Show comment
Hide comment
@babarqb

babarqb Apr 1, 2016

You should: 1-Download https://dlssl.google.com/android/repository/android_m2repository_r22.zip

  1. Then go [username]\AppData(hidder folder)\Local\Xamarin\zip
    and delete any zip file from there. then rebuild you project and goto step 2 location you should found there something like 96659D653BDE??????????.zip file which visual studio try to download stop build and copy step 1. downloaded file in step 2 location and rename that file with this 96659D653BDE?????????? and remove 96659D653BDE??????????.zip file which is uncompleted. 3. Then go to visual studio and rebuild your project wait and Viola you got rebuild success. Good Luck

babarqb commented Apr 1, 2016

You should: 1-Download https://dlssl.google.com/android/repository/android_m2repository_r22.zip

  1. Then go [username]\AppData(hidder folder)\Local\Xamarin\zip
    and delete any zip file from there. then rebuild you project and goto step 2 location you should found there something like 96659D653BDE??????????.zip file which visual studio try to download stop build and copy step 1. downloaded file in step 2 location and rename that file with this 96659D653BDE?????????? and remove 96659D653BDE??????????.zip file which is uncompleted. 3. Then go to visual studio and rebuild your project wait and Viola you got rebuild success. Good Luck

@codingblazer codingblazer referenced this issue in BuildmLearn/BuildmLearn-Toolkit-Android Nov 19, 2016

Closed

Skip tutorial button added. #230

@codingblazer codingblazer referenced this issue in BuildmLearn/BuildmLearn-Toolkit-Android Nov 26, 2016

Closed

#211 Splash added #233

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