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.59k stars 372 forks source link

White Screen when building an apk #2358

Closed NooRMaseR closed 4 months ago

NooRMaseR commented 4 months ago

a White screen when building an apk it works fine with this code

import flet as ft

class MainUI(ft.UserControl):
    def __init__(self) -> None:
        super().__init__()

    def build(self) -> ft.Row:
        self.textBox: ft.TextField = ft.TextField(hint_text="Ask....", width=250)
        self.msgs_sended: ft.Column = ft.Column()
        return ft.Row(
            alignment=ft.MainAxisAlignment.CENTER,
            controls=[
                ft.Column(
                    controls=[
                        ft.Text("MaseR Assistant"),
                        self.textBox,
                        ft.ElevatedButton(
                            "Send",
                            # on_click=self.send_msg
                        ),
                        self.msgs_sended,
                    ]
                )
            ],
        )

def main(page: ft.Page):
    page.title = "MaseR Assistant"
    page.add(ft.SafeArea(MainUI()))
    page.update()

ft.app(main)

and the app works perfectly

but when i create a class to do a Task in external file, i Get A white screen on android like there's no any widgets in the app these are the requirements

flet
textblob
googletrans

i even tried to add this class in the same main.py file i get the same white screen and this is the command i use flet build apk --description "MaseR Assistant AI Like Google Assistant" --org "com.noormaser" --build-version "0.0.2" --project "MaseR Assistant" -vv

This is how it looks

Screenshot_2024-01-09-22-13-31-684_com.noormaser.maser_assistant.jpg

i'm using windows 10 can any one help me with that issue

FeodorFitsner commented 4 months ago

Could you please elaborate on what do you mean by "create a class to do a Task in external file"?

NooRMaseR commented 4 months ago

Could you please elaborate on what do you mean by "create a class to do a Task in external file"?

like having a separate file containing a class to do something

code2

FeodorFitsner commented 4 months ago

OK, how do you import that class in main.py?

NooRMaseR commented 4 months ago

OK, how do you import that class in main.py?

i import it like this

from botResponse import MaseR_Response

and below i use a function

def send_msg(self, _) -> None:
        question = self.textBox.value
        self.textBox.value = ""
        answer = MaseR_Response(question)
        self.msgs_sended.controls.append(ft.Text(f"{answer}"))
        self.textBox.update()
        self.msgs_sended.update()
FeodorFitsner commented 4 months ago

OK, try importing it as:

import botResponse

and then use as:

answer = botResponse.MaseR_Response(question)

Let me know if that worked in APK.

NooRMaseR commented 4 months ago

OK, try importing it as:

import botResponse

and then use as:

answer = botResponse.MaseR_Response(question)

Let me know if that worked in APK.

Still having a white Screen 😞

FeodorFitsner commented 4 months ago

Would you be able to create a simple repro project in a public GitHub repository, so I can test with it?

NooRMaseR commented 4 months ago

Would you be able to create a simple repro project in a public GitHub repository, so I can test with it?

here's the link

go to repo

taaaf11 commented 4 months ago

@NooRMaseR is the code running fine when you run it on the pc you are coding on?

NooRMaseR commented 4 months ago

@NooRMaseR is the code running fine when you run it on the pc you are coding on?

Yes it works perfectly but when i build an apk, i get no widgets, like white Screen

taaaf11 commented 4 months ago

I am building apk on my side... Let's see what happens

taaaf11 commented 4 months ago

@NooRMaseR Unforunately, it's not working...

taaaf11 commented 4 months ago

@NooRMaseR Try adding self.update() to the MainUI class in send_msg function...

NooRMaseR commented 4 months ago

@NooRMaseR Try adding self.update() to the MainUI class in send_msg function...

I can not add self.update to the MainUI class because there's nothing to update yet, i have to return the UI and then update, but i can not update after the return keyword

taaaf11 commented 4 months ago

@NooRMaseR I asked to self.update() in send_msg function, not in build function

NooRMaseR commented 4 months ago

@taaaf11 sorry I read it wrong and it's still not working, and the the function is not even called yet to do an effect until the button clicked

taaaf11 commented 4 months ago

@NooRMaseR oh sorry. Please give us the output of flet build apk -vv

NooRMaseR commented 4 months ago

@taaaf11 here's the output

Flutter bootstrap directory: C:\Users\ADMINI~1\AppData\Local\Temp\flet_flutter_build_ZJOWycdYAT
Creating Flutter bootstrap project...OK
Customizing app icons and splash images...Copying D:\NooR MaseR\backup\programming\Python\MaseR Assistant 2\android\chatBot\assets\icon_android.png to
C:\Users\ADMINI~1\AppData\Local\Temp\flet_flutter_build_ZJOWycdYAT\images
Copying D:\NooR MaseR\backup\programming\Python\MaseR Assistant 2\android\chatBot\assets\splash.png to
C:\Users\ADMINI~1\AppData\Local\Temp\flet_flutter_build_ZJOWycdYAT\images
OK
Generating app icons...Resolving dependencies in C:\Users\ADMINI~1\AppData\Local\Temp\flet_flutter_build_ZJOWycdYAT... ((16.0s)
Got dependencies in C:\Users\ADMINI~1\AppData\Local\Temp\flet_flutter_build_ZJOWycdYAT.
Building package executable... (13.7s)
Built flutter_launcher_icons:flutter_launcher_icons.
  ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.13.1)
  ════════════════════════════════════════════

β€’ Creating default icons Android
β€’ Overwriting the default Android launcher icon with a new icon
β€’ Overwriting default iOS launcher icon with new icon
Creating Icons for Web...
Creating Icons for Windows...
Creating Icons for MacOS...

βœ“ Successfully generated launcher icons
OK
Generating splash screens...Building package executable... (7.7s)
Built flutter_native_splash:create.
[Android] Creating default splash images
[Android] Creating dark mode splash images
[Android] Creating default android12splash images
[Android] Creating dark mode android12splash images
[Android] Updating launch background(s) with splash image path...
[Android]  - android/app/src/main/res/drawable/launch_background.xml
[Android]  - android/app/src/main/res/drawable-night/launch_background.xml
[Android]  - android/app/src/main/res/drawable-v21/launch_background.xml
[Android]  - android/app/src/main/res/drawable-night-v21/launch_background.xml
[Android] Updating styles...
[Android]  - android/app/src/main/res/values-v31/styles.xml
[Android] No android/app/src/main/res/values-v31/styles.xml found in your Android project
[Android] Creating android/app/src/main/res/values-v31/styles.xml and adding it to your Android project
[Android]  - android/app/src/main/res/values-night-v31/styles.xml
[Android] No android/app/src/main/res/values-night-v31/styles.xml found in your Android project
[Android] Creating android/app/src/main/res/values-night-v31/styles.xml and adding it to your Android project
[Android]  - android/app/src/main/res/values/styles.xml
[Android]  - android/app/src/main/res/values-night/styles.xml
[iOS] Creating  images
[iOS] Creating dark mode  images
[iOS] Updating ios/Runner/Info.plist for status bar hidden/visible
[Web] Creating images
[Web] Creating images
[Web] Creating background images
[Web] Creating CSS
[Web] Updating index.html
╔════════════════════════════════════════════════════════════════════════════╗
β•‘                       NEED A GREAT FLUTTER DEVELOPER?                      β•‘
╠════════════════════════════════════════════════════════════════════════════╣
β•‘                                                                            β•‘
β•‘   I am available!  Find me at https://www.linkedin.com/in/hansonjon/       β•‘
β•‘                                                                            β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

βœ… Native splash complete.
Now go finish building something awesome! πŸ’ͺ You rock! 🀘🀩
Like the package? Please give it a πŸ‘ here: https://pub.dev/packages/flutter_native_splash

OK
Packaging Python app...Building package executable... (5.0s)
Built serious_python:main.
Running package command
Creating asset directory: C:\Users\ADMINI~1\AppData\Local\Temp\flet_flutter_build_ZJOWycdYAT\app
Copying Python app from D:\NooR MaseR\backup\programming\Python\MaseR Assistant 2\android\chatBot to C:\Users\ADMINI~1\AppData\Local\Temp\serious_python_tempf3160541
Installing dependencies [flet-embed, textblob, googletrans] with pip command to C:\Users\ADMINI~1\AppData\Local\Temp\serious_python_tempf3160541\__pypackages__
Extracting Python distributive from C:\Users\ADMINI~1\AppData\Local\Temp\cpython-3.11.6+20231002-x86_64-pc-windows-msvc-shared-install_only.tar.gz to C:\Users\ADMINI~1\AppData\Local\Temp\hostpython3.11_9b12f3e7
Compiling Python sources at C:\Users\ADMINI~1\AppData\Local\Temp\serious_python_tempf3160541
Delete unnecessary files with extensions: [.py, .c, .h, .typed, .exe, .so, .a, .pdb, .pyd, .dll]
Delete unnecessary files and directories: [__pycache__, bin]
Creating app archive at C:\Users\ADMINI~1\AppData\Local\Temp\flet_flutter_build_ZJOWycdYAT\app/app.zip from C:\Users\ADMINI~1\AppData\Local\Temp\serious_python_tempf3160541
Deleting temp directory C:\Users\ADMINI~1\AppData\Local\Temp\serious_python_tempf3160541
Deleting Python directory C:\Users\ADMINI~1\AppData\Local\Temp\hostpython3.11_9b12f3e7
OK
Building .apk for Android...['C:\\dev\\flutter\\bin\\flutter.BAT', 'build', 'apk', '--build-name', '0.0.4']
Resolving dependencies... (1.1s)
  fl_chart 0.65.0 (0.66.0 available)
  flutter_lints 2.0.3 (3.0.1 available)
  flutter_native_splash 2.3.7 (2.3.9 available)
  js 0.6.7 (0.7.0 available)
  lints 2.1.1 (3.0.0 available)
  matcher 0.12.16 (0.12.16+1 available)
  material_color_utilities 0.5.0 (0.8.0 available)
  meta 1.10.0 (1.11.0 available)
  package_info_plus 4.2.0 (5.0.1 available)
  path 1.8.3 (1.9.0 available)
  petitparser 5.4.0 (6.0.2 available)
  test_api 0.6.1 (0.7.0 available)
  toml 0.14.0 (0.15.0 available)
  web 0.3.0 (0.4.0 available)
  web_socket_channel 2.4.0 (2.4.3 available)
  xml 6.3.0 (6.5.0 available)
Got dependencies!
16 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.

C:\Users\Administrator\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\bin\llvm-strip.exe: error: 'C:\Users\Administrator\AppData\Local\Temp\flet_flutter_build_ZJOWycdYAT\build\serious_python_android\intermediates\merged_native_libs\release\out\lib\arm64-v8a\libpythonbundle.so': The file was not recognized as a valid object file

C:\Users\Administrator\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\bin\llvm-strip.exe: error: 'C:\Users\Administrator\AppData\Local\Temp\flet_flutter_build_ZJOWycdYAT\build\serious_python_android\intermediates\merged_native_libs\release\out\lib\armeabi-v7a\libpythonbundle.so': The file was not recognized as a valid object file

C:\Users\Administrator\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\bin\llvm-strip.exe: error: 'C:\Users\Administrator\AppData\Local\Temp\flet_flutter_build_ZJOWycdYAT\build\serious_python_android\intermediates\merged_native_libs\release\out\lib\x86_64\libpythonbundle.so': The file was not recognized as a valid object file

