community
community copied to clipboard
Kivylang include other kv files and is invalid in apk
Problem description
adb logcat
The kivy program runs normally on the computer and can load kv files. However, when packaged as apk and running on Android, there may be a problem with loading kv files. I suspect that kvlang did not handle the include statement properly during packaging
tree
├── dynamic
│ └── json
│ └── team.json
├── src
│ ├── pages
│ │ ├── addTeam
│ │ │ ├── addTeam.kv
│ │ │ └── addTeam.py
│ │ └── home
│ │ ├── kv
│ │ │ ├── home.kv
│ │ │ ├── middle.kv
│ │ │ └── teamcardswipe.kv
│ │ ├── TeamCardSwipe.py
│ │ ├── home.py
│ │ └── middle.py
│ └── utils
│ ├── fonts_config.py
│ └── team.py
├── static
│ └── fonts
│ └── song_typeface.ttf
├── README.md
├── buildozer.spec
├── main.py
└── requirements.txt
Error code section
home.kv:src\pages\home\kv\home.kv
#:kivy 2.3.0
#:import MDSwapTransition kivymd.uix.transition.MDSwapTransition
#:include force src\pages\home\kv\teamcardswipe.kv
#:include force src\pages\home\kv\middle.kv
#导航选项模板
<MDNavigationItemLabelItem@MDNavigationItemLabel>:
role:'small'
I want to import teamcardswipe.kv and middle.kv from home.kv. Initially, everything was fine, but when running on the Android side, path errors would occur
This is a support issue, not a bug. I suggest you post your issue to the kivy discord. Android storage is not the same as on your computer, read: https://github.com/Android-for-Python/Android-for-Python-Users?tab=readme-ov-file#android-storage
👋 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 Kivy, make sure to check out the installation docs for Windows, Linux and macOS.
Let us know if this comment was made in error, and we'll be happy to reopen the issue.