Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildozer not working with non-empty __init__.py files #314

Open
jligeza opened this issue Apr 5, 2016 · 4 comments
Open

buildozer not working with non-empty __init__.py files #314

jligeza opened this issue Apr 5, 2016 · 4 comments

Comments

@jligeza
Copy link

jligeza commented Apr 5, 2016

Catalog structure:

|- main.py
|- buildozer.spec
|- code
|--- __init__.py
|--- noob
|------ __init__.py
|------ noob.py

inner init.py:

from noob import NoobButton

noob.py:

from kivy.uix.button import Button


class NoobButton(Button):
    pass

main.py:

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from kivy.app import App
from code.noob import NoobButton


class Test(App):
    def build(self):
        return NoobButton(text='hello')


Test().run()

buildozer.spec:

[app]
title = Noob
package.name = noob_quest
package.domain = org.noob.quest
source.dir = .  
source.include_exts = py,png,jpg,kv,atlas,wav,ttf
version = 1.0.0
requirements = kivy==master
orientation = portrait
android.minapi = 13 
fullscreen = 1 
android.api = 19 

[buildozer] 

log_level = 2 
warn_on_root = 1

Result:

On linux, runs an app with a big button.
On android (android debug deploy run logcat), crashes with this error:

I/python ( 8873): Traceback (most recent call last):
I/python ( 8873): File "/home/stefan/Pulpit/noobquest/.buildozer/android/app/main.py", line 4, in module
I/python ( 8873): ImportError: No module named noob

PS: buildozer 0.31

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@inclement
Copy link
Member

Are all the files present on the device? You can check by e.g. having your app scan and print the directory structure, or with a file browser if you have root access.

@jligeza
Copy link
Author

jligeza commented Apr 5, 2016

I've printed dir structure, and it seems they are present:

I/python ( 9404): code/
I/python ( 9404): init.pyo
I/python ( 9404): noob/
I/python ( 9404): init.pyo
I/python ( 9404): noob.pyo

@jligeza
Copy link
Author

jligeza commented Apr 6, 2016

@inclement I have fixed the problem by renaming code/ to modules/. This is very strange. Why would naming make such big differences?

@inclement
Copy link
Member

Looks like code is a module in the standard library, and it may be that on android we set up the pythonpath in a different order to desktop so that code.py takes priority. That's a small bug if so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants