flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
9.26k stars 358 forks source link

error: expression is not assignable p4a create #2568

Open ssaravanan384900712 opened 3 months ago

ssaravanan384900712 commented 3 months ago

Hello folks, im new to python-for-android for flet app,

Im trying to build psycopg2 for android using

p4a create --requirements psycopg2 --arch arm64-v8a --arch armeabi-v7a --arch x86_64 --sdk-dir $ANDROID_SDK_ROOT --ndk-dir $ANDROID_SDK_ROOT/ndk/$NDK_VERSION --dist-name mydist-psycopg2-only

But i get this error

/home/saravanans/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -I/home/saravanans/.local/share/python-for-android/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include -DANDROID -I/home/saravanans/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/saravanans/.local/share/python-for-android/build/python-installs/mydist-psycopg2-only/arm64-v8a/include/python3.1 -fPIC -DPSYCOPG_VERSION=2.8.5 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140010 -DHAVE_LO64=1 -I/home/saravanans/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/saravanans/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.11/psycopg/psycopgmodule.o -Wdeclaration-after-statement
psycopg/psycopgmodule.c:921:36: error: expression is not assignable
        Py_TYPE(typetable[i].type) = &PyType_Type;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
psycopg/psycopgmodule.c:953:30: error: expression is not assignable
    Py_TYPE(&pydatetimeType) = &PyType_Type;
    ~~~~~~~~~~~~~~~~~~~~~~~~ ^
psycopg/psycopgmodule.c:1085:28: error: expression is not assignable
    Py_TYPE(&typecastType) = &PyType_Type;
    ~~~~~~~~~~~~~~~~~~~~~~ ^
psycopg/psycopgmodule.c:1088:25: error: expression is not assignable
    Py_TYPE(&chunkType) = &PyType_Type;
    ~~~~~~~~~~~~~~~~~~~ ^
psycopg/psycopgmodule.c:1091:25: error: expression is not assignable
    Py_TYPE(&errorType) = &PyType_Type;
    ~~~~~~~~~~~~~~~~~~~ ^
5 errors generated.
error: command '/home/saravanans/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit code 1
  STDERR:

Im on ubuntu 22.04

$ flet --version
0.19.0

$ cython --version Cython version 3.0.8

could you please help?

FeodorFitsner commented 2 months ago

I noticed you reported this issue on Kivy as well: https://github.com/kivy/python-for-android/issues/2967 - that would be the right place to do that.