Creating APK from Kivy on Mac OS X fails after compile
Question: My background is in HTML/JS, so compiling is new for me. While attempting to
build my python project in Kivy to an Android .apk, I am getting an error I do
not understand:

    
    
    Command failed: ./distribute.sh -m "kivy"
    

Here is a portion of the tail end of the debug output...

    
    
    Compiling /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/xmllib.py ...
    Compiling /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/xmlrpclib.py ...
    Compiling /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/zipfile.py ...
    make: [libinstall] Error 1 (ignored)
    PYTHONPATH=/Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7  LD_LIBRARY_PATH=/Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python/Python-2.7.2: \
            /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python/Python-2.7.2/hostpython -Wi -t /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/compileall.py \
            -d /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages -f \
            -x badsyntax /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages
    Listing /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages ...
    PYTHONPATH=/Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7 LD_LIBRARY_PATH=/Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python/Python-2.7.2: \
            /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python/Python-2.7.2/hostpython -Wi -t -O /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/compileall.py \
            -d /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages -f \
            -x badsyntax /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages
    Listing /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages ...
    PYTHONPATH=/Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7 LD_LIBRARY_PATH=/Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python/Python-2.7.2: \
            /Users/Travis/buildozer/.buildozer/android/platform/python-for-android/build/python/Python-2.7.2/hostpython -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
    Leaving ARM environment
    cp: build/lib.linux-x86_64-2.7/_ctypes*.so: No such file or directory
    # 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
    

Here is the full debug, for those who want it...

<https://www.dropbox.com/s/45lgdhk5y4uj8eg/KivyDebug.txt?dl=1>

Also, my buildozer.spec file...

<https://www.dropbox.com/s/g5p43jjts49rzza/buildozer.spec?dl=1>

EDIT: Downgrading Cython per the advice
[HERE](http://stackoverflow.com/a/29140927/4096787) did not help. EDIT2: Tried
changing requirements to kivy==master. No luck. EDIT3: Tried chmod -R 777 on
both source and buildozer folders. No luck.


Answer: OK, I came across the answer to my own problem a while ago and I'm posting it
here in case someone else makes the same boneheaded mistake. Basically, I did
not read the instructions carefully enough in [the
documentation](http://kivy.org/docs/guide/packaging-android.html). The
instructions clearly state "**navigate to your project directory** and run:
buildozer init". I did not navigate to the project folder. I was building in
my user directory, hence "/Users/Travis/". Hence the "No such file or
directory" error.

You may be asking "How do you expect buildozer to know where your project is?"

Well, the next step says to configure "buildozer.spec", and in there, there is
a place to put your path to the main.py, which by default is ".", so I changed
that. It actually worked up to the point that it has to write any files.

So, if you're having the same issue as me, you might just need to read more
carefully.

