Bamboo Agent: failed to find Build Tools revision 23.0.3 - android

I use a pool of Linux agents to build my app. Every now and then an agent causes a build failure with the error:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':ComponentThatReqBuildToolsRev23.0.3:preBuild'.
> failed to find Build Tools revision 23.0.3
Because my build agents are remote (android is pre-installed /opt/android-sdk-linux/tools/android), I cannot preinstall the platform tools, build tools etc so have have a makefile included with my project. After checking out the code, it calls a method in the makefile:
#!/bin/bash
git submodule init
git submodule update
make updateSDK
# EOF
The method in the makefile is:
PACKAGES = "tools,platform-tools,build-tools-21.1.2,android-22,build-tools-23.0.3,android-21,extra-android-support,extra-android-m2repository,extra-google-m2repository,extra-google,google_play_services"
updateSDK:
(sleep 5 && while [ 1 ]; do sleep 1; echo y; done) \
| android --clear-cache update sdk --no-ui --all \
--filter $(PACKAGES)
In successful cases, the log from Bamboo shows:
Refresh Sources:
Fetching https://dl.google.com/android/repository/addons_list-2.xml
Validate XML
Parse XML
Fetched Add-ons List successfully
Refresh Sources
Fetching URL: https://dl.google.com/android/repository/repository-11.xml
Validate XML: https://dl.google.com/android/repository/repository-11.xml
Parse XML: https://dl.google.com/android/repository/repository-11.xml
Fetching URL: https://dl.google.com/android/repository/addon.xml
Validate XML: https://dl.google.com/android/repository/addon.xml
Parse XML: https://dl.google.com/android/repository/addon.xml
Fetching URL: https://dl.google.com/android/repository/glass/addon.xml
Validate XML: https://dl.google.com/android/repository/glass/addon.xml
Parse XML: https://dl.google.com/android/repository/glass/addon.xml
Fetching URL: https://dl.google.com/android/repository/extras/intel/addon.xml
Validate XML: https://dl.google.com/android/repository/extras/intel/addon.xml
Parse XML: https://dl.google.com/android/repository/extras/intel/addon.xml
Fetching URL: https://dl.google.com/android/repository/sys-img/android/sys-img.xml
Validate XML: https://dl.google.com/android/repository/sys-img/android/sys-img.xml
Parse XML: https://dl.google.com/android/repository/sys-img/android/sys-img.xml
Fetching URL: https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml
Validate XML: https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml
Parse XML: https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml
\Fetching URL: https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml
Validate XML: https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml
Parse XML: https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml
Fetching URL: https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml
Validate XML: https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml
Parse XML: https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml
Fetching URL: https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml
Validate XML: https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml
Parse XML: https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml
License id: android-sdk-license-c81a61d9
Used by:
- Android SDK Tools, revision 25.1.3
- Android SDK Platform-tools, revision 23.1
- Android SDK Build-tools, revision 23.0.3
- Android SDK Build-tools, revision 21.1.2
- SDK Platform Android 5.1.1, API 22, revision 2
- SDK Platform Android 5.0.1, API 21, revision 2
- Android Support Repository, revision 30
- Android Support Library, revision 23.2.1 (Obsolete)
- Google Play services, revision 29
- Google Repository, revision 25
...
Do you accept the license 'android-sdk-license-c81a61d9' [y/n]:
y'. (There's a few of these)
Lots of lines of install code....
Finished task 'Update Android SDK' with result: Success
But every now and then, it connects to the wrong repository, either:
Fetching URL: https://dl.google.com/android/repository/repository-8.xml
or
Fetching URL: https://dl.google.com/android/repository/repository-10.xml
It's identical to the above log except for the url. It gives this error:
Error: Ignoring unknown package filter 'build-tools-23.0.3'
In these cases, the xml file does not contain build tools 23.0.3, i.e. this bit:
<sdk:archive>
<!--Built on: Tue Mar 15 17:38:51 2016.-->
<sdk:size>40733174</sdk:size>
<sdk:checksum type="sha1">368f2600feac7e9b511b82f53d1f2240ae4a91a3</sdk:checksum>
<sdk:url>build-tools_r23.0.3-linux.zip</sdk:url>
<sdk:host-os>linux</sdk:host-os>
</sdk:archive><sdk:archive>
<!--Built on: Tue Mar 15 17:38:50 2016.-->
<sdk:size>39679533</sdk:size>
<sdk:checksum type="sha1">fbc98cd303fd15a31d472de6c03bd707829f00b0</sdk:checksum>
<sdk:url>build-tools_r23.0.3-macosx.zip</sdk:url>
<sdk:host-os>macosx</sdk:host-os></sdk:archive>
<sdk:archive>
<!--Built on: Tue Mar 15 17:38:48 2016.-->
<sdk:size>39869945</sdk:size>
<sdk:checksum type="sha1">c6d8266c6a3243c8f1e41b786c0e3cee4c781263</sdk:checksum>
<sdk:url>build-tools_r23.0.3-windows.zip</sdk:url>
<sdk:host-os>windows</sdk:host-os>
</sdk:archive>
I've tried clearing the cache on the agent pre-build, I've tried listing the tools each time, used http and https and to no avail.
Basically my question is, where does the android update sdk command get the repository-XX.xml url from? Can you force this to the latest version?

Related

How to update AndroidSDK tools using Nexus Repository Manager

I'm trying to update build-tools for AndroidSDK. My machine locate in private network and we using Nexus Repository Manager. I have proxy repository to https://dl-ssl.google.com/android/repository and I can manually download for example https://nexus-ci.company/repository/proxy-group/addons_list-3.xml.
Also I know about SDK_TEST_BASE_URL environment variable, so I can override repository for resources.
My variable:
export SDK_TEST_BASE_URL=https://ci_dos_user:*******#nexus-ci.company/repository/proxy-group/
So yes, only way I can connect - with credentials.
But when I put path to my proxy repository I have error log:
Warning: IO exception while downloading manifest
java.io.IOException: Server returned HTTP response code: 401 for URL: https://ci_dos_user:*******#nexus-ci.company/repository/proxy-group/repository2-1.xml
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1932)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1528)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.openUrl(DownloadCache.java:248)
at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.downloadAndCache(DownloadCache.java:624)
at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.openCachedUrl(DownloadCache.java:547)
at com.android.sdklib.repository.legacy.LegacyDownloader.downloadAndStream(LegacyDownloader.java:61)
at com.android.repository.impl.manager.RemoteRepoLoaderImpl.lambda$fetchPackages$0(RemoteRepoLoaderImpl.java:139)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
How can I update my build-tools using nexus?
P.S.
I also know about --proxy flags to sdkmanager. But I have not access to proxy on my machine.

Update Android SDK sources

I want to install the latest build tools using android package. On attempting to list the Android SDK packages:
$ android list sdk
Refresh Sources:
Fetching https://dl.google.com/android/repository/addons_list-2.xml
Failed to fetch URL https://dl.google.com/android/repository/addons_list-2.xml, reason: File not found
Fetched Add-ons List successfully
Refresh Sources
Fetching URL: https://dl.google.com/android/repository/repository-11.xml
Failed to fetch URL https://dl.google.com/android/repository/repository-11.xml, reason: File not found
Refresh Sources:
Fetching URL: https://dl.google.com/android/repository/repository-11.xml
Failed to fetch URL https://dl.google.com/android/repository/repository-11.xml, reason: File not found
Refresh Sources:
Fetching URL: https://dl.google.com/android/repository/repository-11.xml
Failed to fetch URL https://dl.google.com/android/repository/repository-11.xml, reason: File not found
Packages available for installation or update: 0
It seems that I need to update the sources. How can I do that?

Android sys-img-armeabi-v7a-android-23 not found

I've been using the following command to install abi until today.
echo y | android update sdk --no-ui --all --filter sys-img-armeabi-v7a-android-23
But now I got the following error.
Error: Ignoring unknown package filter 'sys-img-armeabi-v7a-android-23'
Warning: The package filter removed all packages. There is nothing to install.
Please consider trying to update again without a package filter.
Is anyone having the same issue? I'm using Android SDK r24.4.1.
There is an issue about this:
https://code.google.com/p/android/issues/detail?id=206022
EDIT:
Working again
EDIT2: As of 2016-11-29, the problem remains:
android update sdk --no-ui --all --filter sys-img-armeabi-v7a-android-23 15:59:01 ☁ feat/TravisArchitecture ☀
Refresh Sources:
Fetching https://dl.google.com/android/repository/addons_list-2.xml
Validate XML
Parse XML
Fetched Add-ons List successfully
Refresh Sources
Fetching URL: https://dl.google.com/android/repository/repository-11.xml
Validate XML: https://dl.google.com/android/repository/repository-11.xml
Parse XML: https://dl.google.com/android/repository/repository-11.xml
Fetching URL: https://dl.google.com/android/repository/addon.xml
Validate XML: https://dl.google.com/android/repository/addon.xml
Parse XML: https://dl.google.com/android/repository/addon.xml
Fetching URL: https://dl.google.com/android/repository/glass/addon.xml
Validate XML: https://dl.google.com/android/repository/glass/addon.xml
Parse XML: https://dl.google.com/android/repository/glass/addon.xml
Fetching URL: https://dl.google.com/android/repository/extras/intel/addon.xml
Validate XML: https://dl.google.com/android/repository/extras/intel/addon.xml
Parse XML: https://dl.google.com/android/repository/extras/intel/addon.xml
Fetching URL: https://dl.google.com/android/repository/sys-img/android/sys-img.xml
Validate XML: https://dl.google.com/android/repository/sys-img/android/sys-img.xml
Parse XML: https://dl.google.com/android/repository/sys-img/android/sys-img.xml
Fetching URL: https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml
Validate XML: https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml
Parse XML: https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml
Fetching URL: https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml
Validate XML: https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml
Parse XML: https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml
Fetching URL: https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml
Validate XML: https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml
Parse XML: https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml
Error: Ignoring unknown package filter 'sys-img-armeabi-v7a-android-23'
Warning: The package filter removed all packages. There is nothing to install.
Please consider trying to update again without a package filter.

Error updating Android SDK (org.xml.sax.SAXParseException)

I'm trying to update the sdk via the command line using this command
echo y | android update sdk --no-ui --all --filter build-tools-23.0.2
and I'm getting this error
echo y | android update sdk --no-ui --all --filter build-tools-23.0.2
Refresh Sources:
Fetching https://dl.google.com/android/repository/addons_list-2.xml
Validate XML
Parse XML
Fetched Add-ons List successfully
Refresh Sources
Fetching URL: https://dl.google.com/android/repository/repository-11.xml
Validate XML: https://dl.google.com/android/repository/repository-11.xml
XML verification failed for https://dl.google.com/android/repository/repository-11.xml.
Line 306:41, Error: org.xml.sax.SAXParseException; lineNumber: 306; columnNumber: 41; cvc-datatype-valid.1.2.1: '11b' is not a valid value for 'integer'.
Fetching URL: https://dl.google.com/android/repository/addon.xml
Validate XML: https://dl.google.com/android/repository/addon.xml
Parse XML: https://dl.google.com/android/repository/addon.xml
Fetching URL: https://dl.google.com/android/repository/addon-6.xml
Validate XML: https://dl.google.com/android/repository/addon-6.xml
Parse XML: https://dl.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.google.com/android/repository/extras/intel/addon.xml
Validate XML: https://dl.google.com/android/repository/extras/intel/addon.xml
Parse XML: https://dl.google.com/android/repository/extras/intel/addon.xml
Fetching URL: https://dl.google.com/android/repository/sys-img/android/sys-img.xml
Validate XML: https://dl.google.com/android/repository/sys-img/android/sys-img.xml
Parse XML: https://dl.google.com/android/repository/sys-img/android/sys-img.xml
Fetching URL: https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml
Validate XML: https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml
Parse XML: https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml
Fetching URL: https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml
Validate XML: https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml
Parse XML: https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml
Fetching URL: https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml
Validate XML: https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml
Parse XML: https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml
Fetching URL: https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml
Validate XML: https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml
Parse XML: https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml
Refresh Sources:
Fetching URL: https://dl.google.com/android/repository/repository-11.xml
Validate XML: https://dl.google.com/android/repository/repository-11.xml
XML verification failed for https://dl.google.com/android/repository/repository-11.xml.
Line 306:41, Error: org.xml.sax.SAXParseException; lineNumber: 306; columnNumber: 41; cvc-datatype-valid.1.2.1: '11b' is not a valid value for 'integer'.
Error: Ignoring unknown package filter 'build-tools-23.0.2'
Warning: The package filter removed all packages. There is nothing to install.
Please consider trying to update again without a package filter.
The problem is probably here
Line 306:41, Error: org.xml.sax.SAXParseException; lineNumber: 306; columnNumber: 41; cvc-datatype-valid.1.2.1: '11b' is not a valid value for 'integer'.
This is running on a CircleCI box, and it has been running fine for a few days until now.
Anyone has an idea of whats happening?
Thanks in advance
The XML in question was versioned 11. The latest appears to be 12, and our builds are back on track as well. For a moment, the Android team appears to have fooled us.
Try rebuilding, but also note that some DNS etc could result in you not getting your update right away.

Xamarin Studio 2 - latest stable update - Error executing task Aapt: The source sequence is empty

I am using the trial version of Xamarin Studio for my final year project consisting an android application. Everything went smooth initially. But today right after updating to the latest stable version, i encountered an error (as stated on the title of this post).
The build log is as follows:
Building Solution: MyActivity.Mobile (Debug)
Building: MCAAndroid (Debug)
Build started 05/18/2013 17:04:44.
Project
"/Users/hazimanabhmy/Projects/MyActivity.Mobile/MCAAndroid/MCAAndroid.csproj"
(Build target(s)):
Target _CheckProjectItems:
CheckProjectItems Task
NativeLibraries:
JavaLibraries:
JavaSourceFiles:
Target _ComputeAndroidAssetsPaths:
ResourceFiles:
Assets/WebUI/newsfeed.html
Assets/WebUI/images/bg_content.png
Assets/WebUI/css/style.css
Assets/WebUI/images/flag.png
IntermediateFiles:
Target _GenerateAndroidAssetsDir: Skipping target
"_GenerateAndroidAssetsDir" because its outputs are up-to-date.
Target _ComputeAndroidResourcePaths:
ResourceFiles:
Resources/values/Strings.xml
Resources/drawable/Icon.png
Resources/layout/Login.axml
Resources/drawable/le_cool_logo.png
Resources/drawable/bg.jpg
Resources/drawable/icon_password.png
Resources/drawable/Icon_user.png
Resources/layout/Home.axml
Resources/drawable/info.png
Resources/drawable/settings.png
Resources/drawable/help.png
Resources/drawable/bg_content.png
Resources/drawable/shadow_black.9.png
Resources/drawable/cog.png
Resources/drawable/tools.png
Resources/layout/ReadMatric.axml
Resources/drawable/matric.jpg
Resources/drawable/mcalogo.png
IntermediateFiles:
Target _GenerateAndroidResourceDir: Skipping target
"_GenerateAndroidResourceDir" because its outputs are up-to-date.
Target _ResolveMonoAndroidSdks:
MonoAndroid Tools: /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/
MonoAndroid Framework: /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/platforms/android-10;/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1
MonoAndroid Binaries: /Library/Frameworks/Xamarin.Android.framework/Versions/Current/bin/
Android NDK:
Android SDK: /Users/hazimanabhmy/Library/Developer/Xamarin/android-sdk-mac_x86/
Java SDK: /usr/
Target _ValidateAndroidPackageProperties:
GetAndroidPackageName Task
ManifestFile: /Users/hazimanabhmy/Projects/MyActivity.Mobile/MCAAndroid/Properties/AndroidManifest.xml
AssemblyName: MCAAndroid
PackageName: MCAAndroid.MCAAndroid
Target _BuildDependencies:
Resolved library outputs:
Target _ExtractLibraryProjectImports:
Assemblies:
/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.dll
/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.Xml.dll
/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/platforms/android-10/Mono.Android.dll
/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.Core.dll
Jars:
ResolvedResourceDirectories:
Target _GetLibraryImports:
NativeLibraries:
Jars:
Target _CheckDuplicateJavaLibraries:
JavaSourceFiles:
JavaLibraries:
Target _UpdateAndroidResgen:
AdditionalResourceDirectories: /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets:
error : Error executing task Aapt: The source sequence is empty Task
"Aapt" execution -- FAILED Done building target "_UpdateAndroidResgen"
in project
"/Users/hazimanabhmy/Projects/MyActivity.Mobile/MCAAndroid/MCAAndroid.csproj".--
FAILED
Done building project
"/Users/hazimanabhmy/Projects/MyActivity.Mobile/MCAAndroid/MCAAndroid.csproj".--
FAILED
Build FAILED. Errors:
/Users/hazimanabhmy/Projects/MyActivity.Mobile/MCAAndroid/MCAAndroid.csproj
(Build) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets
(_UpdateAndroidResgen target) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets:
error : Error executing task Aapt: The source sequence is empty
0 Warning(s) 1 Error(s) Time Elapsed 00:00:00.1048310
---------------------- Done ----------------------
Build: 1 error, 0 warnings
I couldn't find the cause. Would someone help me?
I have asked this same question on Xamarin.Android's forum, and still waiting for their answer. But i think i could gather more resources and insights from experts here.
It's a recent change/bug in Xamarin.Android that expects to be used with Android tools rev. 22 or later where appt has been moved around in the sdk directory (from tools to build-tools). You need to go into the android sdk manager and update the SDK tools to revision 22 (or better) and also install the new build-tools package.

Categories

Resources