Font asset "CupertinoIcons.ttf" was tree-shaken, reducing it from 283452 to 912 bytes (99.7% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 1261080 bytes (23.3% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
C:\Users\Administrator\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\bin\llvm-strip.exe: error: 'C:\Users\Administrator\AppData\Local\Temp\flet_flutter_build_ZJOWycdYAT\build\app\intermediates\merged_native_libs\release\out\lib\arm64-v8a\libpythonbundle.so': The file was not recognized as a valid object file

C:\Users\Administrator\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\bin\llvm-strip.exe: error: 'C:\Users\Administrator\AppData\Local\Temp\flet_flutter_build_ZJOWycdYAT\build\app\intermediates\merged_native_libs\release\out\lib\armeabi-v7a\libpythonbundle.so': The file was not recognized as a valid object file

C:\Users\Administrator\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\bin\llvm-strip.exe: error: 'C:\Users\Administrator\AppData\Local\Temp\flet_flutter_build_ZJOWycdYAT\build\app\intermediates\merged_native_libs\release\out\lib\x86_64\libpythonbundle.so': The file was not recognized as a valid object file

e: C:/Users/Administrator/.gradle/caches/transforms-3/c4988ff80110f75080a936fc6f044848/transformed/core-1.10.1/jars/classes.jar!/META-INF/core_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Administrator/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Administrator/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Administrator/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Administrator/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.8.22/1a8e3601703ae14bb58757ea6b2d8e8e5935a586/kotlin-stdlib-common-1.8.22.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
Running Gradle task 'assembleRelease'...                          443.5s
βœ“  Built build\app\outputs\flutter-apk\app-release.apk (48.8MB).
OK
Copying build to build\apk directory...OK
Deleting Flutter bootstrap directory C:\Users\ADMINI~1\AppData\Local\Temp\flet_flutter_build_ZJOWycdYAT
Success!
taaaf11 commented 4 months ago

@NooRMaseR Sorry, I can't tell anything here... Maybe @FeodorFitsner helps...

NooRMaseR commented 4 months ago

@taaaf11 @FeodorFitsner i think i found the reason for the issue here, it's the textblob module, when i add textblob in my app i get no widgets on Android and when i remove the module the app works, i don't know why, besides googletrans module doesn't work as well, in my view i guess the app doesn't allow me to do online things on Android I don't know about other platforms but in windows works perfectly

taaaf11 commented 4 months ago

@NooRMaseR try adding the versions of the python packages you are using, just a suggestion.

NooRMaseR commented 4 months ago

@NooRMaseR try adding the versions of the python packages you are using, just a suggestion.

still not working

taaaf11 commented 4 months ago

okay... I can't do anything at this point...

FeodorFitsner commented 4 months ago

Try building app with the latest Flet 0.19.0. It has error reporting now if the app could not be started.

NooRMaseR commented 4 months ago

Try building app with the latest Flet 0.19.0. It has error reporting now if the app could not be started.

I'm sorry but I'm stuck with this for 30 minutes after i updated and the build doesn't want to complete the process after this, like the process got freeze

VERBOSE: Installing build dependencies: started
VERBOSE: Installing build dependencies: finished with status 'done'
VERBOSE: Getting requirements to build wheel: started
VERBOSE: Getting requirements to build wheel: finished with status 'done'
VERBOSE: Installing backend dependencies: started
VERBOSE: Installing backend dependencies: finished with status 'error'

the command i use flet build apk -vv

image

taaaf11 commented 4 months ago

@NooRMaseR give your requirements.txt

NooRMaseR commented 4 months ago

@taaaf11 here's the requirements.txt content

flet
textblob
langid

i replaced googletrans with langid for flet dependences conflictions

NooRMaseR commented 4 months ago

here's the full output if you need it

Creating Flutter bootstrap project...OK
Customizing app icons and splash images...Copying D:\NooR MaseR\backup\programming\Python\MaseR Assistant 2\Chat Bot\env\assets\icon.png to C:\Users\ADMINI~1\AppData\Local\Temp\flet_flutter_build_rIvtkOZuvY\images
OK
Generating app icons...Resolving dependencies in C:\Users\ADMINI~1\AppData\Local\Temp\flet_flutter_build_rIvtkOZuvY... (4.6s)
Got dependencies in C:\Users\ADMINI~1\AppData\Local\Temp\flet_flutter_build_rIvtkOZuvY.
Building package executable... (8.9s)
Built flutter_launcher_icons:flutter_launcher_icons.
  ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.13.1)
  ════════════════════════════════════════════

β€’ Creating default icons Android
β€’ Overwriting the default Android launcher icon with a new icon
β€’ Overwriting default iOS launcher icon with new icon
Creating Icons for Web...
Creating Icons for Windows...
Creating Icons for MacOS...

βœ“ Successfully generated launcher icons
OK
Generating splash screens...Building package executable... (9.9s)
Built flutter_native_splash:create.
[Android] Creating default splash images
[Android] Creating dark mode splash images
[Android] Creating default android12splash images
[Android] Creating dark mode android12splash images
[Android] Updating launch background(s) with splash image path...
[Android]  - android/app/src/main/res/drawable/launch_background.xml
[Android]  - android/app/src/main/res/drawable-night/launch_background.xml
[Android]  - android/app/src/main/res/drawable-v21/launch_background.xml
[Android]  - android/app/src/main/res/drawable-night-v21/launch_background.xml
[Android] Updating styles...
[Android]  - android/app/src/main/res/values-v31/styles.xml
[Android] No android/app/src/main/res/values-v31/styles.xml found in your Android project
[Android] Creating android/app/src/main/res/values-v31/styles.xml and adding it to your Android project
[Android]  - android/app/src/main/res/values-night-v31/styles.xml
[Android] No android/app/src/main/res/values-night-v31/styles.xml found in your Android project
[Android] Creating android/app/src/main/res/values-night-v31/styles.xml and adding it to your Android project
[Android]  - android/app/src/main/res/values/styles.xml
[Android]  - android/app/src/main/res/values-night/styles.xml
[iOS] Creating  images
[iOS] Creating dark mode  images
[iOS] Updating ios/Runner/Info.plist for status bar hidden/visible
[Web] Creating images
[Web] Creating images
[Web] Creating background images
[Web] Creating CSS
[Web] Updating index.html
╔════════════════════════════════════════════════════════════════════════════╗
β•‘                       NEED A GREAT FLUTTER DEVELOPER?                      β•‘
╠════════════════════════════════════════════════════════════════════════════╣
β•‘                                                                            β•‘
β•‘   I am available!  Find me at https://www.linkedin.com/in/hansonjon/       β•‘
β•‘                                                                            β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

βœ… Native splash complete.
Now go finish building something awesome! πŸ’ͺ You rock! 🀘🀩
Like the package? Please give it a πŸ‘ here: https://pub.dev/packages/flutter_native_splash

OK
Packaging Python app...Building package executable... (5.2s)
Built serious_python:main.
Running package command
Creating asset directory: C:\Users\ADMINI~1\AppData\Local\Temp\flet_flutter_build_rIvtkOZuvY\app
Copying Python app from D:\NooR MaseR\backup\programming\Python\MaseR Assistant 2\Chat Bot\env to C:\Users\ADMINI~1\AppData\Local\Temp\serious_python_temp12d6439b
Configured mobile platform with sitecustomize.py at C:\Users\ADMINI~1\AppData\Local\Temp\serious_python_sitecustomize76fb2d0e\sitecustomize.py
Installing dependencies [flet-embed, textblob, langid] with pip command to C:\Users\ADMINI~1\AppData\Local\Temp\serious_python_temp12d6439b\__pypackages__
Downloading Python distributive from https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.11.6+20231002-x86_64-pc-windows-msvc-shared-install_only.tar.gz to C:\Users\ADMINI~1\AppData\Local\Temp\cpython-3.11.6+20231002-x86_64-pc-windows-msvc-shared-install_only.tar.gz
Extracting Python distributive from C:\Users\ADMINI~1\AppData\Local\Temp\cpython-3.11.6+20231002-x86_64-pc-windows-msvc-shared-install_only.tar.gz to C:\Users\ADMINI~1\AppData\Local\Temp\hostpython3.11_a2dff888
VERBOSE: C:\Users\ADMINI~1\AppData\Local\Temp\hostpython3.11_a2dff888\python\python.exe -m pip install --isolated --upgrade --target C:\Users\ADMINI~1\AppData\Local\Temp\serious_python_temp12d6439b\__pypackages__ flet-embed textblob langid
VERBOSE: Collecting flet-embed
VERBOSE: Obtaining dependency information for flet-embed from https://files.pythonhosted.org/packages/ad/d1/a6b49f4fae4611d8b083da1f95afd78e38ffb3898290ffc8dcec73324bf6/flet_embed-0.19.0-py3-none-any.whl.metadata
VERBOSE: Using cached flet_embed-0.19.0-py3-none-any.whl.metadata (1.1 kB)
VERBOSE: Collecting textblob
VERBOSE: Using cached textblob-0.17.1-py2.py3-none-any.whl (636 kB)
VERBOSE: Collecting langid
VERBOSE: Downloading langid-1.1.6.tar.gz (1.9 MB)
VERBOSE: ---------------------------------------- 1.9/1.9 MB 1.3 MB/s eta 0:00:00
VERBOSE:
VERBOSE: Installing build dependencies: started
VERBOSE: Installing build dependencies: finished with status 'done'
VERBOSE: Getting requirements to build wheel: started
VERBOSE: Getting requirements to build wheel: finished with status 'done'
VERBOSE: Preparing metadata (pyproject.toml): started
VERBOSE: Preparing metadata (pyproject.toml): finished with status 'done'
VERBOSE: Collecting flet-runtime==0.19.0 (from flet-embed)
VERBOSE: Obtaining dependency information for flet-runtime==0.19.0 from https://files.pythonhosted.org/packages/dd/19/d0954189bf43dfdf5f9d059f5eb73d3374a13d5d4626a14f24fe35b55b43/flet_runtime-0.19.0-py3-none-any.whl.metadata
VERBOSE: Using cached flet_runtime-0.19.0-py3-none-any.whl.metadata (1.2 kB)
VERBOSE: Collecting flet-core==0.19.0 (from flet-runtime==0.19.0->flet-embed)
VERBOSE: Obtaining dependency information for flet-core==0.19.0 from https://files.pythonhosted.org/packages/cc/cc/520c8a7650b57c615a8be1679c5199a7f57ba59639d76cc7ea0a76bda19f/flet_core-0.19.0-py3-none-any.whl.metadata
VERBOSE: Using cached flet_core-0.19.0-py3-none-any.whl.metadata (1.1 kB)
VERBOSE: Collecting httpx<0.25.0,>=0.24.1 (from flet-runtime==0.19.0->flet-embed)
VERBOSE: Obtaining dependency information for httpx<0.25.0,>=0.24.1 from https://files.pythonhosted.org/packages/ec/91/e41f64f03d2a13aee7e8c819d82ee3aa7cdc484d18c0ae859742597d5aa0/httpx-0.24.1-py3-none-any.whl.metadata
VERBOSE: Using cached httpx-0.24.1-py3-none-any.whl.metadata (7.4 kB)
VERBOSE: Collecting oauthlib<4.0.0,>=3.2.2 (from flet-runtime==0.19.0->flet-embed)
VERBOSE: Using cached oauthlib-3.2.2-py3-none-any.whl (151 kB)
VERBOSE: Collecting repath<0.10.0,>=0.9.0 (from flet-core==0.19.0->flet-runtime==0.19.0->flet-embed)
VERBOSE: Using cached repath-0.9.0-py3-none-any.whl (4.7 kB)
VERBOSE: Collecting nltk>=3.1 (from textblob)
VERBOSE: Using cached nltk-3.8.1-py3-none-any.whl (1.5 MB)
VERBOSE: Collecting numpy (from langid)
VERBOSE: Downloading numpy-1.26.3.tar.gz (15.7 MB)
VERBOSE: ---------------------------------------- 15.7/15.7 MB 2.6 MB/s eta 0:00:00
VERBOSE:
VERBOSE: Installing build dependencies: started
VERBOSE: Installing build dependencies: finished with status 'done'
VERBOSE: Getting requirements to build wheel: started
VERBOSE: Getting requirements to build wheel: finished with status 'done'
VERBOSE: Installing backend dependencies: started
VERBOSE: Installing backend dependencies: finished with status 'error'
taaaf11 commented 4 months ago

Okay, this numpy package part worries me, @FeodorFitsner

FeodorFitsner commented 4 months ago

yep, numpy is the culprit. Should be built separately: https://pub.dev/packages/serious_python#android There is an issue to automate this: https://github.com/flet-dev/serious-python/issues/61

NooRMaseR commented 4 months ago

ok i will try this

NooRMaseR commented 4 months ago

@taaaf11 @FeodorFitsner i ran p4a create --requirements numpy --arch arm64-v8a --arch armeabi-v7a --arch x86_64 --sdk-dir $ANDROID_SDK_ROOT --ndk-dir $ANDROID_SDK_ROOT/ndk/$NDK_VERSION --dist-name serious_python in the terminal and i get this error

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Scripts\p4a.exe\__main__.py", line 4, in <module>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pythonforandroid\entrypoints.py", line 1, in <module>
    from pythonforandroid.recommendations import check_python_version
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pythonforandroid\recommendations.py", line 7, in <module>
    from pythonforandroid.logger import info, warning
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pythonforandroid\logger.py", line 4, in <module>
    import sh
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\sh.py", line 34, in <module>
    import fcntl
ModuleNotFoundError: No module named 'fcntl'

i tried to install fcnt but it's not supported on Windows, i'm using windows 10 what should i do now ?

FeodorFitsner commented 4 months ago

Run it on WSL: https://github.com/kivy/python-for-android/issues/2321#issuecomment-698667595

MaxXilon commented 4 months ago

I had this issue once, it turned out to be the requirements.txt that was missing a required library, for me it was the webcolors library. Try searching for any missing libraries in the requirements.txt file.

NooRMaseR commented 4 months ago

I had this issue once, it turned out to be the requirements.txt that was missing a required library, for me it was the webcolors library. Try searching for any missing libraries in the requirements.txt file.

Nothing is missing it's just numpy as they say, most of my modules uses numpy to analyze the input

MaxXilon commented 4 months ago

Try building the apk on a VM, I usually setup a GitHub codespace or Google compute engine, if am having issues on my PC.

NooRMaseR commented 4 months ago

Try building the apk on a VM, I usually setup a GitHub codespace or Google compute engine, if am having issues on my PC.

Not gonna lie but I'm done with such errors so i have created a web service using flask as API to get what I want exactly with high quality