JaneaSystems / nodejs-mobile

Full-fledged Node.js on Android and iOS
https://code.janeasystems.com/nodejs-mobile
Other
2.56k stars 182 forks source link

error: tool 'xcodebuild' requires Xcode #152

Open ozican opened 5 years ago

ozican commented 5 years ago

Hello, I am following this => Prerequisites to build the iOS .framework library on macOS:

But when I come to this step./tools/ios_framework_prepare.sh it shows me an error;

rm -f -r out/Makefile node node_g out/Release/node \
                out/Release/node.exp
rm -f -r node_modules
rm -f test.tap
WARNING: C++ compiler too old, need g++ 4.9.4 or clang++ 3.4.2 (CXX=c++)
creating ./icu_config.gypi
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'OS': 'ios',
                 'asan': 0,
                 'chakra_disable_jit': 'true',
                 'chakracore_build_config': 'Release',
                 'chakracore_lto_build_flags': [],
                 'chakracore_parallel_build_flags': [],
                 'chakracore_use_lto': 'false',
                 'coverage': 'false',
                 'debug_devtools': 'node',
                 'debug_http2': 'false',
                 'debug_nghttp2': 'false',
                 'force_dynamic_crt': 0,
                 'host_arch': 'x64',
                 'icu_small': 'false',
                 'llvm_version': 0,
                 'node_byteorder': 'little',
                 'node_enable_d8': 'false',
                 'node_enable_v8_vtunejit': 'false',
                 'node_engine': 'chakracore',
                 'node_install_npm': 'true',
                 'node_module_version': 57,
                 'node_no_browser_globals': 'false',
                 'node_prefix': '/usr/local',
                 'node_release_urlbase': '',
                 'node_shared': 'false',
                 'node_shared_cares': 'false',
                 'node_shared_http_parser': 'false',
                 'node_shared_libuv': 'false',
                 'node_shared_openssl': 'false',
                 'node_shared_zlib': 'false',
                 'node_tag': '',
                 'node_target_type': 'static_library',
                 'node_use_bundled_v8': 'false',
                 'node_use_dtrace': 'false',
                 'node_use_etw': 'false',
                 'node_use_lttng': 'false',
                 'node_use_openssl': 'true',
                 'node_use_perfctr': 'false',
                 'node_use_v8_platform': 'true',
                 'node_without_node_options': 'false',
                 'openssl_fips': '',
                 'openssl_no_asm': 1,
                 'shlib_suffix': '57.dylib',
                 'target_arch': 'arm64',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 0,
                 'v8_enable_inspector': 0,
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 0,
                 'v8_promise_internal_field_count': 1,
                 'v8_random_seed': 0,
                 'v8_trace_maps': 0,
                 'v8_use_snapshot': 'true',
                 'want_separate_host_toolset': 1}}
creating ./config.gypi
creating ./config.mk
WARNING: warnings were emitted in the configure phase
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Traceback (most recent call last):
  File "./configure", line 1517, in <module>
    run_gyp(gyp_args)
  File "./tools/gyp_node.py", line 53, in run_gyp
    rc = gyp.main(args)
  File "./tools/gyp/pylib/gyp/__init__.py", line 538, in main
    return gyp_main(args)
  File "./tools/gyp/pylib/gyp/__init__.py", line 523, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "./tools/gyp/pylib/gyp/generator/make.py", line 2179, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File "./tools/gyp/pylib/gyp/generator/make.py", line 771, in Write
    extra_mac_bundle_resources, part_of_all)
  File "./tools/gyp/pylib/gyp/generator/make.py", line 877, in WriteActions
    env = self.GetSortedXcodeEnv()
  File "./tools/gyp/pylib/gyp/generator/make.py", line 1862, in GetSortedXcodeEnv
    additional_settings)
  File "./tools/gyp/pylib/gyp/xcode_emulation.py", line 1750, in GetSortedXcodeEnv
    additional_settings)
  File "./tools/gyp/pylib/gyp/xcode_emulation.py", line 1611, in _GetXcodeEnv
    'XCODE_VERSION_ACTUAL' : XcodeVersion()[0],
  File "./tools/gyp/pylib/gyp/xcode_emulation.py", line 1406, in XcodeVersion
    version = re.match(r'(\d\.\d\.?\d*)', version).groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'
jaimecbernardo commented 5 years ago

Hi @ozican , Did you try to solve this error from the log you posted?

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

https://github.com/janeasystems/nodejs-mobile/tree/f1e5e5ad5e90ac4b3f2e7782b3dd39ca139ff5b7#xcode-9-with-command-line-tools