Skip to content

Commit 5849bfb

Browse files
committed
Self-manage Andorid SDK on Travis
Travis uses the deprecated `android` CI to install the Android SDK. Unfortunatelly, at this point that outdated too is unable to install the latest version of the "Google Repository" Android SDK component. Switching to managing the Androd SDK by hand on Travis. That way, we can use `sdkmanager` (one of the replacements for `android`) and downlaod the latest versions of the Andorid SDK components. This change is required to update the plugin dependencies to the latest versions (flutter#141), which require the latest "Google Repository" version.
1 parent 2588a38 commit 5849bfb

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

.travis.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,6 @@ matrix:
4848
- os: linux
4949
env:
5050
- SHARD=Build-example-APKs
51-
language: android
52-
licenses:
53-
- 'android-sdk-preview-license-.+'
54-
- 'android-sdk-license-.+'
55-
- 'google-gdk-license-.+'
56-
android:
57-
components:
58-
- tools
59-
- platform-tools
60-
- build-tools-25.0.3
61-
- android-25
62-
- extra-android-m2repository
63-
- extra-google-m2repository
64-
- extra-google-android-support
6551
jdk: oraclejdk8
6652
sudo: false
6753
addons:
@@ -70,15 +56,30 @@ matrix:
7056
sources:
7157
- ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version
7258
packages:
59+
- lib32stdc++6 # https://github.com/flutter/flutter/issues/6207
7360
- libstdc++6
7461
- fonts-droid
7562
before_script:
63+
- wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
64+
- mkdir android-sdk
65+
- unzip -qq sdk-tools-linux-3859397.zip -d android-sdk
66+
- export ANDROID_HOME=`pwd`/android-sdk
67+
- export PATH=`pwd`/android-sdk/tools/bin:$PATH
68+
- mkdir -p /home/travis/.android # silence sdkmanager warning
69+
- echo 'count=0' > /home/travis/.android/repositories.cfg # silence sdkmanager warning
70+
- echo y | sdkmanager "tools"
71+
- echo y | sdkmanager "platform-tools"
72+
- echo y | sdkmanager "build-tools;25.0.3"
73+
- echo y | sdkmanager "platforms;android-25"
74+
- echo y | sdkmanager "extras;android;m2repository"
75+
- echo y | sdkmanager "extras;google;m2repository"
76+
- echo y | sdkmanager "patcher;v4"
77+
- sdkmanager --list
7678
- wget http://services.gradle.org/distributions/gradle-3.5-bin.zip
7779
- unzip -qq gradle-3.5-bin.zip
7880
- export GRADLE_HOME=$PWD/gradle-3.5
7981
- export PATH=$GRADLE_HOME/bin:$PATH
8082
- gradle -v
81-
- android list targets
8283
- git clone https://github.com/flutter/flutter.git --depth 1
8384
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
8485
- flutter doctor

0 commit comments

Comments
 (0)