-
Notifications
You must be signed in to change notification settings - Fork 14
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
[Bug]: Android APP crashes. #16
Comments
Hello @AlejandroPG10 , thank you for submitting an issue! A project committer will shortly review the issue. |
Hi, as far as I can see, the libraries mentioned as your requirements are compatible with each other. We need to get in details of exactly where and what is the reason of the crash.
Please provide the log for further assistance. Also
Does this mean it's working with Pyrebase4 in computer, or this library (firebase-rest-api)? |
Also did you check this kivy-android-application-crash? Apparently it's required to add pillow library to requirements, otherwise the app crashes. I don't know see pillow in your requirements, could that be an issue? Instead of pyrebase related issue? Either way check the log, it should provide clues. |
No. Sorry if didn't explain it well. That means that when I use the code on my computer with Visual Studio Code, it works perfectly. I can use it without any kind of errors with pyrebase and with firebase-rest-api. |
No, this is not the porblem. My app was compiled perfectly without pillow three weeks ago. Additionally, it is not working with firebase-rest-api and I think it is because I'm not using the correct requirements for this library. I don't know if I have to change any version of any library as some people is saying in the case of pyrebase4. |
As mentioned previously, could please try this?
That will provide the exact reason of why it's crashing, exactly in which line, due to what module/library etc. |
Hi tried this. Don't know if you can say to me something with this: I python : [INFO ] [Logger ] Record log in /data/user/0/org.test.flightsim/files/app/.kivy/logs/kivy_23-05-22_1.txt I could have more info on the logs if you need it. I could search for it if you don't see anything on the lines I've copied. |
This seems to be the reason of why the app is crashing, and it's related to python version and Kivy version as per kivy/kivy#8065 kivymd/KivyMD#1166. Though the version you're using supports 3.10 as per Kivy, I don't know why you're facing this error. You could try setting python version to 3.9, which just might do it. Otherwise ask for help in the Kivy Repo, as the issue is related to them, not Pyrebase related. Lastly, do clean the buildozer before generating the apk file. |
Ok, I will try and then I'll tell you. Same python version, same .py files, same .kve files, the same buildozer.spec.... |
Python version could have been changed automatically. Like you're defining python3 to be used, but not an exact version such as 3.7.6 or 3.9.16. Right now, it's using version 3.10.10 as per the below log line I assume, which may be was using 3.10.8 or 3.10.9 or any other version previously.
Definitely is. They even solved the mentioned issues, still not why you are facing them. But as per the log, import error is from Kivy and Python based. You could go through more log lines to check if there is any other error or not. |
I've faced the same issue with my app, solved by adding at the top of my main.py, and python3==3.9.16 on requirements: |
I've tried it and it doesn't work. I tried with python3==3.9.16 and with python3=3.10.8 (which is the one I have installed). With the first one I could not obtain an apk because of a failure. With the second one I got an apk but it crashes on the mobile. I think the requirements could not be good. Are they correct? Do I need to add something more? Do I have to add some version to any library? The most important part: I have say again that my app used to compile correctly with pyrebase and suddenly one day I couldn't. I don't know if the issues with requests-toolbelt is also affecting to firebase-rest-api or not |
3.10.8 didnt work for me either, when adding the 3.9 on requirements you have to do like this: hostpython3==3.9.16, python3==3.9.16 so It doesnt get error when compiling |
Hi, you were right. It lets me compile the apk but that apk crashes when installed on any android device. These are my requirements now: requirements = python3==3.9.16,hostpython3==3.9.16,kivy==2.1.0,kivymd==1.1.1,kivygradient,firebase-admin,firebase-rest-api,grpcio,Pillow,grpcio-status,pkce,proto-plus,cachecontrol,msgpack,requests,requests-toolbelt,certifi,charset-normalizer,idna,urllib3,google-api-core,google-auth,cachetools,pyasn1-modules,pyasn1,rsa,pyasn1,googleapis-common-protos,protobuf,google-api-python-client,google-auth-httplib2,httplib2,pyparsing,uritemplate,google-cloud-firestore,google-cloud-core,proto-plus,google-cloud-storage,google-resumable-media,google-crc32c Do I have to change something to prevent it crashing? |
Can you share the logs of the error when the app crashes? (I usually use the Android Studio logcat and search for pyth on keywords and scroll ALL the way down and i get the exception error message) |
No, this library doesn't have those issues which pyrebase or pyrebase4 is facing right now. This library doesn't even need requests-toolbelt as requirement. It also supports Python 3.11, which none of the other's do as of now. |
Hello again, sorry for my late answer. Finally I got my app first screen running on my phone. So my app opens at my device without any problem. Now the problem is that when I write the username and the password and try to sign in, the app crahes. Here the logs of my crash: 06-25 23:01:59.661 31052 31082 I python : app.my_firebase.login_app(mail.text, password.text) I'm using the same code that I wrote on my first comment by using firebase-rest-api as described on this page. Any ideas? It seems like the line "firebase_1 = firebase.initialize_app(config)" of my code is not working well. However on my computer it works perfectly. Regards, |
Are you using firebase-rest-api? If yes try cheking the version the buildozer is compiling with. Because you didn't specified the version on buildozer.spec. Finally try specifying on the buildozer.spec the same version you are using on the desktop. You could also check if your buildozer.spec has all the requirements bellow: |
That's my code: import firebase Am I using correctly firebase-rest-api? This could be my first question. I just copied the structure of the code on "Example Usage" on the "code" part of firebase-rest-api github page. I would like to think that is well used just because it is working perfectly on my pc. On the other hand. that was my last buildozer.spec requirements: requirements: python3,kivy==2.1.0,kivymd==1.1.1, kivygradient, google-auth, google-cloud-firestore, google-cloud-storage, pkce, python_jwt, requests, six, firebase As I told you changing my requirements to the ones that I write here, I got my app working on the first screen. It crashes when I try to access and I got the failure I said on my last comment by adb logs What I understood is that there is a problem by using "firebase.initialize_app(config)" line, but I don't know how to solve it. |
s
Seems like you're missing the firebase-rest-api==1.10.1 requirement, try adding it and see if the same error persists |
at the end of this line, you wrote firebase, which should install firebase library, instead of firebase-rest-api. That should be the reason for the error that occurred. Note: Even though the module is named firebase, the library is available/label as firebase-rest-api |
@AsifArmanRahman @WagDevX I've done the following tests:
Command failed: ['/usr/bin/python3', '-m', 'pythonforandroid.toolchain', 'create', '--dist_name=flightSIM', '--bootstrap=sdl2', '--requirements=python3,kivy==2.1.0,kivymd==1.1.1,kivygradient,google-auth,google-cloud-firestore,google-cloud-storage,pkce,python_jwt,requests,six,firebase-rest-api,jwcrypto,cryptography,deprecated', '--arch=arm64-v8a', '--arch=armeabi-v7a', '--copy-libs', '--color=always', '--storage-dir=/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a', '--ndk-api=21', '--ignore-setup-py', '--debug']ENVIRONMENT:SHELL = '/bin/bash'NV_LIBCUBLAS_VERSION = '11.11.3.6-1'NVIDIA_VISIBLE_DEVICES = 'all'COLAB_JUPYTER_TRANSPORT = 'ipc'NV_NVML_DEV_VERSION = '11.8.86-1'NV_CUDNN_PACKAGE_NAME = 'libcudnn8'CGROUP_MEMORY_EVENTS = '/sys/fs/cgroup/memory.events /var/colab/cgroup/jupyter-children/memory.events'NV_LIBNCCL_DEV_PACKAGE = 'libnccl-dev=2.16.2-1+cuda11.8'NV_LIBNCCL_DEV_PACKAGE_VERSION = '2.16.2-1'VM_GCE_METADATA_HOST = '169.254.169.253'HOSTNAME = '2ce25f6913de'TBE_RUNTIME_ADDR = '172.28.0.1:8011'GCE_METADATA_TIMEOUT = '3'NVIDIA_REQUIRE_CUDA = ('cuda>=11.8 brand=tesla,driver>=450,driver<451 ''brand=tesla,driver>=470,driver<471 brand=unknown,driver>=470,driver<471 ' NV_LIBCUBLAS_DEV_PACKAGE = 'libcublas-dev-11-8=11.11.3.6-1'NV_NVTX_VERSION = '11.8.86-1'COLAB_JUPYTER_IP = '172.28.0.12'NV_CUDA_CUDART_DEV_VERSION = '11.8.89-1'NV_LIBCUSPARSE_VERSION = '11.7.5.86-1'COLAB_LANGUAGE_SERVER_PROXY_ROOT_URL = 'http://172.28.0.1:8013/'NV_LIBNPP_VERSION = '11.8.0.86-1'NCCL_VERSION = '2.16.2-1'KMP_LISTEN_PORT = '6000'TF_FORCE_GPU_ALLOW_GROWTH = 'true'ENV = '/root/.bashrc'PWD = '/content'COLAB_LANGUAGE_SERVER_PROXY_REQUEST_TIMEOUT = '30s'TBE_EPHEM_CREDS_ADDR = '172.28.0.1:8009'TBE_CREDS_ADDR = '172.28.0.1:8008'NV_CUDNN_PACKAGE = 'libcudnn8=8.9.0.131-1+cuda11.8'NVIDIA_DRIVER_CAPABILITIES = 'compute,utility'COLAB_JUPYTER_TOKEN = ''LAST_FORCED_REBUILD = '20230608'NV_NVPROF_DEV_PACKAGE = 'cuda-nvprof-11-8=11.8.87-1'NV_LIBNPP_PACKAGE = 'libnpp-11-8=11.8.0.86-1'NV_LIBNCCL_DEV_PACKAGE_NAME = 'libnccl-dev'TCLLIBPATH = '/usr/share/tcltk/tcllib1.20'NV_LIBCUBLAS_DEV_VERSION = '11.11.3.6-1'COLAB_KERNEL_MANAGER_PROXY_HOST = '172.28.0.12'NVIDIA_PRODUCT_NAME = 'CUDA'NV_LIBCUBLAS_DEV_PACKAGE_NAME = 'libcublas-dev-11-8'USE_AUTH_EPHEM = '1'NV_CUDA_CUDART_VERSION = '11.8.89-1'HOME = '/root'LANG = 'en_US.UTF-8'CUDA_VERSION = '11.8.0'CLOUDSDK_CONFIG = '/content/.config'NV_LIBCUBLAS_PACKAGE = 'libcublas-11-8=11.11.3.6-1'NV_CUDA_NSIGHT_COMPUTE_DEV_PACKAGE = 'cuda-nsight-compute-11-8=11.8.0-1'COLAB_RELEASE_TAG = 'release-colab-20230622-060123-RC01'PYDEVD_USE_FRAME_EVAL = 'NO'KMP_TARGET_PORT = '9000'CLICOLOR = '1'KMP_EXTRA_ARGS = ('--logtostderr --listen_host=172.28.0.12 --target_host=172.28.0.12 ''--tunnel_background_save_url=https://colab.research.google.com/tun/m/cc48301118ce562b961b3c22d803539adc1e0c19/m-s-1wy57ev1p2vbo ' NV_LIBNPP_DEV_PACKAGE = 'libnpp-dev-11-8=11.8.0.86-1'NV_LIBCUBLAS_PACKAGE_NAME = 'libcublas-11-8'COLAB_KERNEL_MANAGER_PROXY_PORT = '6000'CLOUDSDK_PYTHON = 'python3'NV_LIBNPP_DEV_VERSION = '11.8.0.86-1'ENABLE_DIRECTORYPREFETCHER = '1'NO_GCE_CHECK = 'False'JPY_PARENT_PID = '80'PYTHONPATH = '/env/python'TERM = 'xterm-color'NV_LIBCUSPARSE_DEV_VERSION = '11.7.5.86-1'GIT_PAGER = 'cat'LIBRARY_PATH = '/usr/local/cuda/lib64/stubs'NV_CUDNN_VERSION = '8.9.0.131'SHLVL = '0'PAGER = 'cat'COLAB_LANGUAGE_SERVER_PROXY = '/usr/colab/bin/language_service'NV_CUDA_LIB_VERSION = '11.8.0-1'NVARCH = 'x86_64'NV_CUDNN_PACKAGE_DEV = 'libcudnn8-dev=8.9.0.131-1+cuda11.8'NV_CUDA_COMPAT_PACKAGE = 'cuda-compat-11-8'MPLBACKEND = 'module://ipykernel.pylab.backend_inline'NV_LIBNCCL_PACKAGE = 'libnccl2=2.16.2-1+cuda11.8'LD_LIBRARY_PATH = '/usr/local/nvidia/lib:/usr/local/nvidia/lib64'COLAB_GPU = ''GCS_READ_CACHE_BLOCK_SIZE_MB = '16'NV_CUDA_NSIGHT_COMPUTE_VERSION = '11.8.0-1'NV_NVPROF_VERSION = '11.8.87-1'COLAB_FILE_HANDLER_ADDR = 'localhost:3453'PATH = '/root/.buildozer/android/platform/apache-ant-1.9.4/bin:/opt/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/tools/node/bin:/tools/google-cloud-sdk/bin'NV_LIBNCCL_PACKAGE_NAME = 'libnccl2'COLAB_DEBUG_ADAPTER_MUX_PATH = '/usr/local/bin/dap_multiplexer'NV_LIBNCCL_PACKAGE_VERSION = '2.16.2-1'PYTHONWARNINGS = 'ignore:::pip._internal.cli.base_command'DEBIAN_FRONTEND = 'noninteractive'COLAB_BACKEND_VERSION = 'next'OLDPWD = '/'_ = '/usr/local/bin/buildozer'PACKAGES_PATH = '/root/.buildozer/android/packages'ANDROIDSDK = '/root/.buildozer/android/platform/android-sdk'ANDROIDNDK = '/root/.buildozer/android/platform/android-ndk-r25b'ANDROIDAPI = '31'ANDROIDMINAPI = '21'Buildozer failed to execute the last commandThe error might be hidden in the log above this errorPlease read the full log, and search for it beforeraising an issue with buildozer itself.In case of a bug report, please add a full log with log_level = 2First of all, I don't know how to fix this error, but secondly and problably the most important part is that I don't know why I need jwcrypto or cryptography if they are not on requirements.txt of fiirebase-rest-api. My second try was to add firebase-rest-api and keep firebase on requirements. Same result. |
This is weird, did you made a buildozer clean after removing firebase from requirements? |
@AsifArmanRahman @WagDevX Hope I will be able to tell you good news. Tomorrow I'll do it. Thank so much. |
Both of these, tho not directly, but are dependencies to firebase-rest-api. By not directly, I meant they're dependency to the dependencies of this library. If you install firebase-rest-api on a clean venv, the below libraries are installed:
You might need to add the whole list of libraries from above, as it seems like dependency of firebase-rest-api dependencies are not being installed. The below ones contain the version of libraries that were installed.
|
@AsifArmanRahman this makes me feel frustrated 🤣🤣 Same error with buildozer when I write as requirements the list you told me yesterday. I don't know if I have to configure something more or maybe something is not working. What can I do? |
I think you should talk with someone who's more familiar with buildozer. You can create an issue in the buildozer repo, cause the error lies within how the app is being built, not this library. |
@AsifArmanRahman ok, I'll do it. |
Where you able to get a solution? I’m having trouble when during execution of my app with the error No module found google.auth . I have google - auth in my requirements and I’m not sure what to do |
Hi!! Yes I did. Finally I discovered that the main problem where in the following libraries: requests So finally the configuration that worked for me was: requests == 2.29.0 There was a time in which I had to change p4a.branch in buildozer.spec. The last time I did it was in this conf: p4a.branch == develop But maybe now it is working again with master one. You can try it anyway. |
Is there an existing issue for this?
Environment
What happened?
I was recommended to use this library because of pyrebase4 failures.
The app (made with kivymd) is now running well in the computer as I did with pyrebase.
Now the problem is that probably I'm not using the correct requirements. So that makes the app crash on the mobile.
Please need to clarify which are the correct requirements for buildozer that I have to use for firebase-api-rest.
These are the ones that are not running well for me:
requirements = python3,kivy==2.1.0,kivymd==1.1.1,kivygradient,firebase-admin,firebase-rest-api,grpcio,grpcio-status,pkce,proto-plus,cachecontrol,msgpack,requests,certifi,charset-normalizer,idna,urllib3,google-api-core,google-auth,cachetools,pyasn1-modules,pyasn1,rsa,pyasn1,googleapis-common-protos,protobuf,google-api-python-client,google-auth-httplib2,httplib2,pyparsing,uritemplate,google-cloud-firestore,google-cloud-core,proto-plus,google-cloud-storage,google-resumable-media,google-crc32c
Any help please?
Code Snippet
Relevant log output
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: