Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-27720

Android: Error building SDK if python 3 is installed

    Details

    • Story Points:
      3
    • Sprint:
      2020 Sprint 2

      Description

      Using Fedora 31 (Linux) to compile the latest (2019-12-28) git SDK code you will run into problems

      Running Titanium "prebuild.js" script.
      Error: Command failed: python "titanium_mobile/android/runtime/v8/tools/genBootstrap.py" --runtime=v8
      Traceback (most recent call last):
        File "titanium_mobile/android/runtime/v8/tools/genBootstrap.py", line 92, in <module>
          main()
        File "titanium_mobile/android/runtime/v8/tools/genBootstrap.py", line 80, in main
          b = bootstrap.Bootstrap(bindings, moduleId="titanium", moduleName="Titanium")
        File "titanium_mobile/android/runtime/v8/tools/bootstrap.py", line 93, in __init__
          self.addToInitTable(proxy)
        File "titanium_mobile/android/runtime/v8/tools/bootstrap.py", line 120, in addToInitTable
          namespaces.insert(0, moduleNs)
      AttributeError: 'map' object has no attribute 'insert'
      

      at ChildProcess.exithandler (child_process.js:295:12)
          at ChildProcess.emit (events.js:210:5)
          at maybeClose (internal/child_process.js:1021:16)
          at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) {
        killed: false,
        code: 1,
        signal: null,
        cmd: 'python "titanium_mobile/android/runtime/v8/tools/genBootstrap.py" --runtime=v8',
        stdout: '',
        stderr: 'Traceback (most recent call last):\n' +
          '  File "titanium_mobile/android/runtime/v8/tools/genBootstrap.py", line 92, in <module>\n' +
          '    main()\n' +
          '  File "titanium_mobile/android/runtime/v8/tools/genBootstrap.py", line 80, in main\n' +
          '    b = bootstrap.Bootstrap(bindings, moduleId="titanium", moduleName="Titanium")\n' +
          '  File "titanium_mobile/android/runtime/v8/tools/bootstrap.py", line 93, in __init__\n' +
          '    self.addToInitTable(proxy)\n' +
          '  File "titanium_mobile/android/runtime/v8/tools/bootstrap.py", line 120, in addToInitTable\n' +
          '    namespaces.insert(0, moduleNs)\n' +
          "AttributeError: 'map' object has no attribute 'insert'\n"
      

      since it is using "python" to run genBootstrap.py. But in Fedora it will use python 3 since that is mapped as a default python. Changing
      https://github.com/appcelerator/titanium_mobile/blob/f687e3bbf8266707e6e5fdfdba6580e141a2221b/android/titanium/prebuild.js#L111
      and
      https://github.com/appcelerator/titanium_mobile/blob/f687e3bbf8266707e6e5fdfdba6580e141a2221b/android/titanium/prebuild.js#L141
      to python2 fixed the issue.

      A better solution to either port it to python3 or check for the correct python version at the beginning would be better. Python 2 won't be supported after April 2020 (last version was released 19th October)

      Recommended Solution:
      Use "python2" command line tool if available on system before using "python" command.

      Best Solution:
      Remove python dependency via ticket: TIMOB-27719
      We'll need to do this in the near future since Apple will no longer pre-install python on future macOS versions.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                michael Michael Gangolf
                Reviewer:
                Gary Mathews
                Tester:
                Samir Mohammed
              • Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration