Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/202.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/rust/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用python for android将kivy应用程序编译为apk失败_Python_Android_Kivy_Apk_Mobile Application - Fatal编程技术网

使用python for android将kivy应用程序编译为apk失败

使用python for android将kivy应用程序编译为apk失败,python,android,kivy,apk,mobile-application,Python,Android,Kivy,Apk,Mobile Application,我用python和kivy编写了一个hello world测试应用程序,并尝试将其打包到apk中,但它一直向我显示这个错误,我不明白发生了什么 这是我的代码: import kivy kivy.require('1.11.1') from kivy.app import App from kivy.uix.button import Button class MyApp(App): def build(self): return Button(text = 'Hell

我用python和kivy编写了一个hello world测试应用程序,并尝试将其打包到apk中,但它一直向我显示这个错误,我不明白发生了什么

这是我的代码:

import kivy
kivy.require('1.11.1')

from kivy.app import App
from kivy.uix.button import Button

class MyApp(App):
    def build(self):
        return Button(text = 'Hello World')

if __name__ in ('__android__', '__main__'):
    MyApp().run() 
我尝试使用以下命令编译为apk:

p4a apk --private ./ --package=org.example.easample --name "easample" --version 0.1 --bootstrap=sdl2 --requirements=python3,kivy,pygame
它给出了以下错误消息:

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Exception information:
Traceback (most recent call last):
  File "/home/ea/.local/share/python-for-android/build/venv/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 153, in _main
    status = self.run(options, args)
  File "/home/ea/.local/share/python-for-android/build/venv/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 382, in run
    resolver.resolve(requirement_set)
  File "/home/ea/.local/share/python-for-android/build/venv/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 201, in resolve
    self._resolve_one(requirement_set, req)
  File "/home/ea/.local/share/python-for-android/build/venv/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 365, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/home/ea/.local/share/python-for-android/build/venv/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 313, in _get_abstract_dist_for
    req, self.session, self.finder, self.require_hashes
  File "/home/ea/.local/share/python-for-android/build/venv/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 224, in prepare_linked_requirement
    req, self.req_tracker, finder, self.build_isolation,
  File "/home/ea/.local/share/python-for-android/build/venv/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 49, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(finder, build_isolation)
  File "/home/ea/.local/share/python-for-android/build/venv/lib/python3.6/site-packages/pip/_internal/distributions/source/legacy.py", line 39, in prepare_distribution_metadata
    self.req.prepare_metadata()
  File "/home/ea/.local/share/python-for-android/build/venv/lib/python3.6/site-packages/pip/_internal/req/req_install.py", line 563, in prepare_metadata
    self.metadata_directory = metadata_generator(self)
  File "/home/ea/.local/share/python-for-android/build/venv/lib/python3.6/site-packages/pip/_internal/operations/generate_metadata.py", line 124, in _generate_metadata_legacy
    command_desc='python setup.py egg_info',
  File "/home/ea/.local/share/python-for-android/build/venv/lib/python3.6/site-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess
    raise InstallationError(exc_msg)
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.


  STDERR:

请告诉我需要帮助

你试过在Ubuntu中使用Buildozer吗?没有。我现在就来试试。你用什么操作系统来编译。不要用pygame,把它从要求中去掉。我用的是ubuntu@我现在就把它拿出来。你试过在Ubuntu中使用Buildozer吗?没有。我现在就来试试。你用什么操作系统来编译。不要用pygame,把它从要求中去掉。我用的是ubuntu@我现在就把它拿出来