buildozer wont generate apk if "pillow" is in the requirements

147 views
Skip to first unread message

Claver Barreto

unread,
Jan 31, 2023, 6:24:33 AM1/31/23
to Kivy users support
Hello. So i have this problem where i tried to generate an apk with buildozer but it was giving me this error:

checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... Android linker
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
checking for x86_64-pc-linux-gnu-gcc... no
checking for gcc... gcc
checking for gcc... (cached) gcc
checking for suffix of native executables... ld: error: unknown argument '--no-add-needed'
collect2: error: ld returned 1 exit status
configure: error: native C compiler is not working
make: *** [builds/unix/detect.mk:91: setup] Error 1

so as it says C compiler is not working" i thought it was something with my gcc, but i tried to use buildozer in a simpler program, a kivy hello world, and it worked. So i was pretty sure the problem was in the requirements, so i started experimenting on it by removing the requirements i've put and see if it was working. So i've noticed this problem would only appear if I put "pillow" in the requirements.

Now, dont know if this problem is regarding pillow, buildozer or kivy itself. And i cannot use another image provider because i have some ".gif" images in the app and it only shows if i use pillow.

here is the requirement part of the buildozer_spec:
# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,kivy==2.1.0,kivymd==1.1.1,ffpyplayer,pillow

I how you guys can help me with this or show me the right direction. sorry for the long text. and thank you for reading.

Robert

unread,
Jan 31, 2023, 12:27:27 PM1/31/23
to Kivy users support
The issue is not pillow, everybody uses that all the time, and I just checked it works.
Also the issue is not gcc, because Pillow is compiled with Clang from the Android NDK (though messages from some packages say gcc)

This appears to be the issue, which suggests some install issue, I have no idea what.
 > ld: error: unknown argument '--no-add-needed' 

Recheck the Buildozer install dependencies https://github.com/kivy/buildozer/blob/master/docs/source/installation.rst#android-on-ubuntu-2004-and-2204-64bit

If you still have an issue 'buildozer appclean' then build again and post the full log as a .txt file

Claver Barreto

unread,
Jan 31, 2023, 1:17:26 PM1/31/23
to Kivy users support
hello mate, thanks for the answer, i'll check Buildozer's dependencies and see if it works, i'll post the full log if i run into issues again. thanks.

Claver Barreto

unread,
Feb 8, 2023, 12:40:39 PM2/8/23
to Kivy users support
ok after several experiments and help from reddit users, i found out that the problem is regarding something called "toolchains" and LLVM, fedora and some other distros have the most up to date toolchains which is a problem, so i've tried to use fedora 36 but the result was the same which i found it strange, for my last successful build was made with fedora 36.
So i tried to downgrade the toolchains itself and LLVM however i found out that you cant, atleast not with fedora. So the solution for me ultimately was to use another Distro, the build process works in ubuntu, arch and opensuse, so i've installed Arch Linux.
Ok thats it for this problem and my solution to it. If you dont want to use another Distro, you could use a Virtual Machine with ubuntu or something. 

Robert

unread,
Feb 8, 2023, 4:40:43 PM2/8/23
to Kivy users support
Thanks for the follow up.
FYI the toolchains (clang, llvm, etc) are downloaded by Buildozer (into ~/.buildozer) from Google. 
Also some libs are required and listed in the Buildozer install dependencies.

I have no Fedora experience, so I can't comment on yours.

Claver Barreto

unread,
Feb 8, 2023, 5:57:22 PM2/8/23
to kivy-...@googlegroups.com
From what I've gathered, since fedora comes with the toolchains by default, buildozer finds it during the process and doesn't download, instead, it uses the one's already in the system, however, since the versions of the toolchain's packages are not the ones buildozer requires, it gives out that error, now I could be wrong on this, but that's the explanation I came up with after experimenting and reading.
I've read that in fedora these packages are read only and so cannot be downgraded and I've tried several attempts these days, for now I'm using Arch linux and I'm just glad I can build my app again. 
Thanks for the help mate.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/81f903f2-21ea-4850-8b1c-78b97c623332n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages