Bazel not able to find ANDROID_HOME

169 views
Skip to first unread message

bi...@spotify.com

unread,
Sep 22, 2017, 6:22:41 AM9/22/17
to bazel-discuss
Hi everyone,
I am importing the Dagger2 project in my IntelliJ but I keep getting this stupid error.
Error:(27, 1) no such package '@androidsdk//com.android.support': Either the path attribute of android_sdk_repository or the ANDROID_HOME environment variable must be set. and referenced by '//java/dagger/android/support:support'.

I have added ANDROID_HOME in my bash_profile like:
export ANDROID_HOME="/path/to/sdk/"

Inside IntelliJ, I have also added
Run>Edit Config>Defaults>Application>ANDROID_HOME=/path/to/sdk/

If someone know how to solve this, please help.

Jingwen Chen

unread,
Sep 22, 2017, 10:33:32 AM9/22/17
to bi...@spotify.com, bazel-discuss
That's odd, can you please try adding the attribute 'path = "/path/to/sdk/"' in the dagger project's WORKSPACE file's android_sdk_repository() rule?

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/f5a93d8c-db21-425b-be77-53754e12d06c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam Michael

unread,
Sep 22, 2017, 11:25:28 AM9/22/17
to Jingwen Chen, bi...@spotify.com, bazel-discuss
The intellij plugin is not passing the ANDROID_HOME environment variable to bazel. There is an open issue against the intellij plugin, https://github.com/bazelbuild/intellij/issues/102, but it hasn't gotten much attention. 

On Fri, Sep 22, 2017 at 10:33 AM, 'Jingwen Chen' via bazel-discuss <bazel-...@googlegroups.com> wrote:
That's odd, can you please try adding the attribute 'path = "/path/to/sdk/"' in the dagger project's WORKSPACE file's android_sdk_repository() rule?
On Fri, Sep 22, 2017 at 6:22 AM 'biraj....@gmail.com' via bazel-discuss <bazel-discuss@googlegroups.com> wrote:
Hi everyone,
I am importing the Dagger2 project in my IntelliJ but I keep getting this stupid error.
Error:(27, 1) no such package '@androidsdk//com.android.support': Either the path attribute of android_sdk_repository or the ANDROID_HOME environment  variable must be set. and referenced by '//java/dagger/android/support:support'.

I have added ANDROID_HOME in my bash_profile like:
export ANDROID_HOME="/path/to/sdk/"

Inside IntelliJ, I have also added
Run>Edit Config>Defaults>Application>ANDROID_HOME=/path/to/sdk/

If someone know how to solve this, please help.

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAMpM06D-Sam%2BN9QY2eJfjmsS6rLC-YKd6atiYhBir2_4%2BUCw1g%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages