Skip to content

Conversation

@kitterion
Copy link
Contributor

While trying to set up a crashlytics example using bazel firebase example as a base I discovered that it doesn't build. After following the README and updating the WORKSPACE file to a recent commit of tools_android, it turned out that bazel fails with an error

ERROR: <path-to-bazel-examples>/android/firebase-cloud-messaging/app/BUILD:9:1: in android_library rule //app:crashlytics_lib: The location of your BUILD file determines the Java package used for Android resource processing. A directory named "java" or "javatests" will be used as your Java source root and the path of your BUILD file relative to the Java source root will be used as the package for Android resource processing. The Java source root could not be determined for "app". Move your BUILD file under a java or javatests directory, or set the 'custom_package' attribute.
ERROR: Analysis of target '//app:app' failed; build aborted: Analysis of target '//app:crashlytics_lib' failed; build aborted

It fails because bazel can't determine the package from the location of the BUILD file.
This PR fixes it by explicitly setting custom_package on the android_library created by crashlytics_android_library.

@kitterion kitterion requested review from ahumesky and jin as code owners October 7, 2019 23:49
Copy link
Member

@jin jin left a comment

Choose a reason for hiding this comment

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

thanks!

@jin jin merged commit 5608b96 into bazelbuild:master Oct 8, 2019
@kitterion kitterion deleted the crashlytics_android_library_package branch October 8, 2019 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants