Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling Cython file: "config.pxi" and "JNIUS_PYTHON3" not found #1388

Closed
BobBrown1 opened this issue Dec 28, 2021 · 2 comments
Closed

Comments

@BobBrown1
Copy link

I am running my Kivy app and trying to package it with Buildozer. I am using the default buildozer.spec. I also have Cython, Pyjnius, and python-for-android installed. This is my error:

Error compiling Cython file:
------------------------------------------------------------
...
import sys
import traceback

include "jnius_compat.pxi"
include "jni.pxi"
include "config.pxi"
^
------------------------------------------------------------

jnius/jnius.pyx:100:0: 'config.pxi' not found

Error compiling Cython file:
------------------------------------------------------------
...

include "jnius_compat.pxi"
include "jni.pxi"
include "config.pxi"

IF JNIUS_PLATFORM == "android":
  ^
------------------------------------------------------------

jnius/jnius.pyx:102:3: Compile-time name 'JNIUS_PLATFORM' not defined

Error compiling Cython file:
------------------------------------------------------------
...
include "jni.pxi"
include "config.pxi"

IF JNIUS_PLATFORM == "android":
    include "jnius_jvm_android.pxi"
ELIF JNIUS_PLATFORM == "win32":
    ^
------------------------------------------------------------

jnius/jnius.pyx:104:5: Compile-time name 'JNIUS_PLATFORM' not defined

Error compiling Cython file:
------------------------------------------------------------
...
include "config.pxi"
^
------------------------------------------------------------

jnius/jnius_jvm_dlopen.pxi:1:0: 'config.pxi' not found

Error compiling Cython file:
------------------------------------------------------------
...
    JAVA_HOME = os.getenv('JAVA_HOME') or find_java_home()
    if JAVA_HOME is None or JAVA_HOME == '':
        raise SystemError("JAVA_HOME is not set, and unable to guess JAVA_HOME")
    cdef str JNIUS_LIB_SUFFIX = get_jnius_lib_location(JNIUS_PLATFORM)

    IF JNIUS_PYTHON3:
      ^
------------------------------------------------------------

jnius/jnius_jvm_dlopen.pxi:89:7: Compile-time name 'JNIUS_PYTHON3' not defined

Error compiling Cython file:
------------------------------------------------------------
...

include "jnius_env.pxi"
include "jnius_utils.pxi"
include "jnius_conversion.pxi"
include "jnius_localref.pxi"
IF JNIUS_PYTHON3:
  ^
------------------------------------------------------------

jnius/jnius.pyx:113:3: Compile-time name 'JNIUS_PYTHON3' not defined

@RobertFlatt
Copy link
Contributor

This is something site specific. Hard to guess what.

config.pxi is created when pyjnius is installed https://github.com/kivy/pyjnius/blob/master/setup.py#L96-L99 So there is a Pyjnius install issue. But why?

Buildozer installs its own copy of Pyjnius (p4a too), these are not required as part of a local install https://github.com/kivy/buildozer/blob/master/docs/source/installation.rst

Two things to try:
Look further up the log for an issue.
Check the installed JDK version.

This forum is for development issues.
Any followup should be directed the user forum https://discord.gg/hyEcfnqx

@BobBrown1
Copy link
Author

Alright, I'll ask in the discord then. Thanks for the info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants