You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Kivy代码打包APK后安卓端启动崩溃问题求助

Kivy打包APK后安卓启动崩溃问题求助

我用Kivy编写的Python代码打包为APK后,安装到安卓设备启动即崩溃。多次参考教程及博客案例尝试解决,也通过Android Studio查看日志,但问题依旧。

附带buildozer.spec、main.py和日志文件。

代码如下:

import os

os.environ['KIVY_NO_FILELOG'] = '1'  # disable file log
os.environ['KIVY_NO_CONSOLELOG'] = '1'  # disable console log
os.environ['KIVY_LOG_LEVEL'] = 'critical'  # set log level to critical
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.filechooser import FileChooserIconView
from kivy.core.window import Window
import datetime
from kivy.lang import Builder
from kivy.app import App
from kivy.config import Config
import time
Config.set('input', 'mouse', 'mouse,multitouch_on_demand')

notes_save_path="/home/shiva/Desktop/Arabian_talk_scrappy/tryit/new_kivy_tries"
new_path="new_kivy_tries"
my_string=""" 

<MyNotepad>
    BoxLayout:
        name: 'my_notepad'
        orientation: 'vertical'
        TextInput: 
            id: text_input
            background_color:'#D9F59C'
            background_active:''
            
        BoxLayout:
            orientation:'horizontal'
            size_hint: (1, None) 
            height:50
            Button:
                text: "save_note"
                font_size : '20sp'
                on_press: root.texter(text_input.text)
                bold: True
                background_color :'#808000'
                color: '#2ADFE8'

            Button:
                text: "Clear"
                font_size : '20sp'
                bold: True
                background_color :'#811322'
                color: '#2ADFE8'
                on_release: text_input.text = ""
"""
class MyNotepad(Screen):
    def texter(self, text):
        pass

class MY_NOTES(App):
    def build(self):
        Builder.load_string(my_string)
        sm = ScreenManager()
        sm.add_widget(MyNotepad(name='my_notepad'))
        return sm


if __name__ == '__main__':
    MY_NOTES().run()

内容的提问来源于stack exchange,提问作者krishna

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.28 16:22:56