Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

SDK tools updated to 25.2.5 #68

Merged
merged 2 commits into from
Mar 14, 2017

Conversation

koral--
Copy link
Contributor

@koral-- koral-- commented Mar 12, 2017

SDK tools updated to 25.2.5
android command replaced with sdkmanager
constraint layout extra added
armeabi-v7a Google API system image added
pipe with echo y replaced with license file

SDK tools 25.2.5 contains both usable android and sdkmanager commands so build steps using obsolete commands won't be broken (in 25.3.1 android became unusable stub).

obsolete android command replaced with sdkmanager
constraint layout extra added
armeabi-v7a Google API system image added
@viktorbenei
Copy link
Contributor

Wow, thank you @koral-- for the PR!!

Just a quick question: does sdkmanager return a proper exit code when the package can't be installed / the install fails? The | grep 'package installed' postfix was required because android update sdk always returned with a 0 exit code, even if the install failed, but in that case the output of android update sdk did not include package installed, so the exit code of grep is non zero if the package install fails.

This is quite important, to ensure that an image is only created if all packages are successfully installed.

@koral--
Copy link
Contributor Author

koral-- commented Mar 13, 2017

No internet connection:

test ~ # sdkmanager "build-tools;25.0.1"                                                                                                                                               
Warning: File /root/.android/repositories.cfg could not be loaded.                                                                                                                                                   
Warning: java.net.UnknownHostException: dl.google.com                                                                                                                                                                
Warning: Failed to connect to host: https://dl.google.com/android/repository/addons_list-3.xml                                                                                                                       
Warning: Failed to connect to host: https://dl.google.com/android/repository/addons_list-2.xml                                                                                                                       
Warning: Failed to connect to host: https://dl.google.com/android/repository/addons_list-1.xml                                                                                                                       
Warning: Failed to download any source lists!                                                                                                                                                                        
Error: Failed to find package build-tools;25.0.1
test ~ # echo $?
1

Unwritable destination directory:

test ~ # touch /tmp/opt/android-sdk/build-tools                
test ~ # chmod -rwx /tmp/opt/android-sdk/build-tools
test ~ # /tmp/opt/android-sdk/tools/bin/sdkmanager "build-tools;25.0.1"
Warning: File /root/.android/repositories.cfg could not be loaded.
Warning: Failed to read or create install properties file.
done
test ~ # echo $?
0

Invalid component name:

test ~ # rm /tmp/opt/android-sdk/build-tools
test ~ # /tmp/opt/android-sdk/tools/bin/sdkmanager "build-tools;25.0.5"
Warning: File /root/.android/repositories.cfg could not be loaded.
Error: Failed to find package build-tools;25.0.5
test ~ # echo $?
1

As you see exit code is proper in most test cases. Searching for done (which is printed in case of success) in standard output won't improve anything.

@koral-- koral-- closed this Mar 13, 2017
@koral-- koral-- reopened this Mar 13, 2017
Copy link
Contributor

@viktorbenei viktorbenei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome PR overall, it's just quite an extensive update that's why we have a couple of questions - we'll check these too, so these comments are for us as well ;)

Dockerfile Outdated
RUN sdkmanager "extras;android;m2repository"
RUN sdkmanager "extras;google;m2repository"
RUN sdkmanager "extras;google;google_play_services"
RUN sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please move these into a new section, like the Android System Images or build tools ones? It's easier to manage versioned packages that way, if those are in a separate section, with "descending" order.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

RUN echo 8933bad161af4178b1185d1a37fbf41ea5269c55 > ${ANDROID_HOME}/licenses/android-sdk-license

# Platform tools
RUN sdkmanager "platform-tools"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required? Isn't platform-tools part of the sdk? I know we did install it too, just curious as the Android SDK distribution changed quite a bit in the last year, changing things like what's in the SDK/ZIP quite a bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

platform-tools contain binaries used in project development like adb or hprof-conv while tools is for managing SDK itself eg. sdkmanager, avdmanager are there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And answering the first question: it is required, adb is used to install apps on devices and emulators.

