Intellij: Error building android project: no such package '@intellij_aspect//'

Created on 22 Jan 2019  路  3Comments  路  Source: bazelbuild/intellij

I am attempting to move an Android project from Gradle to Bazel, but I am encountering an error when I try to build through Android Studio.

Building the project through the command line (i.e bazel build //...), everything compiles successfully and I can run the app on an emulator. However, building the project in Android Studio using the bazel plugin results in the following error:

ERROR: Encountered error while reading extension file 'intellij_info_bundled.bzl': no such package '@intellij_aspect//': /private/var/tmp/_bazel_tommy/8d411f88fac27b5686c7986040e7ebb8/external/intellij_aspect must be an existing directory.

I am using Android Studio 3.2 and Bazel plugin version 2018.11.12.0.4. I have attempted a bazel clean, reinstallation of Android Studio, and several different Bazel plugin versions. Please let me know if you need me to add any more information regarding this issue.

Android Studio

Most helpful comment

If you're on macOS, the following helps:

  1. Move ~/Library/Application Support/IntelliJIdea<version> to a directory without spaces.
  2. In your idea.properties file, set idea.plugins.path to that directory.

For more on how to modify that property, check here https://intellij-support.jetbrains.com/hc/en-us/articles/207240985

All 3 comments

Which version of bazel are you using? Could you include the full bazel command printed in the 'Bazel Console' view when you try to sync?

My guess is that this is a problem with importing the plugin. I had the same error and fixed it by first removing the bazel cache:
rm -rf ~/.cache/bazel/_bazel_$USERNAME/

And then manually importing the plugin into Android Studio
mv aswb ~/.AndroidStudio3.3/config/plugins/

After a restart it detects the plugin properly.

Also make sure you have the correct plugin version for your Android Studio.

If you're on macOS, the following helps:

  1. Move ~/Library/Application Support/IntelliJIdea<version> to a directory without spaces.
  2. In your idea.properties file, set idea.plugins.path to that directory.

For more on how to modify that property, check here https://intellij-support.jetbrains.com/hc/en-us/articles/207240985

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KaoruDev picture KaoruDev  路  3Comments

cmluciano picture cmluciano  路  9Comments

brownry1986 picture brownry1986  路  8Comments

sambercovici picture sambercovici  路  9Comments

davido picture davido  路  6Comments