我有一个使用paramiko的应用程序,该应用程序本身运行良好,但是当您启动它时会崩溃,我知道它在paramiko模块中。我在{em> pythonforandroid / bootstraps / sdl2 / build文件夹/
中的main.py文件和黑名单文件旁边放置了white list。我的规格文件的一部分:
source.include_exts = py,png,jpg,kv,atlas
requirements = kivy,kivymd,boto3,botocore,openssl,pyjnius,ecdsa,bcrypt,cryptography,paramiko, android
osx.python_version = 3
osx.kivy_version = 1.10.1
android.permissions = INTERNET, ACCESS_NETWORK_STATE
android.whitelist_src = whitelist.txt
日志文件的一部分(我认为这会导致应用关闭)
06-04 16:31:49.640 21791 21824 I python : Traceback (most recent call last):
06-04 16:31:49.640 21791 21824 I python : File "/home/kivy/Desktop/touchtracer2/.buildozer/android/app/main.py", line 5, in <module>
06-04 16:31:49.641 21791 21824 I python : File "/home/kivy/Desktop/touchtracer2/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/paramiko/__init__.py", line 22, in <module>
06-04 16:31:49.641 21791 21824 I python : File "/home/kivy/Desktop/touchtracer2/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/paramiko/transport.py", line 89, in <module>
06-04 16:31:49.642 21791 21824 I python : File "/home/kivy/Desktop/touchtracer2/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/paramiko/dsskey.py", line 37, in <module>
06-04 16:31:49.643 21791 21824 I python : File "/home/kivy/Desktop/touchtracer2/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/paramiko/pkey.py", line 31, in <module>
06-04 16:31:49.644 21791 21824 I python : File "/home/kivy/Desktop/touchtracer2/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/bcrypt/__init__.py", line 25, in <module>
06-04 16:31:49.644 21791 21824 I python : ImportError: dlopen failed: "/data/data/org.test.myapp/files/app/_python_bundle/site-packages/bcrypt/_bcrypt.so" is 64-bit instead of 32-bit
06-04 16:31:49.644 21791 21824 I python : Python for android ended.
我的应用程序,专门用于测试
from kivy.lang import Builder
from kivymd.app import MDApp
import boto3
import io
import paramiko
KV = '''
Screen:
Button:
id: button
text: "Start"
font_size: "18sp"
on_release: app.start()
'''
class MainApp(MDApp):
def build(self):
self.theme_cls.primary_palette = "Green"
return Builder.load_string(KV)
def start(self):
print('1')
MainApp().run()
答案 0 :(得分:1)
我将buildozer更新到版本1.2.0,注释了这些行p4a.source_dir = /home/kivy/Repos/python-for-android/
android.ndk_path
android.sdk_path
,安装了python 3.8,在终端buildozer android clean
中完成了此命令,并对其进行了修整第requirements = kivy,kivymd,boto3,botocore,openssl,pyjnius,ecdsa,bcrypt,cryptography,paramiko,dateutil,urllib3,jmespath,PyNaCl, android
行