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

FileNotFoundError: [Errno 2] No such file or directory: '/home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/build/outputs/apk/helloworldapp-debug.apk' #632

Closed
sanezek opened this issue Mar 3, 2018 · 11 comments

Comments

@sanezek
Copy link

sanezek commented Mar 3, 2018

[DEBUG]:   	BUILD SUCCESSFUL
[DEBUG]:   	Total time: 52 seconds
[INFO]:    <- directory context /home/alex/Documents/pengame/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    # Copying APK to current directory
[INFO]:    # Found APK file: /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/bin/Helloworld-1.0-debug.apk
[DEBUG]:   -> running cp /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/bin/Helloworld-1.0-debug.apk ./
b'\nListing /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/wsgiref ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/wsgiref/__init__.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/wsgiref/handlers.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/wsgiref/headers.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/wsgiref/simple_server.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/wsgiref/util.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/wsgiref/validate.py ...\nListing /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/__init__.py ...\nListing /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/dom ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/dom/NodeFilter.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/dom/__init__.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/dom/domreg.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/dom/expatbuilder.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/dom/minicompat.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/dom/minidom.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/dom/pulldom.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/dom/xmlbuilder.py ...\nListing /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/etree ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/etree/ElementInclude.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/etree/ElementPath.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/etree/ElementTree.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/etree/__init__.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/etree/cElementTree.py ...\nListing /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/parsers ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/parsers/__init__.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/parsers/expat.py ...\nListing /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/sax ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/sax/__init__.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.'b'7/xml/sax/_exceptions.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/sax/expatreader.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/sax/handler.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/sax/saxutils.py ...\nCompiling /home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/private/lib/python2.7/xml/sax/xmlreader.py ...\n'Traceback (most recent call last):
  File "/usr/local/bin/buildozer", line 9, in <module>
    load_entry_point('buildozer==0.34', 'console_scripts', 'buildozer')()
  File "/usr/local/lib/python3.4/dist-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/local/lib/python3.4/dist-packages/buildozer/__init__.py", line 1058, in run_command
    self.target.run_commands(args)
  File "/usr/local/lib/python3.4/dist-packages/buildozer/target.py", line 92, in run_commands
    func(args)
  File "/usr/local/lib/python3.4/dist-packages/buildozer/target.py", line 104, in cmd_debug
    self.buildozer.build()
  File "/usr/local/lib/python3.4/dist-packages/buildozer/__init__.py", line 212, in build
    self.target.build_package()
  File "/usr/local/lib/python3.4/dist-packages/buildozer/targets/android.py", line 817, in build_package
    copyfile(join(apk_dir, apk), join(self.buildozer.bin_dir, apk_dest))
  File "/usr/lib/python3.4/shutil.py", line 108, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/home/alex/Documents/pengame/.buildozer/android/platform/build/dists/helloworldapp/build/outputs/apk/helloworldapp-debug.apk'

#312 is didn't help me

@Weffle
Copy link

Weffle commented Mar 19, 2018

Hey! Same thing here.
https://groups.google.com/forum/#!topic/kivy-users/u2Y4A7jPR8U
Hope this gets resolved.

@ghassenw
Copy link

having the same issue as well

@AndreMiras
Copy link
Member

Funnily for another project applying #312 from buildozer==0.33 helped, and now I'm running 0.34 on another project and the issue still occurs. Even though 0.34 includes the fix.
This is for both Python2 (IOError) and Python3 (FileNotFoundError).

@ghassenw
Copy link

happened to me as well. my co worker has the same version of buildozer 0.34 and it works fine for her.but me for some reason one day it decided to stop working correctly and even after i reinstalled ubuntu i still get the same problem

@sjuk
Copy link

sjuk commented Apr 9, 2018

I can confirm the issue when using with python 2 in virtualenv with pip (buildozer==0.34) on Ubuntu 16.04.

@sjuk
Copy link

sjuk commented Apr 9, 2018

I've tried the git version (buildozer==0.35.dev0). The issue retains.

Traceback (most recent call last):
  File "/home/sjuk/env/kivy/bin/buildozer", line 11, in <module>
    load_entry_point('buildozer==0.35.dev0', 'console_scripts', 'buildozer')()
  File "/home/sjuk/env/kivy/lib/python2.7/site-packages/buildozer-0.35.dev0-py2.7.egg/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/home/sjuk/env/kivy/lib/python2.7/site-packages/buildozer-0.35.dev0-py2.7.egg/buildozer/__init__.py", line 1058, in run_command
    self.target.run_commands(args)
  File "/home/sjuk/env/kivy/lib/python2.7/site-packages/buildozer-0.35.dev0-py2.7.egg/buildozer/target.py", line 92, in run_commands
    func(args)
  File "/home/sjuk/env/kivy/lib/python2.7/site-packages/buildozer-0.35.dev0-py2.7.egg/buildozer/target.py", line 104, in cmd_debug
    self.buildozer.build()
  File "/home/sjuk/env/kivy/lib/python2.7/site-packages/buildozer-0.35.dev0-py2.7.egg/buildozer/__init__.py", line 212, in build
    self.target.build_package()
  File "/home/sjuk/env/kivy/lib/python2.7/site-packages/buildozer-0.35.dev0-py2.7.egg/buildozer/targets/android.py", line 822, in build_package
    copyfile(join(apk_dir, apk), join(self.buildozer.bin_dir, apk_dest))
  File "/usr/lib/python2.7/shutil.py", line 82, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: u'/home/sjuk/src/kivy/.buildozer/android/platform/build/dists/myapp/build/outputs/apk/myapp-debug.apk'

@sjuk
Copy link

sjuk commented Apr 9, 2018

When searching for *.apk there are some packages in the following path.buildozer/android/platform/build/dists/myapp/bin. I copied MyApplication-0.1-debug.apk to my android phone, installed it and it worked. But this should be only a workaround.

@mouEsam
Copy link

mouEsam commented May 3, 2018

Faced this sometime ago and had to make a workaroud by changing android.py a
bit
on line 789: which starts with

XXX found how the apk name is really built from the title

    gradle_files = ["build.gradle", "gradle", "gradlew"]
    is_gradle_build = any((exists(join(dist_dir, x)) for x in gradle_files))
    ant_files = ["build.xml", "ant.propeties"]
    is_ant_build = any((exists(join(dist_dir, x)) for x in ant_files))

    if is_gradle_build:
        # on gradle build, the apk use the package name, and have no version
        packagename = config.get('app', 'title')
        apptitle = config.get('app', 'package.name')
        apk = u'{packagename}-{mode}.apk'.format(
            packagename=packagename, mode=mode)
        apk_dir = join(dist_dir, "bin")
        apk_dest = u'{packagename}-{version}-{mode}.apk'.format(
            packagename=packagename.replace(" ", ""), mode=mode, version=version)

    elif is_ant_build:
        # on ant, the apk use the title, and have version
        bl = u'\'" ,'
        apptitle = config.get('app', 'title')
        if hasattr(apptitle, 'decode'):
            apptitle = apptitle.decode('utf-8')
        apktitle = ''.join([x for x in apptitle if x not in bl])
        apk = u'{title}-{version}-{mode}.apk'.format(
            title=apktitle,
            version=version,
            mode=mode)
        apk_dir = join(dist_dir, "bin")
        apk_dest = apk

    # copy to our place
    copyfile(join(apk_dir, apk_dest), join(self.buildozer.bin_dir, apk_dest))

and its been working fine ever since

@ghassenw
Copy link

ghassenw commented May 3, 2018

tried it but it didn't work for me.
which android.py did you change exactly ? i tried the protected one and the other as well but it's the same thing.
would you mind uploading your android.py ?

@mouEsam
Copy link

mouEsam commented May 3, 2018

android.txt
I have anaconda3 istalled I just searched for android.py inside of it, found one and edited it

@inclement
Copy link
Member

Closing as stale, I believe this is fixed now.

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

No branches or pull requests

7 participants