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

Pillow's recipe problem in aab generation #2497

Closed
mmsprojects opened this issue Sep 26, 2021 · 19 comments
Closed

Pillow's recipe problem in aab generation #2497

mmsprojects opened this issue Sep 26, 2021 · 19 comments

Comments

@mmsprojects
Copy link

Hi, in first I'd thank you all for the development of this tool and @misl6 for the recent implementation about .aab package! I tried and had success building the aab file from @misl6 p4a's and buildozer's branch.

But I only could get success by removing the Pillow from the requirements of buildozer.spec. I thing there's something with Pillow recipe or I'm doing wrong the implementation. I'm passed the bug related by @Guhan-SenSam about opencv.

I'm using Kivymd and it kind of depends of pillow.
''''
[INFO]: <- directory context /home/ros/APP_MD_ADS/python-for-android
[INFO]: Building Pillow for armeabi-v7a
[INFO]: Pillow apparently isn't already in site-packages
[INFO]: Building compiled components in Pillow
[WARNING]: ndk_platform is deprecated and should be avoided in new recipes
[INFO]: -> directory context /home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/Pillow/armeabi-v7a__ndk_target_21/Pillow
[DEBUG]: -> running python3 setup.py build_ext -v
[DEBUG]: running build_ext
[DEBUG]: building 'PIL._imaging' extension
[DEBUG]: creating build
[DEBUG]: building 'PIL._imagingft' extension
[DEBUG]: building 'PIL.imagingmath' extension
[DEBUG]: building 'PIL.imagingmorph' extension
[DEBUG]: creating build/temp.linux-x86_64-3.8
[DEBUG]: creating build/temp.linux-x86_64-3.8
[DEBUG]: creating build/temp.linux-x86_64-3.8
[DEBUG]: creating build/temp.linux-x86_64-3.8/src
[DEBUG]: creating build/temp.linux-x86_64-3.8/src
[DEBUG]: /home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/png/armeabi-v7a__ndk_target_21/png -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/harfbuzz-freetype/armeabi-v7a__ndk_target_21/harfbuzz -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/harfbuzz-freetype/armeabi-v7a__ndk_target_21/harfbuzz/src -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/freetype/armeabi-v7a__ndk_target_21/freetype/include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/jpeg/armeabi-v7a__ndk_target_21/jpeg -I/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -lm -DANDROID -D__ANDROID_API
=21 -I/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/gastospessoais/armeabi-v7a/include/python3.8 -fPIC -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/Pillow/armeabi-v7a__ndk_target_21/Pillow/src/libImaging -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/jpeg/armeabi-v7a__ndk_target_21/jpeg -I/usr/include/openjpeg-2.3 -I/usr/include/x86_64-linux-gnu -I/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/freetype/armeabi-v7a__ndk_target_21/freetype/include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/png/armeabi-v7a__ndk_target_21/png -I/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi -I/usr/local/include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build -c src/imagingmath.c -o build/temp.linux-x86_64-3.8/src/imagingmath.o
[DEBUG]: /home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/png/armeabi-v7a__ndk_target_21/png -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/harfbuzz-freetype/armeabi-v7a__ndk_target_21/harfbuzz -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/harfbuzz-freetype/armeabi-v7a__ndk_target_21/harfbuzz/src -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/freetype/armeabi-v7a__ndk_target_21/freetype/include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/jpeg/armeabi-v7a__ndk_target_21/jpeg -I/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -lm -DANDROID -D__ANDROID_API
=21 -I/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/gastospessoais/armeabi-v7a/include/python3.8 -fPIC -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/Pillow/armeabi-v7a__ndk_target_21/Pillow/src/libImaging -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/jpeg/armeabi-v7a__ndk_target_21/jpeg -I/usr/include/openjpeg-2.3 -I/usr/include/x86_64-linux-gnu -I/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/freetype/armeabi-v7a__ndk_target_21/freetype/include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/png/armeabi-v7a__ndk_target_21/png -I/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi -I/usr/local/include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build -c src/imagingft.c -o build/temp.linux-x86_64-3.8/src/imagingft.o
[DEBUG]: /home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/png/armeabi-v7a__ndk_target_21/png -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/harfbuzz-freetype/armeabi-v7a__ndk_target_21/harfbuzz -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/harfbuzz-freetype/armeabi-v7a__ndk_target_21/harfbuzz/src -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/freetype/armeabi-v7a__ndk_target_21/freetype/include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/jpeg/armeabi-v7a__ndk_target_21/jpeg -I/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -lm -DANDROID -D__ANDROID_API
=21 -I/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/gastospessoais/armeabi-v7a/include/python3.8 -fPIC -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/Pillow/armeabi-v7a__ndk_target_21/Pillow/src/libImaging -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/jpeg/armeabi-v7a__ndk_target_21/jpeg -I/usr/include/openjpeg-2.3 -I/usr/include/x86_64-linux-gnu -I/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/freetype/armeabi-v7a__ndk_target_21/freetype/include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/png/armeabi-v7a__ndk_target_21/png -I/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi -I/usr/local/include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build -c src/imagingmorph.c -o build/temp.linux-x86_64-3.8/src/imagingmorph.o
[DEBUG]: creating build/temp.linux-x86_64-3.8/src/libImaging
[DEBUG]: /home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/png/armeabi-v7a__ndk_target_21/png -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/harfbuzz-freetype/armeabi-v7a__ndk_target_21/harfbuzz -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/harfbuzz-freetype/armeabi-v7a__ndk_target_21/harfbuzz/src -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/freetype/armeabi-v7a__ndk_target_21/freetype/include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/jpeg/armeabi-v7a__ndk_target_21/jpeg -I/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -lm -DANDROID -D__ANDROID_API
=21 -I/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/gastospessoais/armeabi-v7a/include/python3.8 -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DPILLOW_VERSION="7.0.0" -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/Pillow/armeabi-v7a__ndk_target_21/Pillow/src/libImaging -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/jpeg/armeabi-v7a__ndk_target_21/jpeg -I/usr/include/openjpeg-2.3 -I/usr/include/x86_64-linux-gnu -I/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/freetype/armeabi-v7a__ndk_target_21/freetype/include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/png/armeabi-v7a__ndk_target_21/png -I/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi -I/usr/local/include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build -c src/_imaging.c -o build/temp.linux-x86_64-3.8/src/_imaging.o
[DEBUG]: clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
[DEBUG]: clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
[DEBUG]: clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
[DEBUG]: clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
[DEBUG]: In file included from src/_imagingmath.c:16:
[DEBUG]: In file included from /home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include/Python.h:11:
[DEBUG]: In file included from /home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.2/include/limits.h:37:
[DEBUG]: In file included from /home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/limits.h:38:
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:41:6: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: # if __GNUC_PREREQ (4, 6) && !defined _LIBC
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:54:30: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: # if !defined __cplusplus && __GNUC_PREREQ (3, 3)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:60:30: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: # if defined __cplusplus && __GNUC_PREREQ (2,8)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:126:5: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: #if __GNUC_PREREQ (4,3)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:207:5: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: #if __GNUC_PREREQ (2,96)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:215:5: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: #if __GNUC_PREREQ (4, 3)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:225:5: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: #if __GNUC_PREREQ (2,96)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:232:5: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: #if __GNUC_PREREQ (2,5)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:241:5: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: #if __GNUC_PREREQ (3,1)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:250:5: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: #if __GNUC_PREREQ (3,2)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:259:5: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: #if __GNUC_PREREQ (4,5)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:273:5: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is In file included from notsrc/_imagingmorph.c :defined14
[DEBUG]: :
[DEBUG]: In file included from /home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include/Python.h:11:
[DEBUG]: In file included from /home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.2/include/limits.h#if __GNUC_PREREQ (2,8):
[DEBUG]: 37 ^:
[DEBUG]:
[DEBUG]: In file included from /home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/limits.h:/usr/include/x86_64-linux-gnu/sys/cdefs.h38:283:
[DEBUG]: :/usr/include/x86_64-linux-gnu/sys/cdefs.h5::41 :error6: :function-like errormacro:
[DEBUG]: function-like '__GNUC_PREREQ'macro
[DEBUG]: is '__GNUC_PREREQ'not isdefined
[DEBUG]: not defined
[DEBUG]: #if __GNUC_PREREQ (2,97)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:292:5: error: # if __GNUC_PREREQ (4, 6) && !defined _LIBCfunction-like
[DEBUG]: ^macro
[DEBUG]:
[DEBUG]: '__GNUC_PREREQ' is not /usr/include/x86_64-linux-gnu/sys/cdefs.hdefined:
[DEBUG]: 54:30: error#if __GNUC_PREREQ (3,3):
[DEBUG]: function-like ^
[DEBUG]: macro
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h'__GNUC_PREREQ': 300is: 5not: definederror
[DEBUG]: : function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: # if !defined __cplusplus && __GNUC_PREREQ (3, 3)
[DEBUG]: ^
[DEBUG]: #if __GNUC_PREREQ (3,4)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:60/usr/include/x86_64-linux-gnu/sys/cdefs.h::30314:: 5error:: function-likeerror : macrofunction-like
[DEBUG]: macro'__GNUC_PREREQ'
[DEBUG]: is'__GNUC_PREREQ' notis definednot
[DEBUG]: defined
[DEBUG]: #if __GNUC_PREREQ (3,2)
[DEBUG]: ^
[DEBUG]: # if defined __cplusplus && __GNUC_PREREQ (2,8)
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h ^:
[DEBUG]: 327:5: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:#if __GNUC_PREREQ (4,3)126
[DEBUG]: : ^5
[DEBUG]: : error: /usr/include/x86_64-linux-gnu/sys/cdefs.hfunction-like: 342macro:
[DEBUG]: 30 :'__GNUC_PREREQ' erroris: function-likenot macrodefined
[DEBUG]:
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: #if __GNUC_PREREQ (4,3)
[DEBUG]: ^
[DEBUG]: #if (!defined __cplusplus || __GNUC_PREREQ (4,3)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:361:5: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is/usr/include/x86_64-linux-gnu/sys/cdefs.h :not207 :defined5
[DEBUG]: : error: function-like macro#if __GNUC_PREREQ (4,3)
[DEBUG]:
[DEBUG]: ^'__GNUC_PREREQ'
[DEBUG]: is notfatal error In file included from : src/_imagingft.cdefined:too
[DEBUG]: 22 :
[DEBUG]: manyIn file included from /home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include/Python.herrors: 11emitted,:
[DEBUG]: In file included from #if __GNUC_PREREQ (2,96)stopping/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.2/include/limits.h
[DEBUG]: : ^now37
[DEBUG]: :
[DEBUG]: [-ferror-limit=]In file included from
[DEBUG]: /home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/limits.h/usr/include/x86_64-linux-gnu/sys/cdefs.h::38215:
[DEBUG]: :/usr/include/x86_64-linux-gnu/sys/cdefs.h5::41 :error6: :function-like errormacro:
[DEBUG]: function-like '__GNUC_PREREQ'macro
[DEBUG]: is '__GNUC_PREREQ'not isdefined
[DEBUG]: not defined
[DEBUG]: #if __GNUC_PREREQ (4, 3)
[DEBUG]: ^
[DEBUG]: # if __GNUC_PREREQ (4, 6) && !defined _LIBC
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:54:30: error: function-like/usr/include/x86_64-linux-gnu/sys/cdefs.h :macro225
[DEBUG]: : 5'__GNUC_PREREQ': iserror : notfunction-like definedmacro
[DEBUG]:
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: # if !defined __cplusplus && __GNUC_PREREQ (3, 3)
[DEBUG]: ^
[DEBUG]: #if __GNUC_PREREQ (2,96)
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h ^:
[DEBUG]: 60:30: error/usr/include/x86_64-linux-gnu/sys/cdefs.h: :function-like232 :macro5
[DEBUG]: : '__GNUC_PREREQ'error : isfunction-like notmacro
[DEBUG]: defined
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: #if __GNUC_PREREQ (2,5)# if defined __cplusplus && __GNUC_PREREQ (2,8)
[DEBUG]:
[DEBUG]: ^ ^
[DEBUG]:
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:241:5: error: function-like macro
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h'__GNUC_PREREQ': 126is: 5not: definederror
[DEBUG]: : function-like macro
[DEBUG]: '__GNUC_PREREQ'#if __GNUC_PREREQ (3,1)
[DEBUG]: is ^
[DEBUG]: not defined/usr/include/x86_64-linux-gnu/sys/cdefs.h
[DEBUG]: :250:5:#if __GNUC_PREREQ (4,3)
[DEBUG]: error ^:
[DEBUG]: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h#if __GNUC_PREREQ (3,2):
[DEBUG]: 207 ^:
[DEBUG]: 5: error: function-like/usr/include/x86_64-linux-gnu/sys/cdefs.h :macro259
[DEBUG]: : 5'__GNUC_PREREQ': iserror : notfunction-like definedmacro
[DEBUG]:
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: #if __GNUC_PREREQ (2,96)
[DEBUG]: ^
[DEBUG]: #if __GNUC_PREREQ (4,5)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:273:5: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' /usr/include/x86_64-linux-gnu/sys/cdefs.his: 215not: 5defined:
[DEBUG]: error: function-like macro
[DEBUG]: #if __GNUC_PREREQ (2,8)
[DEBUG]: '__GNUC_PREREQ' ^
[DEBUG]: is not/usr/include/x86_64-linux-gnu/sys/cdefs.h :defined283
[DEBUG]: :5: error: function-like #if __GNUC_PREREQ (4, 3)macro
[DEBUG]:
[DEBUG]: ^
[DEBUG]: '__GNUC_PREREQ' is not/usr/include/x86_64-linux-gnu/sys/cdefs.h :defined225
[DEBUG]: :5: error: function-like#if __GNUC_PREREQ (2,97)
[DEBUG]: macro ^
[DEBUG]:
[DEBUG]: '__GNUC_PREREQ' /usr/include/x86_64-linux-gnu/sys/cdefs.his: 292not: 5defined:
[DEBUG]: error: function-like macro#if __GNUC_PREREQ (2,96)
[DEBUG]:
[DEBUG]: ^'__GNUC_PREREQ'
[DEBUG]: is /usr/include/x86_64-linux-gnu/sys/cdefs.hnot: 232defined:
[DEBUG]: 5: error: function-like macro
[DEBUG]: #if __GNUC_PREREQ (3,3)
[DEBUG]: '__GNUC_PREREQ' ^
[DEBUG]: is not/usr/include/x86_64-linux-gnu/sys/cdefs.h :defined300
[DEBUG]: :5: error: function-like#if __GNUC_PREREQ (2,5)
[DEBUG]: macro ^
[DEBUG]:
[DEBUG]: '__GNUC_PREREQ' /usr/include/x86_64-linux-gnu/sys/cdefs.his: 241not: 5defined:
[DEBUG]: error: function-like macro
[DEBUG]: #if __GNUC_PREREQ (3,4)'__GNUC_PREREQ'
[DEBUG]: ^is
[DEBUG]: not defined
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:314:5:#if __GNUC_PREREQ (3,1)
[DEBUG]: error ^:
[DEBUG]: function-like macro/usr/include/x86_64-linux-gnu/sys/cdefs.h
[DEBUG]: : 250'__GNUC_PREREQ': 5is: noterror : definedfunction-like
[DEBUG]: macro
[DEBUG]: '__GNUC_PREREQ' is not #if __GNUC_PREREQ (3,2)defined
[DEBUG]:
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h#if __GNUC_PREREQ (3,2):
[DEBUG]: 327 ^:
[DEBUG]: 5:/usr/include/x86_64-linux-gnu/sys/cdefs.h :error259: :function-like5 :macro
[DEBUG]: error : '__GNUC_PREREQ'function-like ismacro
[DEBUG]: not '__GNUC_PREREQ'defined
[DEBUG]: is not defined
[DEBUG]: #if __GNUC_PREREQ (4,3)
[DEBUG]: ^
[DEBUG]: #if __GNUC_PREREQ (4,5) /usr/include/x86_64-linux-gnu/sys/cdefs.h
[DEBUG]: : ^342
[DEBUG]: :30: /usr/include/x86_64-linux-gnu/sys/cdefs.herror:: 273function-like: 5macro:
[DEBUG]: error'__GNUC_PREREQ': function-likeis macronot
[DEBUG]: defined'__GNUC_PREREQ'
[DEBUG]: is not defined
[DEBUG]: #if (!defined __cplusplus || __GNUC_PREREQ (4,3) #if __GNUC_PREREQ (2,8)
[DEBUG]:
[DEBUG]: ^ ^
[DEBUG]:
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:283:/usr/include/x86_64-linux-gnu/sys/cdefs.h5:: 361error:: 5function-like: macroerror
[DEBUG]: : function-like'__GNUC_PREREQ' macrois
[DEBUG]: not'__GNUC_PREREQ' definedis
[DEBUG]: not defined
[DEBUG]: #if __GNUC_PREREQ (2,97)
[DEBUG]: ^
[DEBUG]: #if __GNUC_PREREQ (4,3)
[DEBUG]: ^/usr/include/x86_64-linux-gnu/sys/cdefs.h
[DEBUG]: :292:5fatal error:: tooerror : manyfunction-like errorsmacro
[DEBUG]: emitted, '__GNUC_PREREQ'stopping isnow not[-ferror-limit=]
[DEBUG]: defined
[DEBUG]: #if __GNUC_PREREQ (3,3)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:300:5: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: #if __GNUC_PREREQ (3,4)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:314:5: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: #if __GNUC_PREREQ (3,2)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:327:5: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: #if __GNUC_PREREQ (4,3)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:342:30: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: #if (!defined __cplusplus || __GNUC_PREREQ (4,3)
[DEBUG]: ^
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:361:5: error: function-like macro
[DEBUG]: '__GNUC_PREREQ' is not defined
[DEBUG]: #if __GNUC_PREREQ (4,3)
[DEBUG]: ^
[DEBUG]: fatal error: too many errors emitted, stopping now [-ferror-limit=]
[DEBUG]: In file included from src/_imaging.c:75:
[DEBUG]: In file included from /home/ros/APP_MD_ADS/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include/Python.h:11:
[DEBUG]: In file included from /home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.2/include/limits.h:37:
[DEBUG]: In file included from /home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/limits.h:38:
[DEBUG]: /usr/include/x86_64-linux-gnu/sys/cdefs.h:41:6: error: function-like macro'''