Dockerfile Outdated

# Accept license before installing components, no need to echo y
RUN mkdir -p ${ANDROID_HOME}/licenses
RUN echo 8933bad161af4178b1185d1a37fbf41ea5269c55 > ${ANDROID_HOME}/licenses/android-sdk-license
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What license is this? For what package & what version?

Can you please add it as a comment, maybe with some notes for when this have to be updated in the future how you can get the new license, would help a lot with future updates.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This license is called android-sdk-license and (at the time of writing) is valid for all components in the stable channel (so all installed from Dockerfile). There are separate licenses for other, not installed components:

  • android-googletv-license
  • android-sdk-preview-license
  • google-gdk-license
  • mips-android-sysimage-license
  • intel-android-extra-license (this one is not applicable on Linux)

I think in the future (starting from tools 25.3.1) the easiest way to accept licenses is like that:
yes | sdkmanager --licenses
it will answer y for all the licenses.

RUN cd /opt && unzip -q android-sdk-tools.zip
RUN mkdir -p ${ANDROID_HOME}
RUN cd /opt && mv tools/ ${ANDROID_HOME}/tools/
RUN cd /opt && rm -f android-sdk-tools.zip

ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's in tools/bin?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sdkmanager is in tools/bin

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avdmanager added in version 25.3.1 will also go here.

@viktorbenei
Copy link
Contributor

viktorbenei commented Mar 13, 2017

Content of tools_r25.2.5-linux.zip (full tree .):

content.txt

Layout:

$ tree -L 4

