community icon indicating copy to clipboard operation
community copied to clipboard

Kivylang include other kv files and is invalid in apk

Open WangZhongDian opened this issue 1 year ago • 1 comments

Problem description

adb logcat image 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

WangZhongDian avatar Jun 02 '24 05:06 WangZhongDian

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

ElliotGarbus avatar Jun 02 '24 16:06 ElliotGarbus

👋 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.

github-actions[bot] avatar Dec 26 '24 09:12 github-actions[bot]