How do i convert p4a distribution to apk?









up vote
0
down vote

favorite












I have a simple python-kivy program that I finally got python-for-android to run
all the way through. One of the last things p4a kicked out was:



Dist can be found at (for now) /home/username/.local/share/python-for-android/dists/unnamed_dist_1


The Getting Started documentation for p4a says "A distribution is the final “build” of all your compiled requirements, as an Android project that can be turned directly into an APK." So I assume there is another step. I'm just not sure what it is.



I followed the "hello world" example in the p4a documentation, but at step 4, it says "go to the python-for-android directory", where on earth is that? it does not exist on my system. Assuming I find that directory it goes on to say type ./distribute.sh -m kivy. There is no file named distribute.sh on my system. My question then is, how do I convert the distribution (files in the directory they gave me) into an APK to put on my phone.
I'm using Ubuntu 18.04 in a VM, with Python 3.6 and Python 2.7. Kivy==1.10.1, the command I'm typing is p4a apk -v --sdk_dir /home/username/kivy --android_api 21. The contents of .p4a is:



--requirements=sdl2,python3crystax,kivy
--private /home/username/kivy/
--package=org.myapp
--name="myapp"
--version=0.5
--bootstrap=sdl2
--permission INTERNET, WRITE_EXTERNAL_STORAGE
--ndk-dir /home/username/kivy/crystax-10.3.2
--sdk-kir /home/username/kivy/tools
--arch=armeabi-v7a


The name of my project directory is 'kivy'. And I'm using Crystax-NDK



the logs



[INFO]: Reading .p4a configuration
[INFO]: Will compile for the following archs: armeabi-v7a
[INFO]: Getting Android API version from user argument
[INFO]: Available Android APIs are (21)
[INFO]: Requested API target 21 is available, continuing.
[INFO]: Getting NDK dir from from user argument
[INFO]: Got NDK version from $ANDROIDNDKVER
[INFO]: Got Android NDK version from the NDK dir: it is 10.3.2
[WARNING]: NDK API target was not set manually, using the default of 21 = min(android-api=21, default ndk-api=21)
[INFO]: Using Crystax NDK 10.3.2
[INFO]: Found virtualenv at /usr/bin/virtualenv
[INFO]: ccache is missing, the build will not be optimized in the future.
[INFO]: Found the following toolchain versions: ['4.9', '5', 'clang3.6', 'clang3.7']
[INFO]: Picking the latest gcc toolchain, here 5
[INFO]: No existing dists meet the given requirements!
[INFO]: No dist exists that meets your requirements, so one will be built.
[INFO]: Found a single valid recipe set: ['hostpython3crystax', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python3crystax', 'sdl2', 'six', 'pyjnius', 'kivy']
[INFO]: The selected bootstrap is sdl2
[INFO]: # Creating dist with sdl2 bootstrap
[INFO]: Dist will have name unnamed_dist_2 and recipes (sdl2, python3crystax, kivy)
[INFO]: Dist will also contain modules () installed from pip
[INFO]: -> running cp -r /usr/local/lib/python3.6/dist-packages/pythonforandroid/boo...(and 103 more)
[INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax
[INFO]: <- directory context /home/oli/kivy
[INFO]: Recipe build order is ['hostpython3crystax', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python3crystax', 'sdl2', 'six', 'pyjnius', 'kivy']
[INFO]: # Downloading recipes
[INFO]: Downloading hostpython3crystax
[INFO]: Skipping hostpython3crystax download as no URL is set
[INFO]: Downloading sdl2_image
[INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/sdl2_image
[INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/sdl2_image
[INFO]: -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.tar.gz
[INFO]: sdl2_image download already cached, skipping
[INFO]: <- directory context /home/oli/kivy
[INFO]: Downloading sdl2_mixer
[INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/sdl2_mixer
[INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/sdl2_mixer
[INFO]: -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
[INFO]: sdl2_mixer download already cached, skipping
[INFO]: <- directory context /home/oli/kivy
[INFO]: Downloading sdl2_ttf
[INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/sdl2_ttf
[INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/sdl2_ttf
[INFO]: -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
[INFO]: sdl2_ttf download already cached, skipping
[INFO]: <- directory context /home/oli/kivy
[INFO]: Downloading python3crystax
[INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/python3crystax
[INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/python3crystax
[INFO]: -> running basename
[INFO]: -> running rm -f .mark-
[INFO]: -> running touch .mark-
[INFO]: <- directory context /home/oli/kivy
[INFO]: Downloading sdl2
[INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/sdl2
[INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/sdl2
[INFO]: -> running basename https://www.libsdl.org/release/SDL2-2.0.4.tar.gz
[INFO]: sdl2 download already cached, skipping
[INFO]: <- directory context /home/oli/kivy
[INFO]: Downloading six
[INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/six
[INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/six
[INFO]: -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
[INFO]: six download already cached, skipping
[INFO]: <- directory context /home/oli/kivy
[INFO]: Downloading pyjnius
[INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/pyjnius
[INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/pyjnius
[INFO]: -> running basename https://github.com/kivy/pyjnius/archive/1.1.3.zip
[INFO]: pyjnius download already cached, skipping
[INFO]: <- directory context /home/oli/kivy
[INFO]: Downloading kivy
[INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/kivy
[INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/kivy
[INFO]: -> running basename https://github.com/kivy/kivy/archive/1.10.1.zip
[INFO]: kivy download already cached, skipping
[INFO]: <- directory context /home/oli/kivy
[INFO]: # Building all recipes for arch armeabi-v7a
[INFO]: # Unpacking recipes
[INFO]: Unpacking hostpython3crystax for armeabi-v7a
[INFO]: Skipping hostpython3crystax unpack as no URL is set
[INFO]: Unpacking sdl2_image for armeabi-v7a
[INFO]: -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.tar.gz
[INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
[INFO]: sdl2_image is already unpacked, skipping
[INFO]: <- directory context /home/oli/kivy
[INFO]: Unpacking sdl2_mixer for armeabi-v7a
[INFO]: -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
[INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
[INFO]: sdl2_mixer is already unpacked, skipping
[INFO]: <- directory context /home/oli/kivy
[INFO]: Unpacking sdl2_ttf for armeabi-v7a
[INFO]: -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
[INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
[INFO]: sdl2_ttf is already unpacked, skipping
[INFO]: <- directory context /home/oli/kivy
[INFO]: Unpacking python3crystax for armeabi-v7a
[INFO]: -> running basename
[INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/python3crystax-version3.6/armeabi-v7a__ndk_target_21
[INFO]: python3crystax is already unpacked, skipping
[INFO]: <- directory context /home/oli/kivy
[INFO]: Unpacking sdl2 for armeabi-v7a
[INFO]: -> running basename https://www.libsdl.org/release/SDL2-2.0.4.tar.gz
[INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
[INFO]: sdl2 is already unpacked, skipping
[INFO]: <- directory context /home/oli/kivy
[INFO]: Unpacking six for armeabi-v7a
[INFO]: -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
[INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/six-python3crystax/armeabi-v7a__ndk_target_21
[INFO]: six is already unpacked, skipping
[INFO]: <- directory context /home/oli/kivy
[INFO]: Unpacking pyjnius for armeabi-v7a
[INFO]: -> running basename https://github.com/kivy/pyjnius/archive/1.1.3.zip
[INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21
[INFO]: pyjnius is already unpacked, skipping
[INFO]: <- directory context /home/oli/kivy
[INFO]: Unpacking kivy for armeabi-v7a
[INFO]: -> running basename https://github.com/kivy/kivy/archive/1.10.1.zip
[INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a__ndk_target_21
[INFO]: kivy is already unpacked, skipping
[INFO]: <- directory context /home/oli/kivy
[INFO]: # Prebuilding recipes
[INFO]: Prebuilding hostpython3crystax for armeabi-v7a
[INFO]: hostpython3crystax has no prebuild_armeabi_v7a, skipping
[INFO]: Prebuilding sdl2_image for armeabi-v7a
[INFO]: sdl2_image has no prebuild_armeabi_v7a, skipping
[INFO]: Applying patches for sdl2_image[armeabi-v7a]
[INFO]: sdl2_image already patched, skipping
[INFO]: Prebuilding sdl2_mixer for armeabi-v7a
[INFO]: sdl2_mixer has no prebuild_armeabi_v7a, skipping
[INFO]: Applying patches for sdl2_mixer[armeabi-v7a]
[INFO]: sdl2_mixer already patched, skipping
[INFO]: Prebuilding sdl2_ttf for armeabi-v7a
[INFO]: sdl2_ttf has no prebuild_armeabi_v7a, skipping
[INFO]: Prebuilding python3crystax for armeabi-v7a
[INFO]: python3crystax has no prebuild_armeabi_v7a, skipping
[INFO]: Prebuilding sdl2 for armeabi-v7a
[INFO]: sdl2 has no prebuild_armeabi_v7a, skipping
[INFO]: Applying patches for sdl2[armeabi-v7a]
[INFO]: sdl2 already patched, skipping
[INFO]: Prebuilding six for armeabi-v7a
[INFO]: six has no prebuild_armeabi_v7a, skipping
[INFO]: Prebuilding pyjnius for armeabi-v7a
[INFO]: pyjnius has no prebuild_armeabi_v7a, skipping
[INFO]: Applying patches for pyjnius[armeabi-v7a]
[INFO]: pyjnius already patched, skipping
[INFO]: Prebuilding kivy for armeabi-v7a
[INFO]: kivy has no prebuild_armeabi_v7a, skipping
[INFO]: # Building recipes
[INFO]: Building hostpython3crystax for armeabi-v7a
[INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/build/other_bu...(and 56 more)
[INFO]: -> running ln -sf /usr/bin/python3.6 /home/oli/.local/share/python-for-andro...(and 78 more)
[INFO]: Building sdl2_image for armeabi-v7a
[INFO]: Building sdl2_mixer for armeabi-v7a
[INFO]: Building sdl2_ttf for armeabi-v7a
[INFO]: Building python3crystax for armeabi-v7a
[INFO]: Building sdl2 for armeabi-v7a
[INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
[INFO]: -> running ndk-build V=1
[INFO]: <- directory context /home/oli/kivy
[INFO]: Building six for armeabi-v7a
[INFO]: six apparently isn't already in site-packages
[INFO]: Installing six into site-packages
[INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/six-python3crystax/armeabi-v7a__ndk_target_21/six
[INFO]: -> running python3.6 setup.py install -O2 --root=/home/oli/.local/share/pyth...(and 67 more)
[INFO]: <- directory context /home/oli/kivy
[INFO]: Building pyjnius for armeabi-v7a
[INFO]: jnius apparently isn't already in site-packages
[INFO]: Cythonizing anything necessary in pyjnius
[INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21/pyjnius
[INFO]: -> running python3.6 -c import sys; print(sys.path)
[INFO]: Trying first build of pyjnius to get cython files: this is expected to fail
[INFO]: -> running python3.6 setup.py build_ext -v
cwd is /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21/pyjnius
[INFO]: First build appeared to complete correctly, skipping manualcythonising.
[INFO]: Stripping object files
[INFO]: -> running find . -iname *.so -exec /usr/bin/echo ;
[INFO]: -> running find . -iname *.so -exec arm-linux-androideabi-strip --strip-unneeded ;
[INFO]: <- directory context /home/oli/kivy
[INFO]: Installing pyjnius into site-packages
[INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21/pyjnius
[INFO]: -> running hostpython setup.py install -O2 --root=/home/oli/.local/share/pyt...(and 68 more)
[INFO]: <- directory context /home/oli/kivy
[INFO]: Building kivy for armeabi-v7a
[INFO]: kivy apparently isn't already in site-packages
[INFO]: Cythonizing anything necessary in kivy
[INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a__ndk_target_21/kivy
[INFO]: -> running python3.6 -c import sys; print(sys.path)
[INFO]: Trying first build of kivy to get cython files: this is expected to fail
[INFO]: -> running python3.6 setup.py build_ext -v
cwd is /home/oli/.local/share/python-for-android/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a__ndk_target_21/kivy
[INFO]: First build appeared to complete correctly, skipping manualcythonising.
[INFO]: Stripping object files
[INFO]: -> running find . -iname *.so -exec /usr/bin/echo ;
[INFO]: -> running find . -iname *.so -exec arm-linux-androideabi-strip --strip-unneeded ;
[INFO]: <- directory context /home/oli/kivy
[INFO]: Installing kivy into site-packages
[INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a__ndk_target_21/kivy
[INFO]: -> running hostpython setup.py install -O2 --root=/home/oli/.local/share/pyt...(and 68 more)
[INFO]: <- directory context /home/oli/kivy
[INFO]: # Biglinking object files
[INFO]: NDK is crystax, skipping biglink (will this work?)
[INFO]: # Postbuilding recipes
[INFO]: Postbuilding hostpython3crystax for armeabi-v7a
[INFO]: Postbuilding sdl2_image for armeabi-v7a
[INFO]: Postbuilding sdl2_mixer for armeabi-v7a
[INFO]: Postbuilding sdl2_ttf for armeabi-v7a
[INFO]: Postbuilding python3crystax for armeabi-v7a
[INFO]: Postbuilding sdl2 for armeabi-v7a
[INFO]: Postbuilding six for armeabi-v7a
[INFO]: Postbuilding pyjnius for armeabi-v7a
[INFO]: Copying pyjnius java class to classes build dir
[INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21/pyjnius
[INFO]: -> running cp -a jnius/src/org /home/oli/.local/share/python-for-android/bui...(and 29 more)
[INFO]: <- directory context /home/oli/kivy
[INFO]: Postbuilding kivy for armeabi-v7a
[INFO]: # Installing pure Python modules
[INFO]: There are no Python modules to install, skipping
[INFO]: # Creating Android project (sdl2)
[INFO]: Copying SDL2/gradle build for armeabi-v7a
[INFO]: -> running rm -rf /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
[INFO]: -> running cp -r /home/oli/.local/share/python-for-android/build/bootstrap_b...(and 88 more)
[INFO]: -> directory context /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
[INFO]: <- directory context /home/oli/kivy
[INFO]: -> directory context /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
[INFO]: Copying Python distribution
[INFO]: Copying libs
[INFO]: Copying java files
[INFO]: -> running cp -a /home/oli/.local/share/python-for-android/build/javaclasses...(and 29 more)
[INFO]: -> running cp -r /home/oli/kivy/crystax-ndk-10.3.2/sources/python/3.6/libs/a...(and 114 more)
[INFO]: -> running cp -r /home/oli/kivy/crystax-ndk-10.3.2/sources/python/3.6/libs/a...(and 111 more)
[INFO]: -> running cp -r /home/oli/.local/share/python-for-android/build/python-inst...(and 126 more)
[INFO]: Renaming .so files to reflect cross-compile
[INFO]: -> running find /home/oli/.local/share/python-for-android/dists/unnamed_dist...(and 58 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 210 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 216 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 246 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 252 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 258 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 222 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 228 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 222 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 232 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 222 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 230 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 240 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 222 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 228 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 244 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 228 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 240 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 230 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 254 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 236 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 228 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 258 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 244 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 246 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 238 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 240 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 238 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 240 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 218 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 210 more)
[INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 210 more)
[INFO]: <- directory context /home/oli/kivy
[INFO]: Stripping libraries
[INFO]: Python was loaded from CrystaX, skipping strip
[INFO]: Frying eggs in /home/oli/.local/share/python-for-android/dists/unnamed_dist_2/_python_bundle/_python_bundle/site-packages
[INFO]: -> directory context /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
[INFO]: Saving distribution info
[INFO]: <- directory context /home/oli/kivy
[INFO]: # Your distribution was created successfully, exiting.
[INFO]: Dist can be found at (for now) /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
[INFO]: No existing dists meet the given requirements!
Traceback (most recent call last):
File "/usr/local/bin/p4a", line 11, in <module>
load_entry_point('python-for-android==0.6.0', 'console_scripts', 'p4a')()
File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 1010, in main
ToolchainCL()
File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 541, in __init__
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 148, in wrapper_func
func(self, args)
File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 779, in apk
build = imp.load_source('build', join(dist.dist_dir, 'build.py'))
File "/usr/lib/python3.6/imp.py", line 172, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 684, in _load
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 674, in exec_module
File "<frozen importlib._bootstrap_external>", line 780, in get_code
File "/usr/lib/python3.6/imp.py", line 158, in get_data
return super().get_data(path)
File "<frozen importlib._bootstrap_external>", line 832, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/home/oli/.local/share/python-for-android/dists/unnamed_dist_3/build.py'



it looks like I've added an error. why would it be looking in "unnamed_dist_2"?










share|improve this question



























    up vote
    0
    down vote

    favorite












    I have a simple python-kivy program that I finally got python-for-android to run
    all the way through. One of the last things p4a kicked out was:



    Dist can be found at (for now) /home/username/.local/share/python-for-android/dists/unnamed_dist_1


    The Getting Started documentation for p4a says "A distribution is the final “build” of all your compiled requirements, as an Android project that can be turned directly into an APK." So I assume there is another step. I'm just not sure what it is.



    I followed the "hello world" example in the p4a documentation, but at step 4, it says "go to the python-for-android directory", where on earth is that? it does not exist on my system. Assuming I find that directory it goes on to say type ./distribute.sh -m kivy. There is no file named distribute.sh on my system. My question then is, how do I convert the distribution (files in the directory they gave me) into an APK to put on my phone.
    I'm using Ubuntu 18.04 in a VM, with Python 3.6 and Python 2.7. Kivy==1.10.1, the command I'm typing is p4a apk -v --sdk_dir /home/username/kivy --android_api 21. The contents of .p4a is:



    --requirements=sdl2,python3crystax,kivy
    --private /home/username/kivy/
    --package=org.myapp
    --name="myapp"
    --version=0.5
    --bootstrap=sdl2
    --permission INTERNET, WRITE_EXTERNAL_STORAGE
    --ndk-dir /home/username/kivy/crystax-10.3.2
    --sdk-kir /home/username/kivy/tools
    --arch=armeabi-v7a


    The name of my project directory is 'kivy'. And I'm using Crystax-NDK



    the logs



    [INFO]: Reading .p4a configuration
    [INFO]: Will compile for the following archs: armeabi-v7a
    [INFO]: Getting Android API version from user argument
    [INFO]: Available Android APIs are (21)
    [INFO]: Requested API target 21 is available, continuing.
    [INFO]: Getting NDK dir from from user argument
    [INFO]: Got NDK version from $ANDROIDNDKVER
    [INFO]: Got Android NDK version from the NDK dir: it is 10.3.2
    [WARNING]: NDK API target was not set manually, using the default of 21 = min(android-api=21, default ndk-api=21)
    [INFO]: Using Crystax NDK 10.3.2
    [INFO]: Found virtualenv at /usr/bin/virtualenv
    [INFO]: ccache is missing, the build will not be optimized in the future.
    [INFO]: Found the following toolchain versions: ['4.9', '5', 'clang3.6', 'clang3.7']
    [INFO]: Picking the latest gcc toolchain, here 5
    [INFO]: No existing dists meet the given requirements!
    [INFO]: No dist exists that meets your requirements, so one will be built.
    [INFO]: Found a single valid recipe set: ['hostpython3crystax', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python3crystax', 'sdl2', 'six', 'pyjnius', 'kivy']
    [INFO]: The selected bootstrap is sdl2
    [INFO]: # Creating dist with sdl2 bootstrap
    [INFO]: Dist will have name unnamed_dist_2 and recipes (sdl2, python3crystax, kivy)
    [INFO]: Dist will also contain modules () installed from pip
    [INFO]: -> running cp -r /usr/local/lib/python3.6/dist-packages/pythonforandroid/boo...(and 103 more)
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Recipe build order is ['hostpython3crystax', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python3crystax', 'sdl2', 'six', 'pyjnius', 'kivy']
    [INFO]: # Downloading recipes
    [INFO]: Downloading hostpython3crystax
    [INFO]: Skipping hostpython3crystax download as no URL is set
    [INFO]: Downloading sdl2_image
    [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/sdl2_image
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/sdl2_image
    [INFO]: -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.tar.gz
    [INFO]: sdl2_image download already cached, skipping
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Downloading sdl2_mixer
    [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/sdl2_mixer
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/sdl2_mixer
    [INFO]: -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
    [INFO]: sdl2_mixer download already cached, skipping
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Downloading sdl2_ttf
    [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/sdl2_ttf
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/sdl2_ttf
    [INFO]: -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
    [INFO]: sdl2_ttf download already cached, skipping
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Downloading python3crystax
    [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/python3crystax
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/python3crystax
    [INFO]: -> running basename
    [INFO]: -> running rm -f .mark-
    [INFO]: -> running touch .mark-
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Downloading sdl2
    [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/sdl2
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/sdl2
    [INFO]: -> running basename https://www.libsdl.org/release/SDL2-2.0.4.tar.gz
    [INFO]: sdl2 download already cached, skipping
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Downloading six
    [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/six
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/six
    [INFO]: -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
    [INFO]: six download already cached, skipping
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Downloading pyjnius
    [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/pyjnius
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/pyjnius
    [INFO]: -> running basename https://github.com/kivy/pyjnius/archive/1.1.3.zip
    [INFO]: pyjnius download already cached, skipping
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Downloading kivy
    [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/kivy
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/kivy
    [INFO]: -> running basename https://github.com/kivy/kivy/archive/1.10.1.zip
    [INFO]: kivy download already cached, skipping
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: # Building all recipes for arch armeabi-v7a
    [INFO]: # Unpacking recipes
    [INFO]: Unpacking hostpython3crystax for armeabi-v7a
    [INFO]: Skipping hostpython3crystax unpack as no URL is set
    [INFO]: Unpacking sdl2_image for armeabi-v7a
    [INFO]: -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.tar.gz
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
    [INFO]: sdl2_image is already unpacked, skipping
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Unpacking sdl2_mixer for armeabi-v7a
    [INFO]: -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
    [INFO]: sdl2_mixer is already unpacked, skipping
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Unpacking sdl2_ttf for armeabi-v7a
    [INFO]: -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
    [INFO]: sdl2_ttf is already unpacked, skipping
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Unpacking python3crystax for armeabi-v7a
    [INFO]: -> running basename
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/python3crystax-version3.6/armeabi-v7a__ndk_target_21
    [INFO]: python3crystax is already unpacked, skipping
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Unpacking sdl2 for armeabi-v7a
    [INFO]: -> running basename https://www.libsdl.org/release/SDL2-2.0.4.tar.gz
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
    [INFO]: sdl2 is already unpacked, skipping
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Unpacking six for armeabi-v7a
    [INFO]: -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/six-python3crystax/armeabi-v7a__ndk_target_21
    [INFO]: six is already unpacked, skipping
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Unpacking pyjnius for armeabi-v7a
    [INFO]: -> running basename https://github.com/kivy/pyjnius/archive/1.1.3.zip
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21
    [INFO]: pyjnius is already unpacked, skipping
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Unpacking kivy for armeabi-v7a
    [INFO]: -> running basename https://github.com/kivy/kivy/archive/1.10.1.zip
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a__ndk_target_21
    [INFO]: kivy is already unpacked, skipping
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: # Prebuilding recipes
    [INFO]: Prebuilding hostpython3crystax for armeabi-v7a
    [INFO]: hostpython3crystax has no prebuild_armeabi_v7a, skipping
    [INFO]: Prebuilding sdl2_image for armeabi-v7a
    [INFO]: sdl2_image has no prebuild_armeabi_v7a, skipping
    [INFO]: Applying patches for sdl2_image[armeabi-v7a]
    [INFO]: sdl2_image already patched, skipping
    [INFO]: Prebuilding sdl2_mixer for armeabi-v7a
    [INFO]: sdl2_mixer has no prebuild_armeabi_v7a, skipping
    [INFO]: Applying patches for sdl2_mixer[armeabi-v7a]
    [INFO]: sdl2_mixer already patched, skipping
    [INFO]: Prebuilding sdl2_ttf for armeabi-v7a
    [INFO]: sdl2_ttf has no prebuild_armeabi_v7a, skipping
    [INFO]: Prebuilding python3crystax for armeabi-v7a
    [INFO]: python3crystax has no prebuild_armeabi_v7a, skipping
    [INFO]: Prebuilding sdl2 for armeabi-v7a
    [INFO]: sdl2 has no prebuild_armeabi_v7a, skipping
    [INFO]: Applying patches for sdl2[armeabi-v7a]
    [INFO]: sdl2 already patched, skipping
    [INFO]: Prebuilding six for armeabi-v7a
    [INFO]: six has no prebuild_armeabi_v7a, skipping
    [INFO]: Prebuilding pyjnius for armeabi-v7a
    [INFO]: pyjnius has no prebuild_armeabi_v7a, skipping
    [INFO]: Applying patches for pyjnius[armeabi-v7a]
    [INFO]: pyjnius already patched, skipping
    [INFO]: Prebuilding kivy for armeabi-v7a
    [INFO]: kivy has no prebuild_armeabi_v7a, skipping
    [INFO]: # Building recipes
    [INFO]: Building hostpython3crystax for armeabi-v7a
    [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/build/other_bu...(and 56 more)
    [INFO]: -> running ln -sf /usr/bin/python3.6 /home/oli/.local/share/python-for-andro...(and 78 more)
    [INFO]: Building sdl2_image for armeabi-v7a
    [INFO]: Building sdl2_mixer for armeabi-v7a
    [INFO]: Building sdl2_ttf for armeabi-v7a
    [INFO]: Building python3crystax for armeabi-v7a
    [INFO]: Building sdl2 for armeabi-v7a
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
    [INFO]: -> running ndk-build V=1
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Building six for armeabi-v7a
    [INFO]: six apparently isn't already in site-packages
    [INFO]: Installing six into site-packages
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/six-python3crystax/armeabi-v7a__ndk_target_21/six
    [INFO]: -> running python3.6 setup.py install -O2 --root=/home/oli/.local/share/pyth...(and 67 more)
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Building pyjnius for armeabi-v7a
    [INFO]: jnius apparently isn't already in site-packages
    [INFO]: Cythonizing anything necessary in pyjnius
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21/pyjnius
    [INFO]: -> running python3.6 -c import sys; print(sys.path)
    [INFO]: Trying first build of pyjnius to get cython files: this is expected to fail
    [INFO]: -> running python3.6 setup.py build_ext -v
    cwd is /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21/pyjnius
    [INFO]: First build appeared to complete correctly, skipping manualcythonising.
    [INFO]: Stripping object files
    [INFO]: -> running find . -iname *.so -exec /usr/bin/echo ;
    [INFO]: -> running find . -iname *.so -exec arm-linux-androideabi-strip --strip-unneeded ;
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Installing pyjnius into site-packages
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21/pyjnius
    [INFO]: -> running hostpython setup.py install -O2 --root=/home/oli/.local/share/pyt...(and 68 more)
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Building kivy for armeabi-v7a
    [INFO]: kivy apparently isn't already in site-packages
    [INFO]: Cythonizing anything necessary in kivy
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a__ndk_target_21/kivy
    [INFO]: -> running python3.6 -c import sys; print(sys.path)
    [INFO]: Trying first build of kivy to get cython files: this is expected to fail
    [INFO]: -> running python3.6 setup.py build_ext -v
    cwd is /home/oli/.local/share/python-for-android/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a__ndk_target_21/kivy
    [INFO]: First build appeared to complete correctly, skipping manualcythonising.
    [INFO]: Stripping object files
    [INFO]: -> running find . -iname *.so -exec /usr/bin/echo ;
    [INFO]: -> running find . -iname *.so -exec arm-linux-androideabi-strip --strip-unneeded ;
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Installing kivy into site-packages
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a__ndk_target_21/kivy
    [INFO]: -> running hostpython setup.py install -O2 --root=/home/oli/.local/share/pyt...(and 68 more)
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: # Biglinking object files
    [INFO]: NDK is crystax, skipping biglink (will this work?)
    [INFO]: # Postbuilding recipes
    [INFO]: Postbuilding hostpython3crystax for armeabi-v7a
    [INFO]: Postbuilding sdl2_image for armeabi-v7a
    [INFO]: Postbuilding sdl2_mixer for armeabi-v7a
    [INFO]: Postbuilding sdl2_ttf for armeabi-v7a
    [INFO]: Postbuilding python3crystax for armeabi-v7a
    [INFO]: Postbuilding sdl2 for armeabi-v7a
    [INFO]: Postbuilding six for armeabi-v7a
    [INFO]: Postbuilding pyjnius for armeabi-v7a
    [INFO]: Copying pyjnius java class to classes build dir
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21/pyjnius
    [INFO]: -> running cp -a jnius/src/org /home/oli/.local/share/python-for-android/bui...(and 29 more)
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Postbuilding kivy for armeabi-v7a
    [INFO]: # Installing pure Python modules
    [INFO]: There are no Python modules to install, skipping
    [INFO]: # Creating Android project (sdl2)
    [INFO]: Copying SDL2/gradle build for armeabi-v7a
    [INFO]: -> running rm -rf /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
    [INFO]: -> running cp -r /home/oli/.local/share/python-for-android/build/bootstrap_b...(and 88 more)
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
    [INFO]: Copying Python distribution
    [INFO]: Copying libs
    [INFO]: Copying java files
    [INFO]: -> running cp -a /home/oli/.local/share/python-for-android/build/javaclasses...(and 29 more)
    [INFO]: -> running cp -r /home/oli/kivy/crystax-ndk-10.3.2/sources/python/3.6/libs/a...(and 114 more)
    [INFO]: -> running cp -r /home/oli/kivy/crystax-ndk-10.3.2/sources/python/3.6/libs/a...(and 111 more)
    [INFO]: -> running cp -r /home/oli/.local/share/python-for-android/build/python-inst...(and 126 more)
    [INFO]: Renaming .so files to reflect cross-compile
    [INFO]: -> running find /home/oli/.local/share/python-for-android/dists/unnamed_dist...(and 58 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 210 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 216 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 246 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 252 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 258 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 222 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 228 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 222 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 232 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 222 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 230 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 240 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 222 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 228 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 244 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 228 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 240 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 230 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 254 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 236 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 228 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 258 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 244 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 246 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 238 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 240 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 238 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 240 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 218 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 210 more)
    [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 210 more)
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: Stripping libraries
    [INFO]: Python was loaded from CrystaX, skipping strip
    [INFO]: Frying eggs in /home/oli/.local/share/python-for-android/dists/unnamed_dist_2/_python_bundle/_python_bundle/site-packages
    [INFO]: -> directory context /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
    [INFO]: Saving distribution info
    [INFO]: <- directory context /home/oli/kivy
    [INFO]: # Your distribution was created successfully, exiting.
    [INFO]: Dist can be found at (for now) /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
    [INFO]: No existing dists meet the given requirements!
    Traceback (most recent call last):
    File "/usr/local/bin/p4a", line 11, in <module>
    load_entry_point('python-for-android==0.6.0', 'console_scripts', 'p4a')()
    File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 1010, in main
    ToolchainCL()
    File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 541, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
    File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 148, in wrapper_func
    func(self, args)
    File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 779, in apk
    build = imp.load_source('build', join(dist.dist_dir, 'build.py'))
    File "/usr/lib/python3.6/imp.py", line 172, in load_source
    module = _load(spec)
    File "<frozen importlib._bootstrap>", line 684, in _load
    File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
    File "<frozen importlib._bootstrap_external>", line 674, in exec_module
    File "<frozen importlib._bootstrap_external>", line 780, in get_code
    File "/usr/lib/python3.6/imp.py", line 158, in get_data
    return super().get_data(path)
    File "<frozen importlib._bootstrap_external>", line 832, in get_data
    FileNotFoundError: [Errno 2] No such file or directory: '/home/oli/.local/share/python-for-android/dists/unnamed_dist_3/build.py'



    it looks like I've added an error. why would it be looking in "unnamed_dist_2"?










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have a simple python-kivy program that I finally got python-for-android to run
      all the way through. One of the last things p4a kicked out was:



      Dist can be found at (for now) /home/username/.local/share/python-for-android/dists/unnamed_dist_1


      The Getting Started documentation for p4a says "A distribution is the final “build” of all your compiled requirements, as an Android project that can be turned directly into an APK." So I assume there is another step. I'm just not sure what it is.



      I followed the "hello world" example in the p4a documentation, but at step 4, it says "go to the python-for-android directory", where on earth is that? it does not exist on my system. Assuming I find that directory it goes on to say type ./distribute.sh -m kivy. There is no file named distribute.sh on my system. My question then is, how do I convert the distribution (files in the directory they gave me) into an APK to put on my phone.
      I'm using Ubuntu 18.04 in a VM, with Python 3.6 and Python 2.7. Kivy==1.10.1, the command I'm typing is p4a apk -v --sdk_dir /home/username/kivy --android_api 21. The contents of .p4a is:



      --requirements=sdl2,python3crystax,kivy
      --private /home/username/kivy/
      --package=org.myapp
      --name="myapp"
      --version=0.5
      --bootstrap=sdl2
      --permission INTERNET, WRITE_EXTERNAL_STORAGE
      --ndk-dir /home/username/kivy/crystax-10.3.2
      --sdk-kir /home/username/kivy/tools
      --arch=armeabi-v7a


      The name of my project directory is 'kivy'. And I'm using Crystax-NDK



      the logs



      [INFO]: Reading .p4a configuration
      [INFO]: Will compile for the following archs: armeabi-v7a
      [INFO]: Getting Android API version from user argument
      [INFO]: Available Android APIs are (21)
      [INFO]: Requested API target 21 is available, continuing.
      [INFO]: Getting NDK dir from from user argument
      [INFO]: Got NDK version from $ANDROIDNDKVER
      [INFO]: Got Android NDK version from the NDK dir: it is 10.3.2
      [WARNING]: NDK API target was not set manually, using the default of 21 = min(android-api=21, default ndk-api=21)
      [INFO]: Using Crystax NDK 10.3.2
      [INFO]: Found virtualenv at /usr/bin/virtualenv
      [INFO]: ccache is missing, the build will not be optimized in the future.
      [INFO]: Found the following toolchain versions: ['4.9', '5', 'clang3.6', 'clang3.7']
      [INFO]: Picking the latest gcc toolchain, here 5
      [INFO]: No existing dists meet the given requirements!
      [INFO]: No dist exists that meets your requirements, so one will be built.
      [INFO]: Found a single valid recipe set: ['hostpython3crystax', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python3crystax', 'sdl2', 'six', 'pyjnius', 'kivy']
      [INFO]: The selected bootstrap is sdl2
      [INFO]: # Creating dist with sdl2 bootstrap
      [INFO]: Dist will have name unnamed_dist_2 and recipes (sdl2, python3crystax, kivy)
      [INFO]: Dist will also contain modules () installed from pip
      [INFO]: -> running cp -r /usr/local/lib/python3.6/dist-packages/pythonforandroid/boo...(and 103 more)
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Recipe build order is ['hostpython3crystax', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python3crystax', 'sdl2', 'six', 'pyjnius', 'kivy']
      [INFO]: # Downloading recipes
      [INFO]: Downloading hostpython3crystax
      [INFO]: Skipping hostpython3crystax download as no URL is set
      [INFO]: Downloading sdl2_image
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/sdl2_image
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/sdl2_image
      [INFO]: -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.tar.gz
      [INFO]: sdl2_image download already cached, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Downloading sdl2_mixer
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/sdl2_mixer
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/sdl2_mixer
      [INFO]: -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
      [INFO]: sdl2_mixer download already cached, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Downloading sdl2_ttf
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/sdl2_ttf
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/sdl2_ttf
      [INFO]: -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
      [INFO]: sdl2_ttf download already cached, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Downloading python3crystax
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/python3crystax
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/python3crystax
      [INFO]: -> running basename
      [INFO]: -> running rm -f .mark-
      [INFO]: -> running touch .mark-
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Downloading sdl2
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/sdl2
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/sdl2
      [INFO]: -> running basename https://www.libsdl.org/release/SDL2-2.0.4.tar.gz
      [INFO]: sdl2 download already cached, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Downloading six
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/six
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/six
      [INFO]: -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
      [INFO]: six download already cached, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Downloading pyjnius
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/pyjnius
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/pyjnius
      [INFO]: -> running basename https://github.com/kivy/pyjnius/archive/1.1.3.zip
      [INFO]: pyjnius download already cached, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Downloading kivy
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/kivy
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/kivy
      [INFO]: -> running basename https://github.com/kivy/kivy/archive/1.10.1.zip
      [INFO]: kivy download already cached, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: # Building all recipes for arch armeabi-v7a
      [INFO]: # Unpacking recipes
      [INFO]: Unpacking hostpython3crystax for armeabi-v7a
      [INFO]: Skipping hostpython3crystax unpack as no URL is set
      [INFO]: Unpacking sdl2_image for armeabi-v7a
      [INFO]: -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.tar.gz
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
      [INFO]: sdl2_image is already unpacked, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Unpacking sdl2_mixer for armeabi-v7a
      [INFO]: -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
      [INFO]: sdl2_mixer is already unpacked, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Unpacking sdl2_ttf for armeabi-v7a
      [INFO]: -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
      [INFO]: sdl2_ttf is already unpacked, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Unpacking python3crystax for armeabi-v7a
      [INFO]: -> running basename
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/python3crystax-version3.6/armeabi-v7a__ndk_target_21
      [INFO]: python3crystax is already unpacked, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Unpacking sdl2 for armeabi-v7a
      [INFO]: -> running basename https://www.libsdl.org/release/SDL2-2.0.4.tar.gz
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
      [INFO]: sdl2 is already unpacked, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Unpacking six for armeabi-v7a
      [INFO]: -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/six-python3crystax/armeabi-v7a__ndk_target_21
      [INFO]: six is already unpacked, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Unpacking pyjnius for armeabi-v7a
      [INFO]: -> running basename https://github.com/kivy/pyjnius/archive/1.1.3.zip
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21
      [INFO]: pyjnius is already unpacked, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Unpacking kivy for armeabi-v7a
      [INFO]: -> running basename https://github.com/kivy/kivy/archive/1.10.1.zip
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a__ndk_target_21
      [INFO]: kivy is already unpacked, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: # Prebuilding recipes
      [INFO]: Prebuilding hostpython3crystax for armeabi-v7a
      [INFO]: hostpython3crystax has no prebuild_armeabi_v7a, skipping
      [INFO]: Prebuilding sdl2_image for armeabi-v7a
      [INFO]: sdl2_image has no prebuild_armeabi_v7a, skipping
      [INFO]: Applying patches for sdl2_image[armeabi-v7a]
      [INFO]: sdl2_image already patched, skipping
      [INFO]: Prebuilding sdl2_mixer for armeabi-v7a
      [INFO]: sdl2_mixer has no prebuild_armeabi_v7a, skipping
      [INFO]: Applying patches for sdl2_mixer[armeabi-v7a]
      [INFO]: sdl2_mixer already patched, skipping
      [INFO]: Prebuilding sdl2_ttf for armeabi-v7a
      [INFO]: sdl2_ttf has no prebuild_armeabi_v7a, skipping
      [INFO]: Prebuilding python3crystax for armeabi-v7a
      [INFO]: python3crystax has no prebuild_armeabi_v7a, skipping
      [INFO]: Prebuilding sdl2 for armeabi-v7a
      [INFO]: sdl2 has no prebuild_armeabi_v7a, skipping
      [INFO]: Applying patches for sdl2[armeabi-v7a]
      [INFO]: sdl2 already patched, skipping
      [INFO]: Prebuilding six for armeabi-v7a
      [INFO]: six has no prebuild_armeabi_v7a, skipping
      [INFO]: Prebuilding pyjnius for armeabi-v7a
      [INFO]: pyjnius has no prebuild_armeabi_v7a, skipping
      [INFO]: Applying patches for pyjnius[armeabi-v7a]
      [INFO]: pyjnius already patched, skipping
      [INFO]: Prebuilding kivy for armeabi-v7a
      [INFO]: kivy has no prebuild_armeabi_v7a, skipping
      [INFO]: # Building recipes
      [INFO]: Building hostpython3crystax for armeabi-v7a
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/build/other_bu...(and 56 more)
      [INFO]: -> running ln -sf /usr/bin/python3.6 /home/oli/.local/share/python-for-andro...(and 78 more)
      [INFO]: Building sdl2_image for armeabi-v7a
      [INFO]: Building sdl2_mixer for armeabi-v7a
      [INFO]: Building sdl2_ttf for armeabi-v7a
      [INFO]: Building python3crystax for armeabi-v7a
      [INFO]: Building sdl2 for armeabi-v7a
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
      [INFO]: -> running ndk-build V=1
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Building six for armeabi-v7a
      [INFO]: six apparently isn't already in site-packages
      [INFO]: Installing six into site-packages
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/six-python3crystax/armeabi-v7a__ndk_target_21/six
      [INFO]: -> running python3.6 setup.py install -O2 --root=/home/oli/.local/share/pyth...(and 67 more)
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Building pyjnius for armeabi-v7a
      [INFO]: jnius apparently isn't already in site-packages
      [INFO]: Cythonizing anything necessary in pyjnius
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21/pyjnius
      [INFO]: -> running python3.6 -c import sys; print(sys.path)
      [INFO]: Trying first build of pyjnius to get cython files: this is expected to fail
      [INFO]: -> running python3.6 setup.py build_ext -v
      cwd is /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21/pyjnius
      [INFO]: First build appeared to complete correctly, skipping manualcythonising.
      [INFO]: Stripping object files
      [INFO]: -> running find . -iname *.so -exec /usr/bin/echo ;
      [INFO]: -> running find . -iname *.so -exec arm-linux-androideabi-strip --strip-unneeded ;
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Installing pyjnius into site-packages
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21/pyjnius
      [INFO]: -> running hostpython setup.py install -O2 --root=/home/oli/.local/share/pyt...(and 68 more)
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Building kivy for armeabi-v7a
      [INFO]: kivy apparently isn't already in site-packages
      [INFO]: Cythonizing anything necessary in kivy
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a__ndk_target_21/kivy
      [INFO]: -> running python3.6 -c import sys; print(sys.path)
      [INFO]: Trying first build of kivy to get cython files: this is expected to fail
      [INFO]: -> running python3.6 setup.py build_ext -v
      cwd is /home/oli/.local/share/python-for-android/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a__ndk_target_21/kivy
      [INFO]: First build appeared to complete correctly, skipping manualcythonising.
      [INFO]: Stripping object files
      [INFO]: -> running find . -iname *.so -exec /usr/bin/echo ;
      [INFO]: -> running find . -iname *.so -exec arm-linux-androideabi-strip --strip-unneeded ;
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Installing kivy into site-packages
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a__ndk_target_21/kivy
      [INFO]: -> running hostpython setup.py install -O2 --root=/home/oli/.local/share/pyt...(and 68 more)
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: # Biglinking object files
      [INFO]: NDK is crystax, skipping biglink (will this work?)
      [INFO]: # Postbuilding recipes
      [INFO]: Postbuilding hostpython3crystax for armeabi-v7a
      [INFO]: Postbuilding sdl2_image for armeabi-v7a
      [INFO]: Postbuilding sdl2_mixer for armeabi-v7a
      [INFO]: Postbuilding sdl2_ttf for armeabi-v7a
      [INFO]: Postbuilding python3crystax for armeabi-v7a
      [INFO]: Postbuilding sdl2 for armeabi-v7a
      [INFO]: Postbuilding six for armeabi-v7a
      [INFO]: Postbuilding pyjnius for armeabi-v7a
      [INFO]: Copying pyjnius java class to classes build dir
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21/pyjnius
      [INFO]: -> running cp -a jnius/src/org /home/oli/.local/share/python-for-android/bui...(and 29 more)
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Postbuilding kivy for armeabi-v7a
      [INFO]: # Installing pure Python modules
      [INFO]: There are no Python modules to install, skipping
      [INFO]: # Creating Android project (sdl2)
      [INFO]: Copying SDL2/gradle build for armeabi-v7a
      [INFO]: -> running rm -rf /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
      [INFO]: -> running cp -r /home/oli/.local/share/python-for-android/build/bootstrap_b...(and 88 more)
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
      [INFO]: Copying Python distribution
      [INFO]: Copying libs
      [INFO]: Copying java files
      [INFO]: -> running cp -a /home/oli/.local/share/python-for-android/build/javaclasses...(and 29 more)
      [INFO]: -> running cp -r /home/oli/kivy/crystax-ndk-10.3.2/sources/python/3.6/libs/a...(and 114 more)
      [INFO]: -> running cp -r /home/oli/kivy/crystax-ndk-10.3.2/sources/python/3.6/libs/a...(and 111 more)
      [INFO]: -> running cp -r /home/oli/.local/share/python-for-android/build/python-inst...(and 126 more)
      [INFO]: Renaming .so files to reflect cross-compile
      [INFO]: -> running find /home/oli/.local/share/python-for-android/dists/unnamed_dist...(and 58 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 210 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 216 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 246 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 252 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 258 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 222 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 228 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 222 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 232 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 222 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 230 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 240 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 222 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 228 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 244 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 228 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 240 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 230 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 254 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 236 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 228 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 258 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 244 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 246 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 238 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 240 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 238 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 240 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 218 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 210 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 210 more)
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Stripping libraries
      [INFO]: Python was loaded from CrystaX, skipping strip
      [INFO]: Frying eggs in /home/oli/.local/share/python-for-android/dists/unnamed_dist_2/_python_bundle/_python_bundle/site-packages
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
      [INFO]: Saving distribution info
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: # Your distribution was created successfully, exiting.
      [INFO]: Dist can be found at (for now) /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
      [INFO]: No existing dists meet the given requirements!
      Traceback (most recent call last):
      File "/usr/local/bin/p4a", line 11, in <module>
      load_entry_point('python-for-android==0.6.0', 'console_scripts', 'p4a')()
      File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 1010, in main
      ToolchainCL()
      File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 541, in __init__
      getattr(self, args.subparser_name.replace('-', '_'))(args)
      File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 148, in wrapper_func
      func(self, args)
      File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 779, in apk
      build = imp.load_source('build', join(dist.dist_dir, 'build.py'))
      File "/usr/lib/python3.6/imp.py", line 172, in load_source
      module = _load(spec)
      File "<frozen importlib._bootstrap>", line 684, in _load
      File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 674, in exec_module
      File "<frozen importlib._bootstrap_external>", line 780, in get_code
      File "/usr/lib/python3.6/imp.py", line 158, in get_data
      return super().get_data(path)
      File "<frozen importlib._bootstrap_external>", line 832, in get_data
      FileNotFoundError: [Errno 2] No such file or directory: '/home/oli/.local/share/python-for-android/dists/unnamed_dist_3/build.py'



      it looks like I've added an error. why would it be looking in "unnamed_dist_2"?










      share|improve this question















      I have a simple python-kivy program that I finally got python-for-android to run
      all the way through. One of the last things p4a kicked out was:



      Dist can be found at (for now) /home/username/.local/share/python-for-android/dists/unnamed_dist_1


      The Getting Started documentation for p4a says "A distribution is the final “build” of all your compiled requirements, as an Android project that can be turned directly into an APK." So I assume there is another step. I'm just not sure what it is.



      I followed the "hello world" example in the p4a documentation, but at step 4, it says "go to the python-for-android directory", where on earth is that? it does not exist on my system. Assuming I find that directory it goes on to say type ./distribute.sh -m kivy. There is no file named distribute.sh on my system. My question then is, how do I convert the distribution (files in the directory they gave me) into an APK to put on my phone.
      I'm using Ubuntu 18.04 in a VM, with Python 3.6 and Python 2.7. Kivy==1.10.1, the command I'm typing is p4a apk -v --sdk_dir /home/username/kivy --android_api 21. The contents of .p4a is:



      --requirements=sdl2,python3crystax,kivy
      --private /home/username/kivy/
      --package=org.myapp
      --name="myapp"
      --version=0.5
      --bootstrap=sdl2
      --permission INTERNET, WRITE_EXTERNAL_STORAGE
      --ndk-dir /home/username/kivy/crystax-10.3.2
      --sdk-kir /home/username/kivy/tools
      --arch=armeabi-v7a


      The name of my project directory is 'kivy'. And I'm using Crystax-NDK



      the logs



      [INFO]: Reading .p4a configuration
      [INFO]: Will compile for the following archs: armeabi-v7a
      [INFO]: Getting Android API version from user argument
      [INFO]: Available Android APIs are (21)
      [INFO]: Requested API target 21 is available, continuing.
      [INFO]: Getting NDK dir from from user argument
      [INFO]: Got NDK version from $ANDROIDNDKVER
      [INFO]: Got Android NDK version from the NDK dir: it is 10.3.2
      [WARNING]: NDK API target was not set manually, using the default of 21 = min(android-api=21, default ndk-api=21)
      [INFO]: Using Crystax NDK 10.3.2
      [INFO]: Found virtualenv at /usr/bin/virtualenv
      [INFO]: ccache is missing, the build will not be optimized in the future.
      [INFO]: Found the following toolchain versions: ['4.9', '5', 'clang3.6', 'clang3.7']
      [INFO]: Picking the latest gcc toolchain, here 5
      [INFO]: No existing dists meet the given requirements!
      [INFO]: No dist exists that meets your requirements, so one will be built.
      [INFO]: Found a single valid recipe set: ['hostpython3crystax', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python3crystax', 'sdl2', 'six', 'pyjnius', 'kivy']
      [INFO]: The selected bootstrap is sdl2
      [INFO]: # Creating dist with sdl2 bootstrap
      [INFO]: Dist will have name unnamed_dist_2 and recipes (sdl2, python3crystax, kivy)
      [INFO]: Dist will also contain modules () installed from pip
      [INFO]: -> running cp -r /usr/local/lib/python3.6/dist-packages/pythonforandroid/boo...(and 103 more)
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Recipe build order is ['hostpython3crystax', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python3crystax', 'sdl2', 'six', 'pyjnius', 'kivy']
      [INFO]: # Downloading recipes
      [INFO]: Downloading hostpython3crystax
      [INFO]: Skipping hostpython3crystax download as no URL is set
      [INFO]: Downloading sdl2_image
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/sdl2_image
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/sdl2_image
      [INFO]: -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.tar.gz
      [INFO]: sdl2_image download already cached, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Downloading sdl2_mixer
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/sdl2_mixer
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/sdl2_mixer
      [INFO]: -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
      [INFO]: sdl2_mixer download already cached, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Downloading sdl2_ttf
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/sdl2_ttf
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/sdl2_ttf
      [INFO]: -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
      [INFO]: sdl2_ttf download already cached, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Downloading python3crystax
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/python3crystax
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/python3crystax
      [INFO]: -> running basename
      [INFO]: -> running rm -f .mark-
      [INFO]: -> running touch .mark-
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Downloading sdl2
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/sdl2
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/sdl2
      [INFO]: -> running basename https://www.libsdl.org/release/SDL2-2.0.4.tar.gz
      [INFO]: sdl2 download already cached, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Downloading six
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/six
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/six
      [INFO]: -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
      [INFO]: six download already cached, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Downloading pyjnius
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/pyjnius
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/pyjnius
      [INFO]: -> running basename https://github.com/kivy/pyjnius/archive/1.1.3.zip
      [INFO]: pyjnius download already cached, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Downloading kivy
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/packages/kivy
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/packages/kivy
      [INFO]: -> running basename https://github.com/kivy/kivy/archive/1.10.1.zip
      [INFO]: kivy download already cached, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: # Building all recipes for arch armeabi-v7a
      [INFO]: # Unpacking recipes
      [INFO]: Unpacking hostpython3crystax for armeabi-v7a
      [INFO]: Skipping hostpython3crystax unpack as no URL is set
      [INFO]: Unpacking sdl2_image for armeabi-v7a
      [INFO]: -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.tar.gz
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
      [INFO]: sdl2_image is already unpacked, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Unpacking sdl2_mixer for armeabi-v7a
      [INFO]: -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
      [INFO]: sdl2_mixer is already unpacked, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Unpacking sdl2_ttf for armeabi-v7a
      [INFO]: -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
      [INFO]: sdl2_ttf is already unpacked, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Unpacking python3crystax for armeabi-v7a
      [INFO]: -> running basename
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/python3crystax-version3.6/armeabi-v7a__ndk_target_21
      [INFO]: python3crystax is already unpacked, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Unpacking sdl2 for armeabi-v7a
      [INFO]: -> running basename https://www.libsdl.org/release/SDL2-2.0.4.tar.gz
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
      [INFO]: sdl2 is already unpacked, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Unpacking six for armeabi-v7a
      [INFO]: -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/six-python3crystax/armeabi-v7a__ndk_target_21
      [INFO]: six is already unpacked, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Unpacking pyjnius for armeabi-v7a
      [INFO]: -> running basename https://github.com/kivy/pyjnius/archive/1.1.3.zip
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21
      [INFO]: pyjnius is already unpacked, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Unpacking kivy for armeabi-v7a
      [INFO]: -> running basename https://github.com/kivy/kivy/archive/1.10.1.zip
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a__ndk_target_21
      [INFO]: kivy is already unpacked, skipping
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: # Prebuilding recipes
      [INFO]: Prebuilding hostpython3crystax for armeabi-v7a
      [INFO]: hostpython3crystax has no prebuild_armeabi_v7a, skipping
      [INFO]: Prebuilding sdl2_image for armeabi-v7a
      [INFO]: sdl2_image has no prebuild_armeabi_v7a, skipping
      [INFO]: Applying patches for sdl2_image[armeabi-v7a]
      [INFO]: sdl2_image already patched, skipping
      [INFO]: Prebuilding sdl2_mixer for armeabi-v7a
      [INFO]: sdl2_mixer has no prebuild_armeabi_v7a, skipping
      [INFO]: Applying patches for sdl2_mixer[armeabi-v7a]
      [INFO]: sdl2_mixer already patched, skipping
      [INFO]: Prebuilding sdl2_ttf for armeabi-v7a
      [INFO]: sdl2_ttf has no prebuild_armeabi_v7a, skipping
      [INFO]: Prebuilding python3crystax for armeabi-v7a
      [INFO]: python3crystax has no prebuild_armeabi_v7a, skipping
      [INFO]: Prebuilding sdl2 for armeabi-v7a
      [INFO]: sdl2 has no prebuild_armeabi_v7a, skipping
      [INFO]: Applying patches for sdl2[armeabi-v7a]
      [INFO]: sdl2 already patched, skipping
      [INFO]: Prebuilding six for armeabi-v7a
      [INFO]: six has no prebuild_armeabi_v7a, skipping
      [INFO]: Prebuilding pyjnius for armeabi-v7a
      [INFO]: pyjnius has no prebuild_armeabi_v7a, skipping
      [INFO]: Applying patches for pyjnius[armeabi-v7a]
      [INFO]: pyjnius already patched, skipping
      [INFO]: Prebuilding kivy for armeabi-v7a
      [INFO]: kivy has no prebuild_armeabi_v7a, skipping
      [INFO]: # Building recipes
      [INFO]: Building hostpython3crystax for armeabi-v7a
      [INFO]: -> running mkdir -p /home/oli/.local/share/python-for-android/build/other_bu...(and 56 more)
      [INFO]: -> running ln -sf /usr/bin/python3.6 /home/oli/.local/share/python-for-andro...(and 78 more)
      [INFO]: Building sdl2_image for armeabi-v7a
      [INFO]: Building sdl2_mixer for armeabi-v7a
      [INFO]: Building sdl2_ttf for armeabi-v7a
      [INFO]: Building python3crystax for armeabi-v7a
      [INFO]: Building sdl2 for armeabi-v7a
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3crystax/jni
      [INFO]: -> running ndk-build V=1
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Building six for armeabi-v7a
      [INFO]: six apparently isn't already in site-packages
      [INFO]: Installing six into site-packages
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/six-python3crystax/armeabi-v7a__ndk_target_21/six
      [INFO]: -> running python3.6 setup.py install -O2 --root=/home/oli/.local/share/pyth...(and 67 more)
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Building pyjnius for armeabi-v7a
      [INFO]: jnius apparently isn't already in site-packages
      [INFO]: Cythonizing anything necessary in pyjnius
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21/pyjnius
      [INFO]: -> running python3.6 -c import sys; print(sys.path)
      [INFO]: Trying first build of pyjnius to get cython files: this is expected to fail
      [INFO]: -> running python3.6 setup.py build_ext -v
      cwd is /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21/pyjnius
      [INFO]: First build appeared to complete correctly, skipping manualcythonising.
      [INFO]: Stripping object files
      [INFO]: -> running find . -iname *.so -exec /usr/bin/echo ;
      [INFO]: -> running find . -iname *.so -exec arm-linux-androideabi-strip --strip-unneeded ;
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Installing pyjnius into site-packages
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21/pyjnius
      [INFO]: -> running hostpython setup.py install -O2 --root=/home/oli/.local/share/pyt...(and 68 more)
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Building kivy for armeabi-v7a
      [INFO]: kivy apparently isn't already in site-packages
      [INFO]: Cythonizing anything necessary in kivy
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a__ndk_target_21/kivy
      [INFO]: -> running python3.6 -c import sys; print(sys.path)
      [INFO]: Trying first build of kivy to get cython files: this is expected to fail
      [INFO]: -> running python3.6 setup.py build_ext -v
      cwd is /home/oli/.local/share/python-for-android/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a__ndk_target_21/kivy
      [INFO]: First build appeared to complete correctly, skipping manualcythonising.
      [INFO]: Stripping object files
      [INFO]: -> running find . -iname *.so -exec /usr/bin/echo ;
      [INFO]: -> running find . -iname *.so -exec arm-linux-androideabi-strip --strip-unneeded ;
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Installing kivy into site-packages
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a__ndk_target_21/kivy
      [INFO]: -> running hostpython setup.py install -O2 --root=/home/oli/.local/share/pyt...(and 68 more)
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: # Biglinking object files
      [INFO]: NDK is crystax, skipping biglink (will this work?)
      [INFO]: # Postbuilding recipes
      [INFO]: Postbuilding hostpython3crystax for armeabi-v7a
      [INFO]: Postbuilding sdl2_image for armeabi-v7a
      [INFO]: Postbuilding sdl2_mixer for armeabi-v7a
      [INFO]: Postbuilding sdl2_ttf for armeabi-v7a
      [INFO]: Postbuilding python3crystax for armeabi-v7a
      [INFO]: Postbuilding sdl2 for armeabi-v7a
      [INFO]: Postbuilding six for armeabi-v7a
      [INFO]: Postbuilding pyjnius for armeabi-v7a
      [INFO]: Copying pyjnius java class to classes build dir
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/build/other_builds/pyjnius-python3crystax-sdl2/armeabi-v7a__ndk_target_21/pyjnius
      [INFO]: -> running cp -a jnius/src/org /home/oli/.local/share/python-for-android/bui...(and 29 more)
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Postbuilding kivy for armeabi-v7a
      [INFO]: # Installing pure Python modules
      [INFO]: There are no Python modules to install, skipping
      [INFO]: # Creating Android project (sdl2)
      [INFO]: Copying SDL2/gradle build for armeabi-v7a
      [INFO]: -> running rm -rf /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
      [INFO]: -> running cp -r /home/oli/.local/share/python-for-android/build/bootstrap_b...(and 88 more)
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
      [INFO]: Copying Python distribution
      [INFO]: Copying libs
      [INFO]: Copying java files
      [INFO]: -> running cp -a /home/oli/.local/share/python-for-android/build/javaclasses...(and 29 more)
      [INFO]: -> running cp -r /home/oli/kivy/crystax-ndk-10.3.2/sources/python/3.6/libs/a...(and 114 more)
      [INFO]: -> running cp -r /home/oli/kivy/crystax-ndk-10.3.2/sources/python/3.6/libs/a...(and 111 more)
      [INFO]: -> running cp -r /home/oli/.local/share/python-for-android/build/python-inst...(and 126 more)
      [INFO]: Renaming .so files to reflect cross-compile
      [INFO]: -> running find /home/oli/.local/share/python-for-android/dists/unnamed_dist...(and 58 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 210 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 216 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 246 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 252 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 258 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 222 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 228 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 222 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 232 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 222 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 230 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 240 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 222 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 228 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 244 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 228 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 240 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 230 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 254 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 236 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 228 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 256 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 258 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 244 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 246 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 238 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 240 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 238 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 240 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 218 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 210 more)
      [INFO]: -> running mv /home/oli/.local/share/python-for-android/dists/unnamed_dist_2...(and 210 more)
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: Stripping libraries
      [INFO]: Python was loaded from CrystaX, skipping strip
      [INFO]: Frying eggs in /home/oli/.local/share/python-for-android/dists/unnamed_dist_2/_python_bundle/_python_bundle/site-packages
      [INFO]: -> directory context /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
      [INFO]: Saving distribution info
      [INFO]: <- directory context /home/oli/kivy
      [INFO]: # Your distribution was created successfully, exiting.
      [INFO]: Dist can be found at (for now) /home/oli/.local/share/python-for-android/dists/unnamed_dist_2
      [INFO]: No existing dists meet the given requirements!
      Traceback (most recent call last):
      File "/usr/local/bin/p4a", line 11, in <module>
      load_entry_point('python-for-android==0.6.0', 'console_scripts', 'p4a')()
      File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 1010, in main
      ToolchainCL()
      File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 541, in __init__
      getattr(self, args.subparser_name.replace('-', '_'))(args)
      File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 148, in wrapper_func
      func(self, args)
      File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 779, in apk
      build = imp.load_source('build', join(dist.dist_dir, 'build.py'))
      File "/usr/lib/python3.6/imp.py", line 172, in load_source
      module = _load(spec)
      File "<frozen importlib._bootstrap>", line 684, in _load
      File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 674, in exec_module
      File "<frozen importlib._bootstrap_external>", line 780, in get_code
      File "/usr/lib/python3.6/imp.py", line 158, in get_data
      return super().get_data(path)
      File "<frozen importlib._bootstrap_external>", line 832, in get_data
      FileNotFoundError: [Errno 2] No such file or directory: '/home/oli/.local/share/python-for-android/dists/unnamed_dist_3/build.py'



      it looks like I've added an error. why would it be looking in "unnamed_dist_2"?







      android android-emulator kivy apk python-3.6






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 11 at 18:18

























      asked Nov 9 at 23:13









      madcowtricks

      33




      33






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote














          I followed the "hello world" example in the p4a documentation




          This is in the legacy documentation, it isn't accurate any more.




          the command I'm typing is p4a apk -v --sdk_dir /home/username/kivy --android_api 21.




          If the build worked, it should have copied the apk file into your current directory. Did that not happen? Can you post the logs?






          share|improve this answer




















          • Where is the current documentation?
            – madcowtricks
            Nov 10 at 23:01










          • python-for-android.readthedocs.io/en/latest
            – inclement
            Nov 10 at 23:36










          • Thank you, what is the preferred way to post logs? Do you need all the [INFO] lines or just the ones leading up to the conclusion/error?
            – madcowtricks
            Nov 11 at 4:06










          • Ideally everything
            – inclement
            Nov 11 at 15:17










          • Ok re-ran. With -debug on it creates 1.4 M which exceeds SO's limit. So this is without --debug. Is that even useful?
            – madcowtricks
            Nov 11 at 18:19










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53234449%2fhow-do-i-convert-p4a-distribution-to-apk%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote














          I followed the "hello world" example in the p4a documentation




          This is in the legacy documentation, it isn't accurate any more.




          the command I'm typing is p4a apk -v --sdk_dir /home/username/kivy --android_api 21.




          If the build worked, it should have copied the apk file into your current directory. Did that not happen? Can you post the logs?






          share|improve this answer




















          • Where is the current documentation?
            – madcowtricks
            Nov 10 at 23:01










          • python-for-android.readthedocs.io/en/latest
            – inclement
            Nov 10 at 23:36










          • Thank you, what is the preferred way to post logs? Do you need all the [INFO] lines or just the ones leading up to the conclusion/error?
            – madcowtricks
            Nov 11 at 4:06










          • Ideally everything
            – inclement
            Nov 11 at 15:17










          • Ok re-ran. With -debug on it creates 1.4 M which exceeds SO's limit. So this is without --debug. Is that even useful?
            – madcowtricks
            Nov 11 at 18:19














          up vote
          0
          down vote














          I followed the "hello world" example in the p4a documentation




          This is in the legacy documentation, it isn't accurate any more.




          the command I'm typing is p4a apk -v --sdk_dir /home/username/kivy --android_api 21.




          If the build worked, it should have copied the apk file into your current directory. Did that not happen? Can you post the logs?






          share|improve this answer




















          • Where is the current documentation?
            – madcowtricks
            Nov 10 at 23:01










          • python-for-android.readthedocs.io/en/latest
            – inclement
            Nov 10 at 23:36










          • Thank you, what is the preferred way to post logs? Do you need all the [INFO] lines or just the ones leading up to the conclusion/error?
            – madcowtricks
            Nov 11 at 4:06










          • Ideally everything
            – inclement
            Nov 11 at 15:17










          • Ok re-ran. With -debug on it creates 1.4 M which exceeds SO's limit. So this is without --debug. Is that even useful?
            – madcowtricks
            Nov 11 at 18:19












          up vote
          0
          down vote










          up vote
          0
          down vote










          I followed the "hello world" example in the p4a documentation




          This is in the legacy documentation, it isn't accurate any more.




          the command I'm typing is p4a apk -v --sdk_dir /home/username/kivy --android_api 21.




          If the build worked, it should have copied the apk file into your current directory. Did that not happen? Can you post the logs?






          share|improve this answer













          I followed the "hello world" example in the p4a documentation




          This is in the legacy documentation, it isn't accurate any more.




          the command I'm typing is p4a apk -v --sdk_dir /home/username/kivy --android_api 21.




          If the build worked, it should have copied the apk file into your current directory. Did that not happen? Can you post the logs?







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 10 at 13:05









          inclement

          18.5k32339




          18.5k32339











          • Where is the current documentation?
            – madcowtricks
            Nov 10 at 23:01










          • python-for-android.readthedocs.io/en/latest
            – inclement
            Nov 10 at 23:36










          • Thank you, what is the preferred way to post logs? Do you need all the [INFO] lines or just the ones leading up to the conclusion/error?
            – madcowtricks
            Nov 11 at 4:06










          • Ideally everything
            – inclement
            Nov 11 at 15:17










          • Ok re-ran. With -debug on it creates 1.4 M which exceeds SO's limit. So this is without --debug. Is that even useful?
            – madcowtricks
            Nov 11 at 18:19
















          • Where is the current documentation?
            – madcowtricks
            Nov 10 at 23:01










          • python-for-android.readthedocs.io/en/latest
            – inclement
            Nov 10 at 23:36










          • Thank you, what is the preferred way to post logs? Do you need all the [INFO] lines or just the ones leading up to the conclusion/error?
            – madcowtricks
            Nov 11 at 4:06










          • Ideally everything
            – inclement
            Nov 11 at 15:17










          • Ok re-ran. With -debug on it creates 1.4 M which exceeds SO's limit. So this is without --debug. Is that even useful?
            – madcowtricks
            Nov 11 at 18:19















          Where is the current documentation?
          – madcowtricks
          Nov 10 at 23:01




          Where is the current documentation?
          – madcowtricks
          Nov 10 at 23:01












          python-for-android.readthedocs.io/en/latest
          – inclement
          Nov 10 at 23:36




          python-for-android.readthedocs.io/en/latest
          – inclement
          Nov 10 at 23:36












          Thank you, what is the preferred way to post logs? Do you need all the [INFO] lines or just the ones leading up to the conclusion/error?
          – madcowtricks
          Nov 11 at 4:06




          Thank you, what is the preferred way to post logs? Do you need all the [INFO] lines or just the ones leading up to the conclusion/error?
          – madcowtricks
          Nov 11 at 4:06












          Ideally everything
          – inclement
          Nov 11 at 15:17




          Ideally everything
          – inclement
          Nov 11 at 15:17












          Ok re-ran. With -debug on it creates 1.4 M which exceeds SO's limit. So this is without --debug. Is that even useful?
          – madcowtricks
          Nov 11 at 18:19




          Ok re-ran. With -debug on it creates 1.4 M which exceeds SO's limit. So this is without --debug. Is that even useful?
          – madcowtricks
          Nov 11 at 18:19

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53234449%2fhow-do-i-convert-p4a-distribution-to-apk%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Top Tejano songwriter Luis Silva dead of heart attack at 64

          政党

          天津地下鉄3号線