用buildoz创建apk

2024-04-25 02:11:52 发布

您现在位置:Python中文网/ 问答频道 /正文

嗯,我试过很多次找到类似的东西,但我没有。 我尝试用buildozer创建一个APK,得到了以下结果:

[INFO]:    STDOUT (last 20 lines of 193):
    jnius/jnius.c: In function '__Pyx_ValidateAndInit_memviewslice':    
jnius/jnius.c:55536:22: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'Py_ssize_t' [-Wformat=]   
                      (dtype->size > 1) ? "s" : "");    
                      ^ 
jnius/jnius.c: In function '__pyx_f_5jnius_5jnius_convert_python_to_jobject':   
jnius/jnius.c:12366:21: warning: '__pyx_v_retmidinit' may be used uninitialized in this function [-Wmaybe-uninitialized]    
   __pyx_v_retobject = (__pyx_v_j_env[0])->NewObjectA(__pyx_v_j_env, __pyx_v_retclass, __pyx_v_retmidinit, __pyx_v_j_ret);  
                     ^  
jnius/jnius.c:10897:13: note: '__pyx_v_retmidinit' was declared here    
   jmethodID __pyx_v_retmidinit;    
             ^  
jnius/jnius.c:12366:21: warning: '__pyx_v_retclass' may be used uninitialized in this function [-Wmaybe-uninitialized]  
   __pyx_v_retobject = (__pyx_v_j_env[0])->NewObjectA(__pyx_v_j_env, __pyx_v_retclass, __pyx_v_retmidinit, __pyx_v_j_ret);  
                     ^  
jnius/jnius.c:10889:10: note: '__pyx_v_retclass' was declared here  
   jclass __pyx_v_retclass; 
          ^ 
/home/awulll/dapapp/.buildozer/android/platform/python-for-android-master/pythonforandroid/tools/liblink.sh -lm -L/home/awulll/dapapp/.buildozer/android/platform/build/build/libs_collections/DAP/armeabi-v7a -L/home/awulll/dapapp/.buildozer/android/platform/build/build/libs_collections/DAP/armeabi-v7a -L/home/awulll/dapapp/.buildozer/android/platform/build/build/libs_collections/DAP -L/home/awulll/dapapp/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2/obj/local/armeabi-v7a -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/awulll/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb build/temp.linux-x86_64-2.7/jnius/jnius.o -Llibs/armeabi-v7a -L/home/awulll/dapapp/.buildozer/android/platform/build/build/other_builds/python2/armeabi-v7a/python2/python-install/lib -lSDL2 -llog -lpython2.7 -o build/lib.linux-x86_64-2.7/jnius/jnius.so   
unable to execute /home/awulll/dapapp/.buildozer/android/platform/python-for-android-master/pythonforandroid/tools/liblink.sh: Permission denied    
error: command '/home/awulll/dapapp/.buildozer/android/platform/python-for-android-master/pythonforandroid/tools/liblink.sh' failed with exit status 1
[INFO]:    STDERR:

[INFO]:    COMMAND:
cd /home/awulll/dapapp/.buildozer/android/platform/build/build/other_builds/pyjnius-python2-sdl2/armeabi-v7a/pyjnius && /home/awulll/dapapp/.buildozer/android/platform/build/build/python-installs/DAP/bin/python.host setup.py build_ext -v

[WARNING]: ERROR: /home/awulll/dapapp/.buildozer/android/platform/build/build/python-installs/DAP/bin/python.host failed!
# Command failed: python -m pythonforandroid.toolchain --color=always --storage-dir=/home/awulll/dapapp/.buildozer/android/platform/build create --dist_name=DAP --bootstrap=sdl2 --requirements=python2,sqlite3,kivy==master,python2,datetime,plyer,ecdsa,paramiko --arch armeabi-v7a --copy-libs
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

我试着卸载buildozer、jnius和cython和其他东西,但没有任何改变,也尝试使用更少的需求,我只使用python2就成功了,但这并不能解决我的问题。我的要求buildozer.spec是:

^{pr2}$

有什么想法吗?谢谢!在

版本:

如果我使用python2、sqlite3作为需求,则会出现以下错误:

  STDOUT:
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv-2.7", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
    @_call_aside
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 637, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 650, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 829, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'virtualenv==13.1.2' distribution was not found and is required by the application


  STDERR:

# Command failed: python -m pythonforandroid.toolchain --color=always --storage-dir=/home/awulll/dapapp/.buildozer/android/platform/build create --dist_name=DAP --bootstrap=sdl2 --requirements=python2,sqlite3 --arch armeabi-v7a --copy-libs
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

Tags: inbuildhomeliblocalandroidplatformpyx