Kivy-建立一个APK

时间:2014-04-28 18:43:13

标签: python permissions apk kivy

初始问题

我使用kivy库在python中编写了一个应用程序,并且已经到了我想要在我的Android设备上运行APK的阶段。正如kivy网站上所建议的,我运行以下内容:

buildozer android debug 

但是得到这个追溯:

Traceback (most recent call last):
  File "/usr/local/bin/buildozer", line 9, in <module>
    load_entry_point('buildozer==0.15-dev', 'console_scripts', 'buildozer')()
  File "/usr/local/lib/python2.7/dist-packages/buildozer-0.15_dev-py2.7.egg/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/local/lib/python2.7/dist-packages/buildozer-0.15_dev-py2.7.egg/buildozer/__init__.py", line 957, in run_command
    self.target.run_commands(args)
  File "/usr/local/lib/python2.7/dist-packages/buildozer-0.15_dev-py2.7.egg/buildozer/target.py", line 85, in run_commands
    func(args)
  File "/usr/local/lib/python2.7/dist-packages/buildozer-0.15_dev-py2.7.egg/buildozer/target.py", line 95, in cmd_debug
    self.buildozer.prepare_for_build()
  File "/usr/local/lib/python2.7/dist-packages/buildozer-0.15_dev-py2.7.egg/buildozer/__init__.py", line 163, in prepare_for_build
    self.check_garden_requirements()
  File "/usr/local/lib/python2.7/dist-packages/buildozer-0.15_dev-py2.7.egg/buildozer/__init__.py", line 477, in check_garden_requirements
    self.state['cache.gardenlibs'] = garden_requirements
  File "/usr/local/lib/python2.7/dist-packages/buildozer-0.15_dev-py2.7.egg/buildozer/jsonstore.py", line 33, in __setitem__
    self.sync()
  File "/usr/local/lib/python2.7/dist-packages/buildozer-0.15_dev-py2.7.egg/buildozer/jsonstore.py", line 54, in sync
    with io.open(self.filename, 'w', encoding='utf-8') as fd:
IOError: [Errno 13] Permission denied: '/home/linuxlite/abc/.buildozer/state.db'

我可以看到这是一个权限问题,如果有人能就修复它提出一些建议,我将不胜感激。


修改

修复权限问题后,我现在得到以下内容:

# Command failed: /usr/bin/python build.py --name myapp --version 1.2.0 --package org.test.myapp --private /home/linuxlite/abc/.buildozer/android/app --sdk 14 --minsdk 8 --orientation landscape debug

1 个答案:

答案 0 :(得分:0)

您最初的问题的解决方案是使用chown命令,如下所示:

sudo chown -R $USER:`groups | awk '{print $1}'` ~/.buildozer .

这会将您的全局构建器配置和项目的权限重置为您自己的用户和组。从这一点开始,请不要将sudo与buildozer一起使用。事实上,考虑将sudo用于除安装之外的任何事情都是 BAD THING

至于你的新问题,我不确定这里发生了什么 - 我自己也遇到了同样的问题,这是我发现你问题的地方。如果我到底了,我将更新这个答案。