Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B buck
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 201
    • Issues 201
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • buck
  • Issues
  • #643
Closed
Open
Issue created Feb 03, 2016 by Administrator@rootContributor

"error: cannot find symbol" When using dep android library resource.

Created by: sean-kenny

It seems that we are not able to access a dependent android library resource from within another android library.

In this scenario we have two android libraries in the libs folder:

  • lib1
  • lib2

lib1 depends on lib2 for a resource, which it accesses directly via R. For example (excerpt from this file)

// lib_two_value comes from lib2 but is available via R in lib1 when using gradle
context.getString(R.string.lib_two_value)

When accessing a lib2 resource like this and running buck build //libs/lib1:lib, we get the following output:

> buck build //libs/lib1:lib
[-] PROCESSING BUCK FILES...FINISHED 0.2s [100%]
[+] DOWNLOADING... (0.00 B/S, TOTAL: 0.00 B, 0 Artifacts)
[+] BUILDING...1.0s [50%] (4/5 JOBS, 0 UPDATED, 0.0% CACHE MISS)
 |=> //libs/lib1:lib...  0.5s (running javac[0.4s])
 |=> IDLE
 |=> IDLE
 |=> IDLE
 |=> IDLE
/Users/seank/repo/buck-tests/BuckScenarioLibraryResourceMerging/libs/lib1/src/main/java/com/buckbuild/scenario/lib1/subpackage1/LibOneHelper.java:14: error: cannot find symbol
        return context.getString(R.string.lib_two_value);
                                         ^
  symbol:   variable lib_two_value
  location: class com.buckbuild.scenario.lib1.R.string
Errors: 1. Warnings: 0.

To help as much as possible, I've created a test buck scenario with additional documentation on the problem here

Perhaps our buck configuration is not correct, or maybe buck does not provide the same lib1 -> lib2 resource merging as Gradle like we would normally expect.

Assignee
Assign to
Time tracking