... repeats it recursively ...

At the end :
'''
usr/include/x86_64-linux-gnu/sys/cdefs.h:361:5: error: function-like macro
'__GNUC_PREREQ' is not defined
#if __GNUC_PREREQ (4,3)
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2020 error errorss generated generated.
.
20 errors generated.
20 errors generated.
error: command '/home/ros/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit status 1

'''

If I remove Pillow recipe in buildozer.spec the compilation finished like a charm but with the app probably broken.

Some buildozer configs:
android.api = 30
android.minapi = 21
android.sdk = 20
android.ndk = 19c

Thanks.

Originally posted by @mmsprojects in #2467 (comment)

@buybuyxyz
Copy link

buybuyxyz commented Oct 14, 2021

I got same error.

#*** investigation1
Master version enable compile Pillow. but Develop version get the error.
So I tried to find out what changed in master version and develop version.

git diff origin/master pythonforandroid/recipes/Pillow/init.py`

`
--- a/pythonforandroid/recipes/Pillow/init.py
+++ b/pythonforandroid/recipes/Pillow/init.py
@@ -35,9 +35,9 @@ class PillowRecipe(CompiledComponentsPythonRecipe):
def get_recipe_env(self, arch=None, with_flags_in_cc=True):
env = super().get_recipe_env(arch, with_flags_in_cc)

  •    env['ANDROID_ROOT'] = join(self.ctx.ndk_platform, 'usr')
    
  •    ndk_lib_dir = join(self.ctx.ndk_platform, 'usr', 'lib')
    
  •    ndk_include_dir = join(self.ctx.ndk_dir, 'sysroot', 'usr', 'include')
    
  •    env['ANDROID_ROOT'] = join(arch.ndk_platform, 'usr')
    
  •    ndk_lib_dir = arch.ndk_lib_dir
    
  •    ndk_include_dir = self.ctx.ndk_include_dir
    
       png = self.get_recipe('png', self.ctx)
       png_lib_dir = join(png.get_build_dir(arch.arch), '.libs')
    

`
#*** investigation2
I added a print statements and examined the contents of these three variables.
(ndk:19c, taget:arm64-v8a)

`
/home/youtube/.buildozer/android/platform/android-ndk-r19c/platforms/android-21/arch-arm64/usr

/home/youtube/.buildozer/android/platform/android-ndk-r19c/platforms/android-21/arch-arm64/usr/lib

/home/youtube/.buildozer/android/platform/android-ndk-r19c/sysroot/usr/include
`

On the other hand, in the development version, it was as follows.

`
/home/youtube/.buildozer/android/platform/android-ndk-r19c/platforms/android-21/arch-arm64/usr

/home/youtube/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/21

/home/youtube/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include
`

I changed the include directory to the value of the master version and the compilation succeeded, but it didn't work.

#*** I have succeeded in creating a single CPU aab file in the following way.

1)Copy the Pillow binary files created with the master version to the project source directory
cp -r masterProjectDirectory/.buildozer/android/platform/build-arm64-v8a/build/other_builds/Pillow/arm64v8a__ndk_target_21/Pillow/build/lib.linux-x86_64-3.8/PIL targetProjectDirectory/
2)Removed Pillow from requirements in buildozer.spec
3)Create aab with buildozer and python-for-android
buildozer android release
4)Check for missing packages with adb logcat and add them.

@misl6 misl6 self-assigned this Oct 14, 2021
@HeaTTheatR
Copy link

HeaTTheatR commented Oct 14, 2021

Same error...
But the Pillow package does not compile even when building the APK of the package.

@misl6
Copy link
Member

misl6 commented Oct 14, 2021

I tested it on a clean CI environment and it's building without any issue.
Can you all please share a full log + development environment details, so I can examine what's different?

@HeaTTheatR
Copy link

@misl6 Yes, tomorrow morning I'll do it ...

@buybuyxyz
Copy link

I would like to know how to compile Pillow with develop version.
Could you tell me how to do it?
(I could not compile with Ubuntu 20.04, buildozer develop and p4a deveop version)

@kengoon
Copy link
Contributor

kengoon commented Oct 20, 2021

changing line 39 and 40 in Pillow recipe init.py file from

ndk_lib_dir = arch.ndk_lib_dir
ndk_include_dir = self.ctx.ndk_include_dir

to

ndk_lib_dir = join(arch.ndk_platform, 'usr', 'lib')
ndk_include_dir = join(self.ctx.ndk_dir, 'sysroot', 'usr', 'include')

fixed the whole issue for me

@buybuyxyz
Copy link

buybuyxyz commented Oct 21, 2021

Thank you very much for your help.
I'll try it!

I can compile with the patch, but It does not work. It was crash.

env['ANDROID_ROOT']
/home/youtube/Android/SDK/ndk/19.2.5345600/platforms/android-21/arch-arm64/usr
ndk_lib_dir
/home/youtube/Android/SDK/ndk/19.2.5345600/platforms/android-21/arch-arm64/usr/lib
ndk_include_dir
/home/youtube/Android/SDK/ndk/19.2.5345600/sysroot/usr/include

@kengoon
Copy link
Contributor

kengoon commented Oct 22, 2021

@buybuyxyz I would suggest you allow buildozer to download ndk for you instead of using Android studio ndk

@kengoon
Copy link
Contributor

kengoon commented Oct 22, 2021

Thank you very much for your help.
I'll try it!

I can compile with the patch, but It does not work. It was crash.

env['ANDROID_ROOT']
/home/youtube/Android/SDK/ndk/19.2.5345600/platforms/android-21/arch-arm64/usr
ndk_lib_dir
/home/youtube/Android/SDK/ndk/19.2.5345600/platforms/android-21/arch-arm64/usr/lib
ndk_include_dir
/home/youtube/Android/SDK/ndk/19.2.5345600/sysroot/usr/include

Also being specific with error logs would help

@buybuyxyz
Copy link

  • Part of logcat when running in a PIL directory compiled with the master version
    .............. 10-24 19:34:47.857 26097 26128 I python : [INFO ] [Kivy ] v2.0.0 10-24 19:34:47.857 26097 26128 I python : [INFO ] [Kivy ] Installed at "/data/user/0/org.test1.testpillow02/files/app/_python_bundle/site-pa ckages/kivy/__init__.pyc" 10-24 19:34:47.857 26097 26128 I python : [INFO ] [Python ] v3.8.9 (default, Oct 24 2021, 19:09:55) 10-24 19:34:47.857 26097 26128 I python : [Clang 8.0.2 (https://android.googlesource.com/toolchain/clang 40173bab62ec7462 10-24 19:34:47.857 26097 26128 I python : [INFO ] [Python ] Interpreter at "" 10-24 19:34:47.859 26097 26128 I python : [INFO ] [KivyMD ] 0.104.2, git-bc7d1f5, 2021-06-06 (installed at "/data/user/0/org.test1.testpillow0 2/files/app/_python_bundle/site-packages/kivymd/__init__.pyc") 10-24 19:34:47.863 26097 26128 I python : [INFO ] [Factory ] 186 symbols loaded 10-24 19:34:48.571 1655 2001 D ConnectivityService: NetReassign [no changes] 10-24 19:34:48.815 26097 26097 W SDLThread: type=1400 audit(0.0:1222): avc: granted { execute } for path="/data/user/0/org.test1.testpillow02/files/app/PIL/_imaging.so" dev="dm-8" ino=131074 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file app=org.test1.testpillow02 10-24 19:34:48.823 26097 26128 I python : [INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored) 10-24 19:34:48.821 26097 26097 W SDLThread: type=1400 audit(0.0:1223): avc: granted { execute } for path="/data/user/0/org.test1.testpillow02/files/app/_python_bundle/site-packages/kivy/graphics/fbo.so" dev="dm-8" ino=559170 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file app=org.test1.testpillow02 10-24 19:34:48.825 26097 26097 W SDLThread: type=1400 audit(0.0:1224): avc: granted { execute } for path="/data/user/0/org.test1.testpillow02/files/app/_python_bundle/site-packages/kivy/graphics/context.so" dev="dm-8" ino=559133 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file app=org.test1.testpillow02 10-24 19:34:48.828 26097 26097 W SDLThread: type=1400 audit(0.0:1225): avc: granted { execute } for path="/data/user/0/org.test1.testpillow02/files/app/_python_bundle/site-packages/kivy/graphics/stencil_instructions.so" dev="dm-8" ino=559187 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file app=org.test1.testpillow02 10-24 19:34:48.831 26097 26097 W SDLThread: type=1400 audit(0.0:1226): avc: granted { execute } for path="/data/user/0/org.test1.testpillow02/files/app/_python_bundle/site-packages/kivy/graphics/opengl.so" dev="dm-8" ino=558995 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file app=org.test1.testpillow02 10-24 19:34:48.858 26097 26128 I python : [INFO ] [Text ] Provider: sdl2 10-24 19:34:49.102 26097 26128 I python : [INFO ] [Window ] Provider: sdl2 10-24 19:34:49.126 26097 26128 E libEGL : validate_display:537 error 3008 (EGL_BAD_DISPLAY) 10-24 19:34:49.127 26097 26128 V SDL : setOrientation() orientation=-1 width=800 height=600 resizable=true hint= 10-24 19:34:49.132 26097 26128 I python : [INFO ] [GL ] Using the "OpenGL ES 2" graphics system 10-24 19:34:49.133 26097 26128 I python : [INFO ] [GL ] Backend used <sdl2> 10-24 19:34:49.133 26097 26128 I python : [INFO ] [GL ] OpenGL version <b'OpenGL ES 3.2 [email protected] (GIT@781e7d0, I46ff5fc46f, 1606842862) (Date:12/01/20)'> 10-24 19:34:49.134 26097 26128 I python : [INFO ] [GL ] OpenGL vendor <b'Qualcomm'> 10-24 19:34:49.134 26097 26128 I python : [INFO ] [GL ] OpenGL renderer <b'Adreno (TM) 615'> ......

  • When compiling Pillow with the develop version. Crash on the way and stop.

................. 10-24 18:16:37.405 16652 16678 I python : [INFO ] [Logger ] Record log in /data/user/0/org.test1.testpillow01/files/app/.kivy/logs/kivy_21-10-24_2.txt 10-24 18:16:37.405 16652 16678 I python : [INFO ] [Kivy ] v2.0.0 10-24 18:16:37.405 16652 16678 I python : [INFO ] [Kivy ] Installed at "/data/user/0/org.test1.testpillow01/files/app/_python_bundle/site-packages/kivy/__init__.pyc" 10-24 18:16:37.405 16652 16678 I python : [INFO ] [Python ] v3.8.9 (default, Oct 24 2021, 17:48:16) 10-24 18:16:37.405 16652 16678 I python : [Clang 8.0.2 (https://android.googlesource.com/toolchain/clang 40173bab62ec7462 10-24 18:16:37.405 16652 16678 I python : [INFO ] [Python ] Interpreter at "" 10-24 18:16:37.407 16652 16678 I python : [INFO ] [KivyMD ] 0.104.2, git-bc7d1f5, 2021-06-06 (installed at "/data/user/0/org.test1.testpillow01/files/app/_python_bundle/site-packages/kivymd/__init__.pyc") 10-24 18:16:37.411 16652 16678 I python : [INFO ] [Factory ] 186 symbols loaded 10-24 18:16:37.421 16652 16652 W SDLThread: type=1400 audit(0.0:451): avc: granted { execute } for path="/data/user/0/org.test1.testpillow01/files/app/_python_bundle/modules/_posixsubprocess.cpython-38.so" dev="dm-8" ino=500152 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file app=org.test1.testpillow01 10-24 18:16:37.823 966 1117 D VSC : @ 1191.758: [WO] Proposed rotation: 0, flat angle threshold: 65 10-24 18:16:37.823 966 1117 D VSC : @ 1191.758: [WO] orientation angle 0, orientation 0 10-24 18:16:37.823 966 1117 D VSC : @ 1191.758: [WO] Gyro angle integrated: 112.253540 10-24 18:16:38.361 16652 16652 W SDLThread: type=1400 audit(0.0:478): avc: granted { execute } for path="/data/user/0/org.test1.testpillow01/files/app/_python_bundle/site-packages/kivy/core/image/_img_sdl2.so" dev="dm-8" ino=543197 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file app=org.test1.testpillow01 10-24 18:16:38.381 16652 16652 W SDLThread: type=1400 audit(0.0:479): avc: granted { execute } for path="/data/user/0/org.test1.testpillow01/files/app/_python_bundle/site-packages/PIL/_imaging.so" dev="dm-8" ino=395791 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file app=org.test1.testpillow01 10-24 18:16:38.432 15563 15745 I g : Resend all cards due to CCM failure. ..............
It seems to stop at the place where PIL / _imaging.so is read.
Is it because the compile-time settings of the dependent libraries and the compile-time settings of Pillow itself are different?

@RobertFlatt
Copy link
Contributor

fixed the whole issue for me

me too

@misl6
Copy link
Member

misl6 commented Oct 31, 2021

I may have a couple ideas in mind, but, considering that I'm unable to reproduce the issue on CI or on my docker containers, I need a full log of the p4a run. Can someone help?

@RobertFlatt
Copy link
Contributor

Generally working on one platform does not mean working on all platforms.
There is a lot of heuristic knowledge in the existing recipes, for example in the -l options.

Here is an example log, ask if you need anything else.

log.txt

@misl6
Copy link
Member

misl6 commented Nov 1, 2021

Thank you @RobertFlatt for the full log file, it helped me so much to investigate the issue.

Looks like the issue was present before the AAB edits, but popped out right now due to include paths priority.

I created a new PR(#2516) that should fix the issue, while upgrading to a newer Pillow version. Can someone who was encountering the issue test it and post a feedback?

@RobertFlatt
Copy link
Contributor

I tried New PR(#2516) on Ubuntu 20.04 , two cases:

arm64-v8a / api 27 / ndk 19c
armeabi-v7a / api 31 / ndk 21d

Both successfully built debug apk. Thank you.

@kavakure
Copy link

AWWW! Thanks , worked too

changing line 39 and 40 in Pillow recipe init.py file from

ndk_lib_dir = arch.ndk_lib_dir
ndk_include_dir = self.ctx.ndk_include_dir

to

ndk_lib_dir = join(arch.ndk_platform, 'usr', 'lib')
ndk_include_dir = join(self.ctx.ndk_dir, 'sysroot', 'usr', 'include')

fixed the whole issue for me

@misl6
Copy link
Member

misl6 commented Nov 20, 2021

Fixed via #2516

@misl6 misl6 closed this as completed Nov 20, 2021
@Titus933
Copy link

Working with @Cheaterman here, we discovered pkg-config from host system was polluting include path with eg /usr/x86_64-linux-gnu/include on Ubuntu. We """fixed""" the issue by uninstalling libsdl*-dev from host system. We have zero clue why this is/was happening, but it took a frustratingly large amount of time to diagnose and workaround.

pkg-config ['--libs', '--cflags', 'sdl2', 'SDL2_ttf', 'SDL2_image', 'SDL2_mixer'] returns '-D_REENTRANT -pthread -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/SDL2 -I/usr/include/libpng16 -I/usr/include/x86_64-linux-gnu -I/usr/include/SDL2 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/libinstpatch-2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/opus -I/usr/include/SDL2 -lSDL2_ttf -lSDL2_image -lSDL2_mixer -lSDL2'

Here's an output from a "logger wrapper" we wrote for pkg-config to diagnose the issue.

@Cheaterman
Copy link
Contributor

FYI we commented here since it's the most visible issue talking about __GNUC_PREREQ but this was happening when building Kivy. There's surprisingly few hits for errors of that type online, while OTOH I'm wondering why pkg-config is picking up host pc files preferentially (it apparently still finds the P4A ones once we remove host sdl*dev packages)...

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

No branches or pull requests

9 participants