.
└── tools
    ├── android
    ├── ant
    │   ├── build.xml
    │   ├── NOTICE
    │   └── uibuild.xml
    ├── apps
    │   └── SdkController
    │       ├── AndroidManifest.xml
    │       ├── assets
    │       ├── bin
    │       ├── Implementation.txt
    │       ├── NOTICE
    │       ├── proguard-project.txt
    │       ├── project.properties
    │       ├── res
    │       └── src
    ├── bin
    │   └── sdkmanager
    ├── bin64
    │   ├── e2fsck
    │   ├── fsck.ext4
    │   ├── mkfs.ext4
    │   ├── resize2fs
    │   └── tune2fs
    ├── ddms
    ├── draw9patch
    ├── emulator
    ├── emulator64-arm
    ├── emulator64-crash-service
    ├── emulator64-mips
    ├── emulator64-x86
    ├── emulator-check
    ├── hierarchyviewer
    ├── jobb
    ├── lib
    │   ├── advancedFeatures.ini
    │   ├── android.el
    │   ├── annotations-12.0.jar
    │   ├── annotations-25.3.0-dev.jar
    │   ├── annotations.jar
    │   ├── ant-tasks.jar
    │   ├── archquery.jar
    │   ├── asm-5.0.3.jar
    │   ├── asm-analysis-5.0.3.jar
    │   ├── asm-tree-5.0.3.jar
    │   ├── asset-studio.jar
    │   ├── builder-model.jar
    │   ├── build_gradle.template
    │   ├── build.template
    │   ├── ca-bundle.pem
    │   ├── chimpchat.jar
    │   ├── common-25.3.0-dev.jar
    │   ├── common.jar
    │   ├── commons-codec-1.4.jar
    │   ├── commons-compress-1.8.1.jar
    │   ├── commons-logging-1.1.1.jar
    │   ├── ddmlib.jar
    │   ├── ddms.jar
    │   ├── ddmuilib.jar
    │   ├── devices.xml
    │   ├── draw9patch.jar
    │   ├── dvlib-25.3.0-dev.jar
    │   ├── dvlib.jar
    │   ├── ecj-4.4.2.jar
    │   ├── emma_ant.jar
    │   ├── emma_device.jar
    │   ├── emma.jar
    │   ├── emulator
    │   │   └── snapshots.img
    │   ├── fat32lib.jar
    │   ├── gson-2.2.4.jar
    │   ├── guava-17.0.jar
    │   ├── guava-18.0.jar
    │   ├── hardware-properties.ini
    │   ├── hierarchyviewer2.jar
    │   ├── hierarchyviewer2lib.jar
    │   ├── httpclient-4.1.1.jar
    │   ├── httpcore-4.1.jar
    │   ├── httpmime-4.1.jar
    │   ├── jcommon-1.0.12.jar
    │   ├── jfreechart-1.0.9.jar
    │   ├── jfreechart-swt-1.0.9.jar
    │   ├── jimfs-1.1.jar
    │   ├── jobb.jar
    │   ├── jsilver-1.0.0.jar
    │   ├── jython-standalone-2.5.3.jar
    │   ├── kxml2-2.3.0.jar
    │   ├── layoutlib-api-25.3.0-dev.jar
    │   ├── layoutlib-api.jar
    │   ├── libstdc++
    │   │   ├── libstdc++.so.6
    │   │   └── libstdc++.so.6.0.18
    │   ├── lint-api.jar
    │   ├── lint-checks.jar
    │   ├── lint.jar
    │   ├── lombok-ast-0.2.3.jar
    │   ├── manifest-merger.jar
    │   ├── monitor-x86
    │   │   ├── artifacts.xml
    │   │   ├── configuration
    │   │   ├── epl-v10.html
    │   │   ├── features
    │   │   ├── libcairo-swt.so
    │   │   ├── monitor
    │   │   ├── monitor.ini
    │   │   ├── notice.html
    │   │   ├── p2
    │   │   ├── plugins
    │   │   └── readme
    │   ├── monitor-x86_64
    │   │   ├── artifacts.xml
    │   │   ├── configuration
    │   │   ├── epl-v10.html
    │   │   ├── features
    │   │   ├── libcairo-swt.so
    │   │   ├── monitor
    │   │   ├── monitor.ini
    │   │   ├── notice.html
    │   │   ├── p2
    │   │   ├── plugins
    │   │   └── readme
    │   ├── monkeyrunner.jar
    │   ├── ninepatch.jar
    │   ├── org-eclipse-core-commands-3.6.0.jar
    │   ├── org-eclipse-equinox-common-3.6.0.jar
    │   ├── org-eclipse-jface-3.6.2.jar
    │   ├── osgi-4.0.0.jar
    │   ├── pc-bios
    │   │   ├── bios-256k.bin
    │   │   ├── bios.bin
    │   │   ├── efi-virtio.rom
    │   │   ├── kvmvapic.bin
    │   │   ├── linuxboot.bin
    │   │   └── vgabios-cirrus.bin
    │   ├── plugin.prop
    │   ├── proguard-project.txt
    │   ├── repository-25.3.0-dev.jar
    │   ├── rule-api.jar
    │   ├── screenshot2.jar
    │   ├── sdk-common.jar
    │   ├── sdklib-25.3.0-dev.jar
    │   ├── sdklib.jar
    │   ├── sdkmanager.jar
    │   ├── sdkstats.jar
    │   ├── sdkuilib.jar
    │   ├── swtmenubar.jar
    │   ├── traceview.jar
    │   ├── uiautomatorviewer.jar
    │   ├── uibuild.template
    │   ├── x86
    │   │   └── swt.jar
    │   └── x86_64
    │       └── swt.jar
    ├── lib64
    │   ├── gles_mesa
    │   │   ├── libGL.so
    │   │   └── libGL.so.1
    │   ├── gles_swiftshader
    │   │   ├── libEGL.so
    │   │   ├── libGLES_CM.so
    │   │   └── libGLESv2.so
    │   ├── lib64EGL_translator.so
    │   ├── lib64emugl_test_shared_library.so
    │   ├── lib64GLES_CM_translator.so
    │   ├── lib64GLES_V2_translator.so
    │   ├── lib64OpenglRender.so
    │   ├── libstdc++
    │   │   ├── libstdc++.so.6
    │   │   └── libstdc++.so.6.0.18
    │   └── qt
    │       ├── lib
    │       └── plugins
    ├── lint
    ├── mksdcard
    ├── monitor
    ├── monkeyrunner
    ├── NOTICE.txt
    ├── proguard
    │   ├── ant
    │   │   └── task.properties
    │   ├── bin
    │   │   ├── proguardgui.sh
    │   │   ├── proguard.sh
    │   │   └── retrace.sh
    │   ├── docs
    │   │   ├── acknowledgements.html
    │   │   ├── alternatives.html
    │   │   ├── checkmark.gif
    │   │   ├── downloads.html
    │   │   ├── drop1.gif
    │   │   ├── drop2.gif
    │   │   ├── drop3.gif
    │   │   ├── FAQ.html
    │   │   ├── favicon.ico
    │   │   ├── feedback.html
    │   │   ├── GPL_exception.html
    │   │   ├── GPL.html
    │   │   ├── index.html
    │   │   ├── license.html
    │   │   ├── main.html
    │   │   ├── manual
    │   │   ├── quality.html
    │   │   ├── results.html
    │   │   ├── saikoalogo.png
    │   │   ├── screenshot_console.gif
    │   │   ├── screenshot_console_small.gif
    │   │   ├── screenshot_gui1.gif
    │   │   ├── screenshot_gui2.gif
    │   │   ├── screenshot_gui3.gif
    │   │   ├── screenshot_gui4.gif
    │   │   ├── screenshot_gui5.gif
    │   │   ├── screenshot_gui6.gif
    │   │   ├── screenshot_gui7.gif
    │   │   ├── screenshot_gui8.gif
    │   │   ├── screenshots_gui_small.gif
    │   │   ├── screenshots.html
    │   │   ├── sections.html
    │   │   ├── sflogo.png
    │   │   ├── steel.gif
    │   │   ├── style.css
    │   │   ├── testimonials.html
    │   │   ├── title.gif
    │   │   └── title.html
    │   ├── examples
    │   │   ├── android.pro
    │   │   ├── annotations
    │   │   ├── ant
    │   │   ├── applets.pro
    │   │   ├── applications.pro
    │   │   ├── dictionaries
    │   │   ├── library.pro
    │   │   ├── midlets.pro
    │   │   ├── proguardall.pro
    │   │   ├── proguardgui.pro
    │   │   ├── proguard.pro
    │   │   ├── retrace.pro
    │   │   ├── scala.pro
    │   │   └── servlets.pro
    │   ├── lib
    │   │   ├── proguardgui.jar
    │   │   ├── proguard.jar
    │   │   └── retrace.jar
    │   ├── license.html
    │   ├── proguard-android-optimize.txt
    │   ├── proguard-android.txt
    │   ├── proguard-project.txt
    │   └── README
    ├── qemu
    │   └── linux-x86_64
    │       ├── qemu-system-aarch64
    │       ├── qemu-system-armel
    │       ├── qemu-system-i386
    │       ├── qemu-system-mips64el
    │       ├── qemu-system-mipsel
    │       └── qemu-system-x86_64
    ├── screenshot2
    ├── source.properties
    ├── support
    │   ├── annotations.jar
    │   ├── typos-de.txt
    │   ├── typos-en.txt
    │   ├── typos-es.txt
    │   ├── typos-hu.txt
    │   ├── typos-it.txt
    │   ├── typos-nb.txt
    │   ├── typos-pt.txt
    │   └── typos-tr.txt
    ├── templates
    │   ├── activities
    │   │   ├── BlankActivity
    │   │   ├── BlankActivityWithFragment
    │   │   ├── EmptyActivity
    │   │   ├── FullscreenActivity
    │   │   ├── LoginActivity
    │   │   ├── MasterDetailFlow
    │   │   ├── NavigationDrawerActivity
    │   │   ├── SettingsActivity
    │   │   └── TabbedActivity
    │   ├── gradle
    │   │   ├── utils
    │   │   └── wrapper
    │   ├── other
    │   │   ├── AidlFile
    │   │   ├── AidlFolder
    │   │   ├── AndroidManifest
    │   │   ├── AppWidget
    │   │   ├── AssetsFolder
    │   │   ├── BlankFragment
    │   │   ├── BroadcastReceiver
    │   │   ├── ContentProvider
    │   │   ├── CustomView
    │   │   ├── Daydream
    │   │   ├── IntentService
    │   │   ├── JavaFolder
    │   │   ├── JniFolder
    │   │   ├── LayoutResourceFile
    │   │   ├── ListFragment
    │   │   ├── Notification
    │   │   ├── PlusOneFragment
    │   │   ├── ResFolder
    │   │   ├── ResourcesFolder
    │   │   ├── RsFolder
    │   │   ├── Service
    │   │   └── ValueResourceFile
    │   └── projects
    │       ├── NewAndroidApplication
    │       ├── NewAndroidLibrary
    │       └── NewJavaLibrary
    ├── traceview
    └── uiautomatorviewer

89 directories, 223 files

@viktorbenei
Copy link
Contributor

System report diff - seems 👍

diff --git a/system_reports/linux-docker-android.log b/system_reports/linux-docker-android.log
index 8613e77..f66d8dc 100644
--- a/system_reports/linux-docker-android.log
+++ b/system_reports/linux-docker-android.log
@@ -42,7 +42,7 @@
 * unzip: UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.
 * zip: This is Zip 3.0 (July 5th 2008), by Info-ZIP.
 * tar: tar (GNU tar) 1.28
-* tree: tree v1.7.0 (c) 1996 - 2014 by Steve Baker, Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro 
+* tree: tree v1.7.0 (c) 1996 - 2014 by Steve Baker, Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro
 * gcc: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
 * imagemagick (convert): Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-03-02 http://www.imagemagick.org
 
@@ -230,7 +230,7 @@ bq 2.0.24
 bq-nix 2.0.24
 core 2017.02.28
 core-nix 2017.02.28
-gcloud 
+gcloud
 gcloud-deps 2017.02.28
 gcloud-deps-linux-x86_64 2017.02.28
 gsutil 4.22
@@ -266,10 +266,12 @@ Revision 0e9850346394-android
 add-ons
 build-tools
 extras
+.knownPackages
+licenses
+patcher
 platforms
 platform-tools
 system-images
