-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 #2790
Comments
Hi @petaflot ! Can you please share the full log? PS: Moved the issue to |
Do you have a JDK installed in a standard path? If not, can you please try to set the |
I have tried with the following ebuilds:
I am using a venv under which my app works just fine. |
at the moment, I am not sure whether this is a problem with python-for-android or the distro (Gentoo, unlikely). Maybe there is another test you can suggest? I really despise java and try to get as far as possible from it. |
Me too, but the resolution is probably going to involve doing the opposite. I see at the from
Mine (Ubuntu) looks like this, and is an executable
Yours looks like it is finding the Gentoo (specific?) tool I wonder if Gentoo Java VM needs to be configured? See https://wiki.gentoo.org/wiki/Java
Please show me the log line following |
indeed, user-vm was not set. I didn't know there was also a per-user setting.
at this point buildozer sort-of frozed, with no noticeable CPU or MEM usage ; after a few minutes I slapped it with a KeyboardInterrupt :
trying again, just to see
same thing, except for the missing Trying with other VM:
Setting the java-vm to openjdk-17 produces the same result as the first run. I will try with |
Well that is a step forward. And I think the first test case was the correct one.
cc: @misl6 |
I took another look at this and I suspect this is a different issue unrelated to Java. It appears that p4a hangs on startup waiting for stdout. I have never seen this so I assume something site local is the issue.
|
I exactly suspect the same. I searched into organization issues for something similar, but I did not find anything. |
Oh uh. Something I failed to mention anywhere somehow is that the JAVA_HOME detection heuristics aren't ideal ; since Gentoo uses a custom script to start Java, detecting a symlink won't be enough ; what I did here is this: cheaterman@cmans-laptop ~ $ which javac
/home/cheaterman/.local/bin/javac
cheaterman@cmans-laptop ~ $ ls -l $(which javac)
lrwxrwxrwx 1 cheaterman cheaterman 29 25 avril 19:04 /home/cheaterman/.local/bin/javac -> /opt/openjdk-bin-17/bin/javac Basically manually symlinking |
@RobertFlatt , can you give me a link to the hello world example? to make sure I really try with the expected thing. |
It seems
explains this
My working assumption is we have fixed the Java issue by initializing the OS Java configuration. For the second issue try Hello World, see last paragraph here https://github.com/Android-for-Python/Android-for-Python-Users#install |
That is cool so far. Code for "hello world" kivy example makes total sense, now comes the issue with the buildozer config which does not seem so obvious. Please bear with me, I am not trying to be lazy - quite the opposite in fact, or I would not be coding at all XD - but really trying to make sure we are all dealing with the same "initial conditions". IMHO it would be good to have a "hello world" repo that can be cloned. |
ok, so I did just that https://github.com/petaflot/buildozer_helloworld, to make sure we are on the same level.
I'll stop here, because I mentioned this earlier and it seems it went unnoticed : how come I get something that looks like one of the very first commands failed and returns it's |
apologies for that immensely stupid comment. my brain must have skipped a beat reading the doc. |
FIY: I asked a friend of mine (ubuntu user) to try and build the hello world example as per https://github.com/petaflot/buildozer_helloworld (complete with buildozer conf), this also fails. here is the end of the build log:
Note: I'm pretty darn sure he installed cython after it failed the first time. |
Of course I can't vouch for the validity of some random repository, specially when it contains comments like "This is WIP : just started, no guarantee to work". And in a similar fashion I cannot be "darn sure" about the behavior of your friend. Messages in the log we can perhaps agree on. The log above contains: https://github.com/Android-for-Python/Android-for-Python-Users#ssl-module-in-python-is-not-available This means one of the the install dependencies is missing, which makes pip unable to find Cython. As it says in that link the fix is to install all the dependencies (in case more than one was missed). Everything you need to know to build Hello World is here https://github.com/Android-for-Python/Android-for-Python-Users#install |
@RobertFlatt it is not just "some random repository", it is a repository I created SPECIFICALLY for this purpose according to the doc I was given IN THIS EXACT THREAD. I just added some extra stuff like a README.md for future purposes (such as compiling for iOS), but please take a few seconds to read the code before making such comments. my friend is labelled by many as an "übergeek", he built a computer-controlled robot when he was 12 (he was born 1977) out of spare parts, and you would probably be amazed at what he can do now (current project is a double-output EV charger that will do load-balancing with domestic appliances). He as been an Internet provider for years https://saitis.net/ and built his own company, https://nimag.net/ by working in a paid job for just two days a week, he has 2 houses and a 300m³ workshop. He does low level electronics, refrigeration, works with OpenCV and other stuff, http://lama.pas.nu/, was recently asked for counseling to make electric airplanes... do I need to write more? He's the kind of guy who is going to create inodes for obsolete touch screens, you name it. When I told him about buildozer, he was VERY enthousiastic about being able to build some APKs, but just as disappointed that it did not work as expected. I am personally deep into some legal lawsuit that is just about ruining my life because my father and my older sister have been [can't comment], being able to build an app would be massively useful and I don't really have the time to try everything again and again in every way possible. |
btw, a 300m² workshop in Switzerland costs something like 7k$/month. FYI, the app I am writing compiles fine with github workflows, too. it's just a pain in the. |
simply because THE CURRENT ISSUE is still open. what's so strange and/or wrong about that? |
I hear your pain, but most it it is not something I have any control over. If you have a specific technical question about Buildozer/p4a, ask in a clear way and share a log, I will try to point you in what I think is the right direction. |
my question is: starting "from scratch" (with a x86_64 CPU, some RAM and a blank HDD), how to get buildozer to compile an example "hello world" app such as the one here https://github.com/petaflot/buildozer_helloworld that - as stated earlier, was setup for the exact purpose of solving the current issue and is at the moment nothing more than
and finally
thank you. |
Assuming you have a Linux machine: As is says here https://github.com/Android-for-Python/Android-for-Python-Users#install
And if buildozer fails to compile https://github.com/Android-for-Python/Android-for-Python-Users#if-buildozer-fails-to-compile If there is an issue we work from the message in the log. |
please state distribution, version, packages installed. I will try in a virtualbox machine. thank you. |
There are lost of choices, but Ubuntu 22.04 is good. If you have a modern Windows machine you can use WSL. |
I have a similar problem. requirements and .spec Can someone suggest what to do. Found a more or less relevant thread here. It seems that I checked the packages and files, but it did not help. I rebuilt the project and the environment 3 times according to the documentation. All three times the same. obviously I'm missing something, something very stupid and simple. STDOUT: Error compiling Cython file:... include "jnius_compat.pxi"
|
This whole thing belongs in a support channel. It appears to be configuration issues. If you come up with a specific bug that needs to be fixed by the p4a team, please come back here. |
a re-open of kivy/buildozer#1388 because it's not fixed ; was closed because comments point to other issues which point back to kivy/buildozer#1388
Versions
Description
I expect buildozer to compile the app
buildozer.spec
Command:
Spec file:
Logs
note: $JAVA_HOME = /etc/java-config-2/current-system-vm/
this is strong evidence that the call to toolchain.py is erroneous!
down below in the log, we get:
The text was updated successfully, but these errors were encountered: