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

android_sdk_repository doesn't support prerelease SDK #3672

Closed
regisd opened this issue Sep 3, 2017 · 3 comments
Closed

android_sdk_repository doesn't support prerelease SDK #3672

regisd opened this issue Sep 3, 2017 · 3 comments
Assignees

Comments

@regisd
Copy link
Contributor

regisd commented Sep 3, 2017

Description of the problem / feature request / question:

blaze build fails on Android targets, when the "O" SDK is installed.

ERROR: /private/var/tmp/_bazel_regis/1081314112d824a9e1cd5151856b1ff2/external/androidsdk/BUILD.bazel:64:1: Traceback (most recent call last):
File "/private/var/tmp/_bazel_regis/1081314112d824a9e1cd5151856b1ff2/external/androidsdk/BUILD.bazel", line 64
create_system_images_filegroups(system_image_dirs = ["system-ima..."])
File "/private/var/tmp/_bazel_regis/1081314112d824a9e1cd5151856b1ff2/external/bazel_tools/tools/android/android_sdk_repository_template.bzl", line 298, in create_system_images_filegroups
int(apidir.split("-")[1])
invalid literal for int() with base 10: "O".

If possible, provide a minimal example to reproduce the problem:

Install a pre-release SDK, for instance "Android O" (before it was publicly announced as API 26).

ls /usr/local/android-sdk/platforms
android-16	android-23	android-25	android-O

Define ANDROID_HOME

export ANDROID_HOME=/usr/local/android-sdk

Enable Android support in the workspace

cat WORKSPACE
android_sdk_repository(
    name = "androidsdk",
    # Replace with your installed Android SDK API level
    api_level = 25
)

Build an android target

git clone -b source-only https://github.com/bazelbuild/examples
build examples/tutrial/android

Environment info

  • Operating System: Mac OS

  • Bazel version (output of bazel info release):
    release 0.5.4-homebrew

Have you found anything relevant by searching the web?

no

Anything else, information or logs or outputs that would be helpful?

(If they are large, please upload as attachment or provide link).

@aj-michael
Copy link
Contributor

Hi @regisd , I think that this error is not because you have platforms/android-O installed. Bazel should be ignoring that.

What is the contents of the system-images directory in your Android SDK?

@regisd
Copy link
Contributor Author

regisd commented Sep 3, 2017

I came to this conclusion when I saw

invalid literal for int() with base 10: "O".

Ah sorry, I used the SDK manager to replace O by 26.

Let me see if I can add O again.

@aj-michael
Copy link
Contributor

It's ok. I'm 99% sure this was caused by the presence of a directory called system-images/android-O, which is something I did not forsee when creating android_sdk_repository. I have a fix in the works, that should hopefully get checked in Tuesday.

Thanks for reporting 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

2 participants