-temp
 tools
 
 * platform-tools:
@@ -281,6 +283,7 @@ fastboot
 hprof-conv
 lib64
 NOTICE.txt
+package.xml
 source.properties
 sqlite3
 systrace
@@ -299,11 +302,13 @@ systrace
 /opt/android-sdk-linux/extras
 ├── android
 │   └── m2repository
-└── google
-    ├── google_play_services
-    └── m2repository
+├── google
+│   ├── google_play_services
+│   └── m2repository
+└── m2repository
+    └── com
 
-5 directories, 0 files
+7 directories, 0 files
 
 * platforms:
 android-10
@@ -334,11 +339,14 @@ android-25
 ├── android-22
 │   └── default
 │       └── armeabi-v7a
-└── android-24
-    └── default
+├── android-24
+│   └── default
+│       └── armeabi-v7a
+└── android-25
+    └── google_apis
         └── armeabi-v7a
 
-18 directories, 0 files
+21 directories, 0 files
 ========================================

Copy link
Contributor

@viktorbenei viktorbenei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thank you very much @koral-- !

We'll run a couple of additional tests on staging build servers, but so far everything seems to be working as expected, and your changes should be part of this weekend's stack updates ;)

@viktorbenei viktorbenei merged commit e843afb into bitrise-io:master Mar 14, 2017
viktorbenei added a commit that referenced this pull request Mar 14, 2017
* SDK tools updated to 25.2.5
* And related, quite significant Dockerfile revision: #68
    * Thanks @koral-- for the PR!
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants