我正在尝试创建视频 .apk,其中包括
Video
或
VideoPlayer
.
main.py
from kivy.uix.video import Video
from kivy.app import App
class MyApp(App):
def build(self):
player = Video(source="1.mp4",options={'eos': 'loop'},state="play")
return player
if __name__ == '__main__':
MyApp().run()
buildozer.spec: [app]
title = Test Video APK
package.name = myapp.videotestetststeste
package.domain = org.testtestestest
source.dir = .
source.include_exts =
version = 0.1
requirements = python3,kivy==2.3.0,olefile,ffpyplayer,ffpyplayer_codecs
orientation = portrait
osx.python_version = 3.11
osx.kivy_version = 2.3.0
fullscreen = 1
android.permissions = android.permission.INTERNET, (name=android.permission.WRITE_EXTERNAL_STORAGE;maxS
日志:
07-31 02:01:02.992 15263 15263 V pythonutil: Loading library: python3.11
07-31 02:01:03.038 15263 15263 V pythonutil: Loading library: main
07-31 02:01:03.042 15263 15263 V pythonutil: Loaded everything!
07-31 02:01:03.146 15263 15302 I python : Initializing Python for Android
07-31 02:01:03.146 15263 15302 I python : Setting additional env vars from p4a_env_vars.txt
07-31 02:01:03.147 15263 15302 I python : Changing directory to the one provided by ANDROID_ARGUMENT
07-31 02:01:03.147 15263 15302 I python : /data/user/0/org.testtestestest.myapp.videotestetststeste/files/app
07-31 02:01:03.170 15263 15302 I python : Preparing to initialize python
07-31 02:01:03.170 15263 15302 I python : _python_bundle dir exists
07-31 02:01:03.170 15263 15302 I python : calculated paths to be...
07-31 02:01:03.170 15263 15302 I python : /data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/stdlib.zip:/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/modules
07-31 02:01:03.170 15263 15302 I python : set wchar paths...
07-31 02:01:03.194 15263 15263 W SDLThread: type=1400 audit(0.0:56907): avc: granted { execute } for path="/data/data/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/modules/zlib.cpython-311.so" dev="sda15" ino=900967 scontext=u:r:untrusted_app:s0:c221,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c221,c257,c512,c768 tclass=file app=org.testtestestest.myapp.videotestetststeste
07-31 02:01:03.221 15263 15302 I python : Initialized python
07-31 02:01:03.221 15263 15302 I python : AND: Init threads
07-31 02:01:03.222 15263 15302 I python : testing python print redirection
07-31 02:01:03.223 15263 15302 I python : Android path ['.', '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/stdlib.zip', '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/modules', '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/site-packages']
07-31 02:01:03.223 15263 15302 I python : os.environ is environ({'PATH': '/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin', 'ANDROID_BOOTLOGO': '1', 'ANDROID_ROOT': '/system', 'ANDROID_ASSETS': '/system/app', 'ANDROID_DATA': '/data', 'ANDROID_STORAGE': '/storage', 'ANDROID_ART_ROOT': '/apex/com.android.art', 'ANDROID_I18N_ROOT': '/apex/com.android.i18n', 'ANDROID_TZDATA_ROOT': '/apex/com.android.tzdata', 'EXTERNAL_STORAGE': '/sdcard', 'ASEC_MOUNTPOINT': '/mnt/asec', 'BOOTCLASSPATH': '/apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/core-icu4j.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/framework-atb-backward-compatibility.jar:/system/framework/tcmiface.jar:/system/framework/telephony-ext.jar:/system/framework/qcom.fmradio.jar:/system/framework/QPerformance.jar:/system/framework/UxPerformance.jar:/system/framework/WfdCommon.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.wifi/javalib/framework-wifi.jar:/apex/com.android.tethering/javalib/framework-tethering.jar', 'DEX2OATBOOTCLASSPATH': '/apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/core-icu4j.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/framework-atb-backward-compatibility.jar:/system/framework/tcmiface.jar:/system/framework/telephony-ext.jar:/system/framework/qcom.fmradio.jar:/system/framework/QPerformance.jar:/system/framework/UxPerformance.jar:/system/framework/WfdCommon.jar', 'SYSTEMSERVERCLASSPATH': '/system/framework/com.android.location.provider.jar:/system/framework/services.jar:/system/framework/ethernet-service.jar:/apex/com.android.permission/javalib/service-permission.jar:/apex/com.android.wifi/javalib/service-wifi.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar', 'DOWNLOAD_CACHE': '/data/cache', 'ANDROID_SOCKET_zygote': '18', 'ANDROID_SOCKET_usap_pool_primary': '23', 'ANDROID_ENTRYPOINT': 'main.pyc', 'ANDROID_ARGUMENT': '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app', 'ANDROID_APP_PATH': '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app', 'ANDROID_PRIVATE': '/data/user/0/org.testtestestest.myapp.videotestetststeste/files', 'ANDROID_UNPACK': '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app', 'PYTHONHOME': '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app', 'PYTHONPATH': '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app:/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/lib', 'PYTHONOPTIMIZE': '2', 'P4A_BOOTSTRAP': 'SDL2', 'PYTHON_NAME': 'python', 'P4A_IS_WINDOWED': 'False', 'KIVY_ORIENTATION': 'Portrait', 'P4A_NUMERIC_VERSION': 'None', 'P4A_MINSDK': '21', 'LC_CTYPE': 'C.UTF-8'})
07-31 02:01:03.223 15263 15302 I python : Android kivy bootstrap done. __name__ is __main__
07-31 02:01:03.223 15263 15302 I python : AND: Ran string
07-31 02:01:03.223 15263 15302 I python : Run user program, change dir and execute entrypoint
07-31 02:01:03.284 15263 15263 W SDLThread: type=1400 audit(0.0:56908): avc: granted { execute } for path="/data/data/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/modules/_typing.cpython-311.so" dev="sda15" ino=900949 scontext=u:r:untrusted_app:s0:c221,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c221,c257,c512,c768 tclass=file app=org.testtestestest.myapp.videotestetststeste
07-31 02:01:03.334 15263 15263 W SDLThread: type=1400 audit(0.0:56909): avc: granted { execute } for path="/data/data/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/modules/math.cpython-311.so" dev="sda15" ino=900956 scontext=u:r:untrusted_app:s0:c221,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c221,c257,c512,c768 tclass=file app=org.testtestestest.myapp.videotestetststeste
07-31 02:01:03.364 15263 15263 W SDLThread: type=1400 audit(0.0:56912): avc: granted { execute } for path="/data/data/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/modules/_opcode.cpython-311.so" dev="sda15" ino=900928 scontext=u:r:untrusted_app:s0:c221,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c221,c257,c512,c768 tclass=file app=org.testtestestest.myapp.videotestetststeste
07-31 02:01:03.389 15263 15302 I python : [ERROR ] Error when copying logo directory
07-31 02:01:03.389 15263 15302 I python : Traceback (most recent call last):
07-31 02:01:03.390 15263 15302 I python : File "/mnt/KivyVideoAPK/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/myapp.videotestetststeste/arm64-v8a/kivy/__init__.py", line 372, in <module>
07-31 02:01:03.390 15263 15302 I python : File "/mnt/KivyVideoAPK/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/shutil.py", line 561, in copytree
07-31 02:01:03.390 15263 15302 I python : File "/mnt/KivyVideoAPK/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Lib/shutil.py", line 515, in _copytree
07-31 02:01:03.390 15263 15302 I python : shutil.Error: [('/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/site-packages/kivy/data/logo/kivy-icon-128.png', '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-128.png', "[Errno 13] Permission denied: '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-128.png'"), ('/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/site-packages/kivy/data/logo/kivy-icon-16.png', '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-16.png', "[Errno 13] Permission denied: '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-16.png'"), ('/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/site-packages/kivy/data/logo/kivy-icon-24.png', '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-24.png', "[Errno 13] Permission denied: '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-24.png'"), ('/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/site-packages/kivy/data/logo/kivy-icon-256.png', '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-256.png', "[Errno 13] Permission denied: '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-256.png'"), ('/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/site-packages/kivy/data/logo/kivy-icon-32.png', '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-32.png', "[Errno 13] Permission denied: '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-32.png'"), ('/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/site-packages/kivy/data/logo/kivy-icon-48.png', '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-48.png', "[Errno 13] Permission denied: '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-48.png'"), ('/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/site-packages/kivy/data/logo/kivy-icon-512.png', '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-512.png', "[Errno 13] Permission denied: '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-512.png'"), ('/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/site-packages/kivy/data/logo/kivy-icon-64.ico', '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-64.ico', "[Errno 13] Permission denied: '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-64.ico'"), ('/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/site-packages/kivy/data/logo/kivy-icon-64.png', '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-64.png', "[Errno 13] Permission denied: '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon/kivy-icon-64.png'"), ('/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/site-packages/kivy/data/logo', '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon', "[Errno 13] Permission denied: '/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/icon'")]
07-31 02:01:03.399 15263 15302 I python : [WARNING] [Config ] Older configuration version detected (0 instead of 27)
07-31 02:01:03.400 15263 15302 I python : [WARNING] [Config ] Upgrading configuration in progress.
07-31 02:01:03.400 15263 15302 I python : [DEBUG ] [Config ] Upgrading from 0 to 1
07-31 02:01:03.403 15263 15302 I python : [INFO ] [Logger ] Record log in /data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/.kivy/logs/kivy_24-07-31_0.txt
07-31 02:01:03.405 15263 15302 I python : [INFO ] [Kivy ] v2.3.0
07-31 02:01:03.406 15263 15302 I python : [INFO ] [Kivy ] Installed at "/data/user/0/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/site-packages/kivy/__init__.pyc"
07-31 02:01:03.406 15263 15302 I python : [INFO ] [Python ] v3.11.5 (main, Jul 31 2024, 01:30:29) [Clang 14.0.6 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0
07-31 02:01:03.406 15263 15302 I python : [INFO ] [Python ] Interpreter at ""
07-31 02:01:03.407 15263 15302 I python : [INFO ] [Logger ] Purge log fired. Processing...
07-31 02:01:03.407 15263 15302 I python : [INFO ] [Logger ] Purge finished!
07-31 02:01:04.354 15263 15263 W SDLThread: type=1400 audit(0.0:56934): avc: granted { execute } for path="/data/data/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/modules/binascii.cpython-311.so" dev="sda15" ino=900913 scontext=u:r:untrusted_app:s0:c221,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c221,c257,c512,c768 tclass=file app=org.testtestestest.myapp.videotestetststeste
07-31 02:01:04.374 15263 15263 W SDLThread: type=1400 audit(0.0:56935): avc: granted { execute } for path="/data/data/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/modules/_contextvars.cpython-311.so" dev="sda15" ino=900911 scontext=u:r:untrusted_app:s0:c221,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c221,c257,c512,c768 tclass=file app=org.testtestestest.myapp.videotestetststeste
07-31 02:01:04.384 15263 15263 W SDLThread: type=1400 audit(0.0:56936): avc: granted { execute } for path="/data/data/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/modules/_asyncio.cpython-311.so" dev="sda15" ino=900869 scontext=u:r:untrusted_app:s0:c221,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c221,c257,c512,c768 tclass=file app=org.testtestestest.myapp.videotestetststeste
07-31 02:01:04.424 15263 15263 W SDLThread: type=1400 audit(0.0:56937): avc: granted { execute } for path="/data/data/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/site-packages/kivy/_event.so" dev="sda15" ino=901266 scontext=u:r:untrusted_app:s0:c221,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c221,c257,c512,c768 tclass=file app=org.testtestestest.myapp.videotestetststeste
07-31 02:01:04.445 15263 15302 I python : [INFO ] [Factory ] 195 symbols loaded
07-31 02:01:04.602 15263 15302 I python : [INFO ] [ImageLoaderFFPy] Using ffpyplayer 4.3.2
07-31 02:01:04.603 15263 15302 I python : [INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_ffpyplayer (img_pil ignored)
07-31 02:01:04.907 15263 15302 I python : [INFO ] [VideoFFPy ] Using ffpyplayer 4.3.2
07-31 02:01:04.908 15263 15302 I python : [INFO ] [Video ] Provider: ffpyplayer(['video_ffmpeg'] ignored)
07-31 02:01:04.940 15263 15302 I python : [INFO ] [Window ] Provider: sdl2
07-31 02:01:05.020 15263 15302 I python : [INFO ] [GL ] Using the "OpenGL ES 2" graphics system
07-31 02:01:05.026 15263 15302 I python : [INFO ] [GL ] Backend used <sdl2>
07-31 02:01:05.026 15263 15302 I python : [INFO ] [GL ] OpenGL version <b'OpenGL ES 3.2 [email protected] (GIT@d4cfdf3, Ic907de5ed0, 1601055299) (Date:09/25/20)'>
07-31 02:01:05.027 15263 15302 I python : [INFO ] [GL ] OpenGL vendor <b'Qualcomm'>
07-31 02:01:05.027 15263 15302 I python : [INFO ] [GL ] OpenGL renderer <b'Adreno (TM) 610'>
07-31 02:01:05.027 15263 15302 I python : [INFO ] [GL ] OpenGL parsed version: 3, 2
07-31 02:01:05.028 15263 15302 I python : [INFO ] [GL ] Texture max size <16384>
07-31 02:01:05.028 15263 15302 I python : [INFO ] [GL ] Texture max units <16>
07-31 02:01:05.082 15263 15302 I python : [INFO ] [Window ] auto add sdl2 input provider
07-31 02:01:05.083 15263 15302 I python : [INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
07-31 02:01:05.084 15263 15302 I python : [ERROR ] [Image ] Error loading <1.mp4>
07-31 02:01:05.087 15263 15302 I python : [WARNING] [Base ] Unknown <android> provider
07-31 02:01:05.087 15263 15302 I python : [INFO ] [Base ] Start application main loop
07-31 02:01:05.604 15331 15331 F DEBUG : #06 pc 000000000001539c /data/data/org.testtestestest.myapp.videotestetststeste/files/app/_python_bundle/site-packages/kivy/core/window/_window_sdl2.so
07-31 02:01:05.604 15331 15331 F DEBUG : #07 pc 00000000002c82b8 /data/app/~~s0lBApATuUpzckMd1_r55w==/org.testtestestest.myapp.videotestetststeste-PxUqzVwevgRc14pJJJu1eQ==/lib/arm64/libpython3.11.so (_PyEval_EvalFrameDefault+2052)
07-31 02:01:05.604 15331 15331 F DEBUG : #08 pc 00000000002c78e4 /data/app/~~s0lBApATuUpzckMd1_r55w==/org.testtestestest.myapp.videotestetststeste-PxUqzVwevgRc14pJJJu1eQ==/lib/arm64/libpython3.11.so (PyEval_EvalCode+268)
07-31 02:01:05.604 15331 15331 F DEBUG : #09 pc 00000000003187e8 /data/app/~~s0lBApATuUpzckMd1_r55w==/org.testtestestest.myapp.videotestetststeste-PxUqzVwevgRc14pJJJu1eQ==/lib/arm64/libpython3.11.so (_PyRun_SimpleFileObject+1188)
07-31 02:01:05.604 15331 15331 F DEBUG : #10 pc 00000000003190ac /data/app/~~s0lBApATuUpzckMd1_r55w==/org.testtestestest.myapp.videotestetststeste-PxUqzVwevgRc14pJJJu1eQ==/lib/arm64/libpython3.11.so (PyRun_SimpleFileExFlags+60)
代码在 Windows 和 Linux 端运行,但在 Android 端失败。无法弄清楚最后 5 行 LOG 出了什么问题。
Kivy 应用程序在的 Android 设备上崩溃,日志显示错误发生在
_window_sdl2.so
库中。尽管日志中没有明确的错误消息,但以下是一些可能导致此问题的常见原因和解决方法:
1. 视频文件问题:
-
文件路径不正确:
确保的“1.mp4”视频文件位于 Android 设备上的正确路径。可以尝试将视频文件放在不同的位置,例如
~/
目录或/sdcard/
目录,并更新source
路径。 - 文件格式不受支持: 并非所有视频格式都受 Kivy 或 ffpyplayer 支持。尝试使用 FFmpeg 将的视频转换为更常用的格式,例如 MP4(使用 H.264 编码)或 WebM。
- 文件已损坏: 确保的视频文件未损坏。尝试在的计算机上播放它以进行验证。
2. 权限问题:
-
读取视频文件权限:
的应用程序可能没有权限读取视频文件。确保的
buildozer.spec
文件包含必要的权限。已经在android.permissions
中添加了android.permission.READ_EXTERNAL_STORAGE
,但可能需要添加更具体的权限,例如android.permission.READ_MEDIA_VIDEO
(API 级别 33 及以上) 或android.permission.READ_MEDIA_IMAGES
(API 级别 33 以下)。 -
写入日志文件权限:
日志显示 Kivy 正在尝试写入日志文件,但可能没有权限。尝试将日志文件路径更改为应用程序具有写入权限的位置,例如
/sdcard/
目录。
3. ffpyplayer 问题:
- 版本不兼容: 确保使用的 ffpyplayer 版本与的 Kivy 版本兼容。可以尝试升级或降级 ffpyplayer 版本以找到兼容的组合。
-
编解码器问题:
ffpyplayer 可能缺少播放视频所需的编解码器。尝试安装
ffpyplayer_codecs
包,该包应该包含常用的编解码器。已经在requirements
中添加了它,但可以尝试重新安装或使用不同的编解码器包。
4. 其他问题:
- 内存不足: 播放视频非常消耗资源。如果的设备内存不足,则应用程序可能会崩溃。尝试关闭其他应用程序以释放内存。
- 设备不兼容: 某些设备可能与 Kivy 或 ffpyplayer 不兼容。尝试在其他 Android 设备上测试的应用程序。
调试建议:
- 检查日志: 仔细检查完整的日志文件以获取有关崩溃的更多信息。
-
使用
adb logcat
: 使用adb logcat
实时查看更详细的日志信息。 - 逐步调试: 尝试注释掉代码的部分内容,以确定导致崩溃的具体行或函数。
-
简化应用程序:
创建一个仅包含
VideoPlayer
小部件的最简单的 Kivy 应用程序,以消除其他因素的影响。
希望这些建议能帮助解决问题。如果问题仍然存在,请提供更多信息,例如:
- 正在使用的 Android 设备和 Android 版本。
- 完整的崩溃日志。
- 尝试过的其他解决方法。