Search code examples
androidfacebookbuck

Buck - name 'project_config' is not defined. How to solve it?


I don't know why, but Buck has been always painful to set up. I was trying to do the Getting started tutorial directly from Facebook page for Android in macOS. The issue is that I'm getting an error when I try to execute the following command: buck build demo_app_android

The error:

[+] PARSING BUCK FILES...0.4s
BUILD FAILED: Parse error for build file /Users/Antonio/Development/bucksamples/cross-platform-scale-2015-demo/android/BUCK:
NameError: name 'project_config' is not defined
Call stack:
  File "/Users/Antonio/Development/bucksamples/cross-platform-scale-2015-demo/.buckd/resources/v2017.05.31.01/buck_server/buck_parser/buck.py", line 1085, in process_with_diagnostics
diagnostics=diagnostics)
  File "/Users/Antonio/Development/bucksamples/cross-platform-scale-2015-demo/.buckd/resources/v2017.05.31.01/buck_server/buck_parser/buck.py", line 972, in process
os.path.join(self._project_root, path))
  File "/Users/Antonio/Development/bucksamples/cross-platform-scale-2015-demo/.buckd/resources/v2017.05.31.01/buck_server/buck_parser/buck.py", line 966, in _process_build_file
return self._process(build_env, path, is_implicit_include=False)
  File "/Users/Antonio/Development/bucksamples/cross-platform-scale-2015-demo/.buckd/resources/v2017.05.31.01/buck_server/buck_parser/buck.py", line 926, in _process
exec(code, module.__dict__)
  File "/Users/Antonio/Development/bucksamples/cross-platform-scale-2015-demo/android/BUCK", line 16
project_config(

Note: I cloned the fbsamples/bucksamples repository at GitHub

This is the BUCK file:

# Copyright 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.

android_binary(
  name = 'demo-app',
  manifest = 'AndroidManifest.xml',
  keystore = '//android/keystores:debug',
  deps = [
    '//android/java/com/facebook/buck/demo:lib',
  ],
)

project_config(
  src_target = ':demo-app',
)

Why is it failing if project_config is defined?


Solution

  • project_config was removed some time ago. Try to remove it from the BUCK file and run buck build again.