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

Android app crash on starting up by accessing texture. Error:No module named 'typing_extensions' #2743

Closed
Jubileus-ryz opened this issue Feb 5, 2023 · 6 comments
Labels

Comments

@Jubileus-ryz
Copy link

-python version: 3.9.9
-Kivy version: 2.1.0
-p4a version : 2023.1.28

It works well when building with p4a version 2022.12.20. But crash after updating to 2023.1.28

Detail Logs:

09-02 15:05:41.647  9575  9601 I python  :  Traceback (most recent call last):
09-02 15:05:41.647  9575  9601 I python  :    File "/home/ubuntu/Source/virtualeconomy/gemmer/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/gemmer/arm64-v8a/kivy/lang/builder.py", line 240, in create_handler
09-02 15:05:41.647  9575  9601 I python  :    File "/data/data/net.primecoin.app.gemmer/files/app/gemmer.kv", line 87, in <module>
09-02 15:05:41.647  9575  9601 I python  :      texture: self.qrcodeImage(self.info).texture
09-02 15:05:41.647  9575  9601 I python  :    File "/home/ubuntu/Source/virtualeconomy/gemmer/.buildozer/android/app/gui/qr.py", line 19, in qrcodeImage
09-02 15:05:41.647  9575  9601 I python  :    File "/home/ubuntu/Source/virtualeconomy/gemmer/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/gemmer/arm64-v8a/qrcode/__init__.py", line 1, in <module>
09-02 15:05:41.648  9575  9601 I python  :    File "/home/ubuntu/Source/virtualeconomy/gemmer/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/gemmer/arm64-v8a/qrcode/main.py", line 15, in <module>
09-02 15:05:41.648  9575  9601 I python  :  ModuleNotFoundError: No module named 'typing_extensions'

How can I fixed it?

@misl6
Copy link
Member

misl6 commented Feb 5, 2023

Hi @Jubileus-ryz !

Can you share your requirements list?

@Jubileus-ryz
Copy link
Author

Hi @Jubileus-ryz !

Can you share your requirements list?

Here is my requirements :

requirements = openssl,libzbar,python3,kivy==2.1.0,qrcode,Pillow,plyer,mnemonic,zbarlight,requests,urllib3,chardet,idna,certifi,python-axolotl-curve25519,base58,pyvsystems==0.3.2,pyblake2,PyNaCl,oscpy,git+ssh://[email protected]/primecoin/python-bitcoinlib.git@29c3a4fbcc54eabf78805c56367ff1a67b9eb27e,git+ssh://[email protected]/virtualeconomy/gemmer.git@05d24c8942a5ab0262044bbe963e8771b9b32d7a

@jianni1
Copy link

jianni1 commented Feb 7, 2023

Hi @Jubileus-ryz !
Can you share your requirements list?

Here is my requirements :

requirements = openssl,libzbar,python3,kivy==2.1.0,qrcode,Pillow,plyer,mnemonic,zbarlight,requests,urllib3,chardet,idna,certifi,python-axolotl-curve25519,base58,pyvsystems==0.3.2,pyblake2,PyNaCl,oscpy,git+ssh://[email protected]/primecoin/python-bitcoinlib.git@29c3a4fbcc54eabf78805c56367ff1a67b9eb27e,git+ssh://[email protected]/virtualeconomy/gemmer.git@05d24c8942a5ab0262044bbe963e8771b9b32d7a

Having the same problem as you, I tried to fix it by adding 'requirements=typing_extensions'.
my requirements:

requirements = typing_extensions,openssl,libzbar,python3,kivy==2.1.0,qrcode,Pillow,plyer,mnemonic,zbarlight,requests,urllib3,chardet,idna,certifi,python-axolotl-curve25519,base58,pyvsystems==0.3.2,pyblake2,PyNaCl,oscpy,git+ssh://[email protected]/primecoin/python-bitcoinlib.git@29c3a4fbcc54eabf78805c56367ff1a67b9eb27e,git+ssh://[email protected]/virtualeconomy/gemmer.git@fa7271b7e2c73fde07511a259335104ea3a6712e

But crash
Error:No module named 'png'
Detail Logs:

02-07 13:42:17.380 17913 17960 I python  :  BuilderException: Parser: File "/data/data/net.primecoin.app.gemmer/files/app/gemmer.kv", line 87:
02-07 13:42:17.380 17913 17960 I python  :  ...
02-07 13:42:17.381 17913 17960 I python  :       85:<QRcodeImage>
02-07 13:42:17.381 17913 17960 I python  :       86:    info: ""
02-07 13:42:17.381 17913 17960 I python  :  >>   87:    texture: self.qrcodeImage(self.info).texture
02-07 13:42:17.381 17913 17960 I python  :       88:
02-07 13:42:17.381 17913 17960 I python  :       89:<QRcodeLabel>
02-07 13:42:17.381 17913 17960 I python  :  ...
02-07 13:42:17.381 17913 17960 I python  :  ModuleNotFoundError: No module named 'png'

I tried to fix the problem by adding 'requirements=pypng', and the program worked
Final
my requirements:

requirements = pypng,typing_extensions,openssl,libzbar,python3,kivy==2.1.0,qrcode,Pillow,plyer,mnemonic,zbarlight,requests,urllib3,chardet,idna,certifi,python-axolotl-curve25519,base58,pyvsystems==0.3.2,pyblake2,PyNaCl,oscpy,git+ssh://[email protected]/primecoin/python-bitcoinlib.git@29c3a4fbcc54eabf78805c56367ff1a67b9eb27e,git+ssh://[email protected]/virtualeconomy/gemmer.git@fa7271b7e2c73fde07511a259335104ea3a6712e

@github-actions
Copy link

github-actions bot commented Feb 8, 2023

👋 We use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please use our support channels to get help with the project.

If you're having trouble installing or using python-for-android, maybe you could be interested in our quickstart guide.

Let us know if this comment was made in error, and we'll be happy to reopen the issue.

@github-actions github-actions bot closed this as completed Feb 8, 2023
@github-project-automation github-project-automation bot moved this from Needs Triage to Done in Kivy's Control Tower Feb 8, 2023
@sunnyking
Copy link

class QRcodeImage(Image):

    def qrcodeImage(self, data: str):
        import qrcode
        from io import BytesIO
        from kivy.core.image import Image as CoreImage
        qr = qrcode.QRCode(version=1, box_size=64)
        qr.add_data(data)
        qr.make(fit=True)
        png = BytesIO()
        qrPillow = qr.make_image(fill='black', back_color='white')
        qrPillow.save(png, format='png')  # save pillow image to memory buffer
        png.seek(0)
        return CoreImage(BytesIO(png.read()), ext='png')  # ram buffer to image

@sunnyking
Copy link

Does it look like the Image class now requires pypng and typing_extensions to be declared as explicit requirements?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

4 participants