Kivy和Buildozer的问题

3

我目前正在使用Python 2.7.9版本。我尝试重新安装Cython和更新所有依赖项,但仍然无法解决问题。我不知道Buildozer或Cython的问题所在。该应用程序可以直接从终端运行。

#error Do not use this file, it is the result of a failed Cython compilation.
  ^
 error: command 'ccache' failed with exit status 1

Error compiling Cython file:
------------------------------------------------------------
...
    cpdef release(self)
    cpdef get_pixel_color(self, int wx, int wy)

    cdef void create_fbo(self)
    cdef void delete_fbo(self)
    cdef void apply(self)
                  ^
------------------------------------------------------------

kivy/graphics/fbo.pxd:27:19: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void push_states(self, list names) except *
    cdef void pop_state(self, str name) except *
    cdef void pop_states(self, list names) except *
    cdef void enter(self) except *
    cdef void leave(self) except *
    cdef void apply(self) except *
                  ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:123:19: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
    cpdef release(self)
    cpdef get_pixel_color(self, int wx, int wy)

    cdef void create_fbo(self)
    cdef void delete_fbo(self)
    cdef void apply(self)
                  ^
------------------------------------------------------------

kivy/graphics/fbo.pxd:27:19: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void push_states(self, list names) except *
    cdef void pop_state(self, str name) except *
    cdef void pop_states(self, list names) except *
    cdef void enter(self) except *
    cdef void leave(self) except *
    cdef void apply(self) except *
                  ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:123:19: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void stop(self):
        '''Stop using the shader.
        '''
        glUseProgram(0)

    cdef void set_uniform(self, str name, value):
        ^
------------------------------------------------------------

kivy/graphics/shader.pyx:233:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef dict uniform_locations
    cdef dict uniform_values

    cdef void use(self)
    cdef void stop(self)
    cdef void set_uniform(self, str name, value) except *
                        ^
------------------------------------------------------------

kivy/graphics/shader.pxd:29:25: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
        if name in self.uniform_values and self.uniform_values[name] == value:
            return
        self.uniform_values[name] = value
        self.upload_uniform(name, value)

    cdef void upload_uniform(self, str name, value):
        ^
------------------------------------------------------------

kivy/graphics/shader.pyx:239:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef dict uniform_values

    cdef void use(self)
    cdef void stop(self)
    cdef void set_uniform(self, str name, value) except *
    cdef void upload_uniform(self, str name, value) except *
                           ^
------------------------------------------------------------

kivy/graphics/shader.pxd:30:28: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
        cdef GLfloat mat[16]
        for x in xrange(16):
            mat[x] = <GLfloat>value.mat[x]
        glUniformMatrix4fv(loc, 1, False, mat)

    cdef int get_uniform_loc(self, str name):
        ^
------------------------------------------------------------

kivy/graphics/shader.pyx:424:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void use(self)
    cdef void stop(self)
    cdef void set_uniform(self, str name, value) except *
    cdef void upload_uniform(self, str name, value) except *
    cdef void upload_uniform_matrix(self, int loc, Matrix value)
    cdef int get_uniform_loc(self, str name) except *
                           ^
------------------------------------------------------------

kivy/graphics/shader.pxd:32:28: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
                glEnableVertexAttribArray(attr.index)

        # save for the next run.
        self._current_vertex_format = vertex_format

    cdef void build(self):
        ^
------------------------------------------------------------

kivy/graphics/shader.pyx:465:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void stop(self)
    cdef void set_uniform(self, str name, value) except *
    cdef void upload_uniform(self, str name, value) except *
    cdef void upload_uniform_matrix(self, int loc, Matrix value)
    cdef int get_uniform_loc(self, str name) except *
    cdef void build(self) except *
                  ^
------------------------------------------------------------

kivy/graphics/shader.pxd:33:19: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...

    cdef void build(self):
        self.build_vertex()
        self.build_fragment()

    cdef void build_vertex(self, int link=1):
        ^
------------------------------------------------------------

kivy/graphics/shader.pyx:469:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void set_uniform(self, str name, value) except *
    cdef void upload_uniform(self, str name, value) except *
    cdef void upload_uniform_matrix(self, int loc, Matrix value)
    cdef int get_uniform_loc(self, str name) except *
    cdef void build(self) except *
    cdef void build_vertex(self, int link=*) except *
                         ^
------------------------------------------------------------

kivy/graphics/shader.pxd:34:26: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
        if self.vertex_shader is not None:
            glAttachShader(self.program, self.vertex_shader.shader)
        if link:
            self.link_program()

    cdef void build_fragment(self, int link=1):
        ^
------------------------------------------------------------

kivy/graphics/shader.pyx:479:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void upload_uniform(self, str name, value) except *
    cdef void upload_uniform_matrix(self, int loc, Matrix value)
    cdef int get_uniform_loc(self, str name) except *
    cdef void build(self) except *
    cdef void build_vertex(self, int link=*) except *
    cdef void build_fragment(self, int link=*) except *
                           ^
------------------------------------------------------------

kivy/graphics/shader.pxd:35:28: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
        if self.fragment_shader is not None:
            glAttachShader(self.program, self.fragment_shader.shader)
        if link:
            self.link_program()

    cdef void link_program(self):
        ^
------------------------------------------------------------

kivy/graphics/shader.pyx:489:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void upload_uniform_matrix(self, int loc, Matrix value)
    cdef int get_uniform_loc(self, str name) except *
    cdef void build(self) except *
    cdef void build_vertex(self, int link=*) except *
    cdef void build_fragment(self, int link=*) except *
    cdef void link_program(self) except *
                         ^
------------------------------------------------------------

kivy/graphics/shader.pxd:36:26: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
    cpdef release(self)
    cpdef get_pixel_color(self, int wx, int wy)

    cdef void create_fbo(self)
    cdef void delete_fbo(self)
    cdef void apply(self)
                  ^
------------------------------------------------------------

kivy/graphics/fbo.pxd:27:19: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void push_states(self, list names) except *
    cdef void pop_state(self, str name) except *
    cdef void pop_states(self, list names) except *
    cdef void enter(self) except *
    cdef void leave(self) except *
    cdef void apply(self) except *
                  ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:123:19: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
    cpdef release(self)
    cpdef get_pixel_color(self, int wx, int wy)

    cdef void create_fbo(self)
    cdef void delete_fbo(self)
    cdef void apply(self)
                  ^
------------------------------------------------------------

kivy/graphics/fbo.pxd:27:19: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void push_states(self, list names) except *
    cdef void pop_state(self, str name) except *
    cdef void pop_states(self, list names) except *
    cdef void enter(self) except *
    cdef void leave(self) except *
    cdef void apply(self) except *
                  ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:123:19: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
        elif self._stencilbuffer_attached:
            glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)
        else:
            glClear(GL_COLOR_BUFFER_BIT)

    cdef void apply(self):
        ^
------------------------------------------------------------

kivy/graphics/fbo.pyx:326:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void push_states(self, list names) except *
    cdef void pop_state(self, str name) except *
    cdef void pop_states(self, list names) except *
    cdef void enter(self) except *
    cdef void leave(self) except *
    cdef void apply(self) except *
                  ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:123:19: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
    cpdef release(self)
    cpdef get_pixel_color(self, int wx, int wy)

    cdef void create_fbo(self)
    cdef void delete_fbo(self)
    cdef void apply(self)
                  ^
------------------------------------------------------------

kivy/graphics/fbo.pxd:27:19: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void push_states(self, list names) except *
    cdef void pop_state(self, str name) except *
    cdef void pop_states(self, list names) except *
    cdef void enter(self) except *
    cdef void leave(self) except *
    cdef void apply(self) except *
                  ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:123:19: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
    cpdef release(self)
    cpdef get_pixel_color(self, int wx, int wy)

    cdef void create_fbo(self)
    cdef void delete_fbo(self)
    cdef void apply(self)
                  ^
------------------------------------------------------------

kivy/graphics/fbo.pxd:27:19: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void push_states(self, list names) except *
    cdef void pop_state(self, str name) except *
    cdef void pop_states(self, list names) except *
    cdef void enter(self) except *
    cdef void leave(self) except *
    cdef void apply(self) except *
                  ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:123:19: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
        if self.context_state:
            context.set_states(self.context_state)
        if self.context_pop:
            context.pop_states(self.context_pop)

    cdef void set_state(self, str name, value):
        ^
------------------------------------------------------------

kivy/graphics/instructions.pyx:258:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef dict context_state
    cdef list context_push
    cdef list context_pop

    cdef RenderContext get_context(self)
    cdef void set_state(self, str name, value) except *
                      ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:61:23: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...

    cdef void set_state(self, str name, value):
        self.context_state[name] = value
        self.flag_update()

    cdef void push_state(self, str name):
        ^
------------------------------------------------------------

kivy/graphics/instructions.pyx:262:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef list context_push
    cdef list context_pop

    cdef RenderContext get_context(self)
    cdef void set_state(self, str name, value) except *
    cdef void push_state(self, str name) except *
                       ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:62:24: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...

    cdef void push_state(self, str name):
        self.context_push.append(name)
        self.flag_update()

    cdef void pop_state(self, str name):
        ^
------------------------------------------------------------

kivy/graphics/instructions.pyx:266:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef list context_pop

    cdef RenderContext get_context(self)
    cdef void set_state(self, str name, value) except *
    cdef void push_state(self, str name) except *
    cdef void pop_state(self, str name) except *
                      ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:63:23: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
        self._shader.set_uniform(name, value)

    cdef get_state(self, str name):
        return self.state_stacks[name][-1]

    cdef void set_states(self, dict states):
        ^
------------------------------------------------------------

kivy/graphics/instructions.pyx:789:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef int _use_parent_modelview

    cdef void set_texture(self, int index, Texture texture)
    cdef void set_state(self, str name, value, int apply_now=?)
    cdef get_state(self, str name)
    cdef void set_states(self, dict states) except *
                       ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:116:24: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void set_states(self, dict states):
        cdef str name
        for name, value in states.iteritems():
            self.set_state(name, value)

    cdef void push_state(self, str name):
        ^
------------------------------------------------------------

kivy/graphics/instructions.pyx:794:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...

    cdef void set_texture(self, int index, Texture texture)
    cdef void set_state(self, str name, value, int apply_now=?)
    cdef get_state(self, str name)
    cdef void set_states(self, dict states) except *
    cdef void push_state(self, str name) except *
                       ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:117:24: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void push_state(self, str name):
        stack = self.state_stacks[name]
        stack.append(stack[-1])
        self.flag_update()

    cdef void push_states(self, list names):
        ^
------------------------------------------------------------

kivy/graphics/instructions.pyx:799:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void set_texture(self, int index, Texture texture)
    cdef void set_state(self, str name, value, int apply_now=?)
    cdef get_state(self, str name)
    cdef void set_states(self, dict states) except *
    cdef void push_state(self, str name) except *
    cdef void push_states(self, list names) except *
                        ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:118:25: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void push_states(self, list names):
        cdef str name
        for name in names:
            self.push_state(name)

    cdef void pop_state(self, str name):
        ^
------------------------------------------------------------

kivy/graphics/instructions.pyx:804:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void set_state(self, str name, value, int apply_now=?)
    cdef get_state(self, str name)
    cdef void set_states(self, dict states) except *
    cdef void push_state(self, str name) except *
    cdef void push_states(self, list names) except *
    cdef void pop_state(self, str name) except *
                      ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:119:23: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
        oldvalue = stack.pop()
        if oldvalue != stack[-1]:
            self.set_state(name, stack[-1])
            self.flag_update()

    cdef void pop_states(self, list names):
        ^
------------------------------------------------------------

kivy/graphics/instructions.pyx:811:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef get_state(self, str name)
    cdef void set_states(self, dict states) except *
    cdef void push_state(self, str name) except *
    cdef void push_states(self, list names) except *
    cdef void pop_state(self, str name) except *
    cdef void pop_states(self, list names) except *
                       ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:120:24: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
            _active_texture = index
            glActiveTexture(GL_TEXTURE0 + index)
        texture.bind()
        self.flag_update()

    cdef void enter(self):
        ^
------------------------------------------------------------

kivy/graphics/instructions.pyx:831:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void set_states(self, dict states) except *
    cdef void push_state(self, str name) except *
    cdef void push_states(self, list names) except *
    cdef void pop_state(self, str name) except *
    cdef void pop_states(self, list names) except *
    cdef void enter(self) except *
                  ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:121:19: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
        self.flag_update()

    cdef void enter(self):
        self._shader.use()

    cdef void leave(self):
        ^
------------------------------------------------------------

kivy/graphics/instructions.pyx:834:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void push_state(self, str name) except *
    cdef void push_states(self, list names) except *
    cdef void pop_state(self, str name) except *
    cdef void pop_states(self, list names) except *
    cdef void enter(self) except *
    cdef void leave(self) except *
                  ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:122:19: Previous declaration is here

Error compiling Cython file:
------------------------------------------------------------
...
        self._shader.use()

    cdef void leave(self):
        self._shader.stop()

    cdef void apply(self):
        ^
------------------------------------------------------------

kivy/graphics/instructions.pyx:837:9: 'apply' already defined

Error compiling Cython file:
------------------------------------------------------------
...
        self._shader.use()

    cdef void leave(self):
        self._shader.stop()

    cdef void apply(self):
        ^
------------------------------------------------------------

kivy/graphics/instructions.pyx:837:9: Signature not compatible with previous declaration

Error compiling Cython file:
------------------------------------------------------------
...
    cdef void push_states(self, list names) except *
    cdef void pop_state(self, str name) except *
    cdef void pop_states(self, list names) except *
    cdef void enter(self) except *
    cdef void leave(self) except *
    cdef void apply(self) except *
                  ^
------------------------------------------------------------

kivy/graphics/instructions.pxd:123:19: Previous declaration is here
 /home/sterilistic/Desktop/PongApp/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'dependency_links'
   warnings.warn(msg)
 /home/sterilistic/Desktop/PongApp/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
   warnings.warn(msg)

Cython check avoided.
Using this graphics system: OpenGL ES 2
running build_ext
Build configuration is:
 * use_rpi = 0
 * use_opengl_es2 = 1
 * use_opengl_debug = 0
 * use_glew = 0
 * use_sdl2 = 0
 * use_ios = 0
 * use_mesagl = 0
 * use_x11 = 0
 * use_gstreamer = 0
 * use_avfoundation = 0
 * use_osx_frameworks = 0
 * debug = False
Detected compiler is unix
building 'kivy.graphics.opengl' extension

kivy/graphics/vbo.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
 #error Do not use this file, it is the result of a failed Cython compilation.
  ^
 error: command 'ccache' failed with exit status 1
# Command failed: ./distribute.sh -m "kivy" -d "myapp"
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
2个回答

2
这是一个与Cython版本不兼容的问题。尝试使用kivy的主分支(在buildozer.spec添加)并确保通过删除应用程序目录中的.buildozer目录使buildozer重新下载python-for-android。不要删除home dir中的一个,这包含(更大的)Android SDK和NDK,您不想再次下载它们。

1
对我而言,那解决了我的问题!如果有人不清楚@inclement在哪里指出要在buildozer.spec文件中放置kyvy==master,确切的位置是在其说“requirements = kivy”处,应该改为“requirements = kivy == master”。 - aesede

0
sudo apt-get install cython

问题已经解决 :)


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接