0

I'm trying to build an android app, from Python using gradle and beeware.

EDIT: I'm following tutorial 0 on the briefcase tutorial: https://briefcase.readthedocs.io/en/latest/tutorial/tutorial-0.html

I have already tried switch toga versions and switching VOC versions. These both did not work.

This is where it says the error is:

        commandLine "voc -v -p app -o build/intermediates/classes/debug app".split()
    }
    exec {
        commandLine "voc -v -p app_packages -o build/intermediates/classes/debug app_packages".split()
    }
}

It's supposed to build the app and send it to my phone, which is connected to my computer with og cable, and USB debugging on. This is the error i am getting:

> Task :buildPythonDebug FAILED
Traceback (most recent call last):
  File "C:\Users\bart\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\bart\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\bart\AppData\Local\Programs\Python\Python37-32\Scripts\voc.exe\__main__.py", line 2, in <module>
  File "C:\Users\bart\AppData\Local\Programs\Python\Python36\lib\re.py", line 123, in <module>
    import sre_compile
  File "C:\Users\bart\AppData\Local\Programs\Python\Python36\lib\sre_compile.py", line 17, in <module>
    assert _sre.MAGIC == MAGIC, "SRE module mismatch"
AssertionError: SRE module mismatch

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\bart\PycharmProjects\untitled1\helloworld\android\build.gradle' line: 13

* What went wrong:
Execution failed for task ':buildPythonDebug'.
> Process 'command 'voc'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.7/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2s
16 actionable tasks: 1 executed, 15 up-to-date
    $ adb logcat Python:* *:E

App started.

https://github.com/Tiebe/dedruppel

Wolfgang Fahl
  • 15,016
  • 11
  • 93
  • 186
  • Possible duplicate of [whats does assert \_sre.MAGIC == MAGIC, SRE module mismatch AssertionError: SRE module mismatch error mean?](https://stackoverflow.com/questions/53600426/whats-does-assert-sre-magic-magic-sre-module-mismatch-assertionerror-sre-m) – MatsLindh Jun 27 '19 at 12:39

1 Answers1

3

You're running voc from Python3.7 (Programs\Python\Python37-32\Scripts\voc.exe), but your interpreter is using the libraries from python 3.6 (Python\Python36\lib\re.py).

MatsLindh
  • 49,529
  • 4
  • 53
  • 84
  • How would I change it? I need to use python 3.6 – Tiebe Groosman Jun 27 '19 at 15:41
  • 1
    That's hard to say without knowing the configuration of your environment - which version of python starts if you do just `python`? Make sure that cookiecutter installs items from the template into the correct directory, or run `pip install voc` manually when you have the 3.6 installation as your active interpreter. You could also remove the 3.7 directory and remove the directory from your path. – MatsLindh Jun 27 '19 at 16:20
  • I'm using pycharm, and set the venv to p3.6 – Tiebe Groosman Jun 27 '19 at 16:21
  • 1
    Make sure you've installed the required dependencies with 3.6 - and that 3.6 is first in the dependency path when `voc` is being invoked. The cookiecutter template may have discovered a different `voc` installation as well - I'd trace the call or put a breakpoint at the location where voc is invoked to see how it determines its path. – MatsLindh Jun 27 '19 at 16:23
  • Thanks. I just uninstalled Python 3.7 and that worked :) – Tiebe Groosman Jun 28 '19 at 05:36