【问题标题】:How to use nltk in android using Kivy and buildozer如何使用 Kivy 和 buildozer 在 android 中使用 nltk
【发布时间】:2018-08-16 08:16:22
【问题描述】:

我需要使用 Kivy 在 android 中测试 NLTK 程序。但是当我打开应用程序时应用程序崩溃。程序没有错误。我尝试修改 buildozer.spec 文件(在 kivy 要求中添加了 nltk),但它没有锻炼。如何让它发挥作用?

这是 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

【问题讨论】:

    标签: python kivy nltk buildozer


    【解决方案1】:

    所以这对你来说太久了,我怀疑你不再关心了,但我遇到了同样的问题,这就是我已经走了多远......

    您需要添加更多的依赖项到您的

    # (list) Application requirements
    requirements = python2,kivy,goslate,chardet,idna,nltk
    

    我认为如果你添加这些,你的应用程序至少会启动......但老实说,我从其他人那里找到的帮助我调试的最好的东西是在你的终端中使用“adb logcat”命令。

    1. 进入您手机的开发者模式,确保“USB 调试已连接”已打开。
    2. 将手机插入电脑并输入 CMD 行类型:adb logcat
    3. 会弹出很多东西,稍等一下,直到它稳定下来。这或多或少会吐出您手机正在执行的所有操作。
    4. 尝试运行您的应用程序并查看它为您提供的错误消息。这是您将获得的最有价值的调试,因为通常应用崩溃不会显示任何错误消息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-23
      • 1970-01-01
      • 1970-01-01
      • 2018-06-21
      • 2021-05-31
      • 2022-09-23
      • 2013-11-19
      • 2021-04-09
      相关资源
      最近更新 更多