[英]How to use nltk in android using Kivy and buildozer
I need to test NLTK program in android with Kivy.我需要使用 Kivy 在 android 中测试 NLTK 程序。 But app crashes when I open the app.
但是当我打开应用程序时,应用程序崩溃了。 Program has no errors.
程序没有错误。 I tried modifying the buildozer.spec file(added nltk in kivy requirements) but it didn't workout.
我尝试修改 buildozer.spec 文件(在 kivy 要求中添加了 nltk),但没有成功。 How to make it work?
如何让它发挥作用?
Here is the "app" section of buildozer.spec file这是 buildozer.spec 文件的“app”部分
[app]
# (str) Title of your application
title = NLTK APP
# (str) Package name
package.name = nltkapp
# (str) Package domain (needed for android/ios packaging)
package.domain = org.test
# (str) Source code where the main.py live
source.dir = .
# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas
# (list) List of inclusions using pattern matching
#source.include_patterns = assets/*,images/*.png
# (list) Source files to exclude (let empty to not exclude anything)
#source.exclude_exts = spec
# (list) List of directory to exclude (let empty to not exclude anything)
#source.exclude_dirs = tests, bin
# (list) List of exclusions using pattern matching
#source.exclude_patterns = license,images/*/*.jpg
# (str) Application versioning (method 1)
version = 0.1
# (str) Application versioning (method 2)
# version.regex = __version__ = ['"](.*)['"]
# version.filename = %(source.dir)s/main.py
# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = kivy, android, nltk
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
# requirements.source.kivy = ../../kivy
# (list) Garden requirements
#garden_requirements =
# (str) Presplash of the application
#presplash.filename = %(source.dir)s/data/presplash.png
# (str) Icon of the application
#icon.filename = %(source.dir)s/data/icon.png
# (str) Supported orientation (one of landscape, portrait or all)
orientation = portrait
# (list) List of service to declare
#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY
So this was so long for you I doubt you care anymore but I'm encountering the same issue and here is how far I've gotten...所以这对你来说太久了我怀疑你不再关心但我遇到了同样的问题这是我已经走了多远......
You need to add more dependencies to your您需要为您的添加更多依赖项
# (list) Application requirements
requirements = python2,kivy,goslate,chardet,idna,nltk
I think if you add those your App will at least start... but honestly the best thing I've found from others that has helped me debug is using 'adb logcat' command in your terminal.我想如果你添加那些你的应用程序至少会启动......但老实说,我从其他人那里发现的帮助我调试的最好的东西是在你的终端中使用'adb logcat'命令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.