EzDevInfo.com

buildozer

Generic Python packager for Android and iOS Welcome to Buildozer’s documentation! — Buildozer 0.11 documentation

Build custom python package using buildozer

Is there a way to build my own python package (e.g: xyz) using buildozer or python-for-android and create an apk file?

Do I need to have a main.py file and if yes, how can I build my package for android within it ?

I have all the python files compiled also.

Or is there a another way to port my python package on android?


Source: (StackOverflow)

Facing Issues While Uploading App on Google play Made via Buildozer

I have made an app using command buildozer android debug deploy run

and then i goto my new account of gmail and simply went to devloper console and tried to upload this new apk but it says me

Upload failed

You uploaded a debuggable APK. For security reasons you need to disable debugging before it can be published in Google Play. Learn more about debuggable APKs.

You uploaded an APK that was signed in debug mode. You need to sign your APK in release mode. Learn more about signing.

I have also uploaded images just check it outenter image description here


Source: (StackOverflow)

Advertisements

CalledProcessError with buildozer and kivy on OSX Yosemite

I am on Yosemite and am getting errors using buildozer to turn this into an apk. I have updated everything in Android sdk already.
EDIT: I should note that I am only using the libraries "random" and "kivy", random being standard library so I don't think I need to specify it's use in buildozer.spec and kivy is already specified in buildozer.spec.
The code also has:

kivy.require('1.8.0')  

I am editing the buildozer.spec by commenting out the part that looks for the version with a regex, and then uncommenting the portion below that which just tells to use version "1.2". I think this may be the problem...

Here is the relevant output from setting the buildozer.spec to loglevel=2:

hn:flappy subnetfile$ buildozer android debug
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /Library/Frameworks/Python.framework/Versions/2.7/bin/cython
# Search for Java compiler (javac)
#  -> found at /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/javac
# Search for Java keytool (keytool)
#  -> found at /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/keytool
# Install platform
# Apache ANT found at /Users/subnetfile/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /Users/subnetfile/.buildozer/android/platform/android-sdk-21
# Android NDK found at /Users/subnetfile/.buildozer/android/platform/android-ndk-r9c
# Check application requirements
# Run './distribute.sh -l'
# Cwd /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/.buildozer/android/platform/python-for-android
Available modules: android apsw audiostream bidi c_igraph cprotobuf cymunk django docutils enum34 ffmpeg freetype gevent greenlet harfbuzz hostpython igraph jpeg kivent_core kivent_cymunk kivy libevent libpq libswift libxml2 libxslt libyaml lxml m2crypto midistream msgpack mysql_connector netifaces numpy opencv openssl paramiko pil plyer png polygon protobuf psutil psycopg2 pyasn1 pycrypto pygame pyjnius pylibpd pyopenssl pyparsing pyqrcode python pyyaml sdl setuptools six sqlalchemy sqlite3 storm swift twisted txws wokkel zeroconf zope
# Application requirements already installed, pass
# Check garden requirements
# Compile platform
# Run './distribute.sh -l'
# Cwd /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/.buildozer/android/platform/python-for-android
Available modules: android apsw audiostream bidi c_igraph cprotobuf cymunk django docutils enum34 ffmpeg freetype gevent greenlet harfbuzz hostpython igraph jpeg kivent_core kivent_cymunk kivy libevent libpq libswift libxml2 libxslt libyaml lxml m2crypto midistream msgpack mysql_connector netifaces numpy opencv openssl paramiko pil plyer png polygon protobuf psutil psycopg2 pyasn1 pycrypto pygame pyjnius pylibpd pyopenssl pyparsing pyqrcode python pyyaml sdl setuptools six sqlalchemy sqlite3 storm swift twisted txws wokkel zeroconf zope
# Distribution already compiled, pass.
# Build the application #2
# Copy application source from /Users/subnetfile/Desktop/kivy-game-tutorial/flappy
# Create directory /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/.buildozer/android/app
# Copy /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/flappy.kv
# Copy /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/flappy.py
# Copy /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/kivy_fix.py
# Copy /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/kivyNotes.py
# Copy /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/main.py
# Create directory /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/.buildozer/android/app/images
# Copy /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/images/background.png
# Copy /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/images/bird.png
# Copy /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/images/bird_anim.atlas
# Copy /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/images/bird_anim.png
# Copy /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/images/ground.png
# Copy /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/images/pipe_bottom.png
# Copy /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/images/pipe_top.png
# Create directory /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/.buildozer/android/app/using-kv
# Copy /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/using-kv/game.kv
# Copy /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/using-kv/game.py
# Package the application
# project.properties updated
# Run '/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python build.py --name flappy --version 1.2.0 --package org.test.flappy --private /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/.buildozer/android/app --sdk 14 --minsdk 8 --orientation landscape debug'
# Cwd /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/.buildozer/android/platform/python-for-android/dist/flappy
Updated project.properties
Updated local.properties
----------
build.xml: Failed to find version-tag string. File must be updated.
In order to not erase potential customizations, the file will not be automatically regenerated.
If no changes have been made to the file, delete it manually and run the command again.
If you have made customizations to the build process, the file must be manually updated.
It is recommended to:
    * Copy current file to a safe location.
    * Delete original file.
    * Run command again to generate a new file.
    * Port customizations to the new file, by looking at the new rules file
      located at <SDK>/tools/ant/build.xml
    * Update file to contain
          version-tag: custom
      to prevent file from being rewritten automatically by the SDK tools.
----------
Updated file ./proguard-project.txt
It seems that there are sub-projects. If you want to update them
please use the --subprojects parameter.
Listing /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/.buildozer/android/platform/python-for-android/dist/flappy/private ...  

-set-mode-check:

-set-debug-files:

-check-env:
 [checkenv] Android SDK Tools Revision 24.3.2
 [checkenv] Installed at /Users/subnetfile/.buildozer/android/platform/android-sdk-21

-setup:
     [echo] Project Name: flappy-1.2.0
  [gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 23.0.0 rc2
     [echo] Resolving Build Target for flappy-1.2.0...
[gettarget] Project Target:   Android 4.0
[gettarget] API level:        14
     [echo] ----------
     [echo] Creating output directories if needed...
     [echo] ----------
     [echo] Resolving Dependencies for flappy-1.2.0...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency] 
[dependency] ------------------
[dependency] API<=15: Adding annotations.jar to the classpath.
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

-code-gen:
[mergemanifest] Found modified input file
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] Found 1 AIDL files.
     [aidl] Compiling 1 AIDL files.

BUILD FAILED
/Users/subnetfile/.buildozer/android/platform/android-sdk-21/tools/ant/build.xml:649: The following error occurred while executing this line:
/Users/subnetfile/.buildozer/android/platform/android-sdk-21/tools/ant/build.xml:655: Execute failed: java.io.IOException: Cannot run program "/Users/subnetfile/Desktop/kivy-game-tutorial/flappy/.buildozer/android/platform/python-for-android/dist/flappy/${aidl}": error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at java.lang.Runtime.exec(Runtime.java:620)
    at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
    at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428)
    at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442)
    at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:628)
    at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
    at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
    at com.android.ant.AidlExecTask$AidlProcessor.process(AidlExecTask.java:102)
    at com.android.ant.MultiFilesTask.processFiles(MultiFilesTask.java:131)
    at com.android.ant.AidlExecTask.execute(AidlExecTask.java:203)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:435)
    at org.apache.tools.ant.Target.performTasks(Target.java:456)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
    at org.apache.tools.ant.Main.runBuild(Main.java:851)
    at org.apache.tools.ant.Main.startAnt(Main.java:235)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:185)
    at java.lang.ProcessImpl.start(ProcessImpl.java:134)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 48 more

Total time: 2 seconds
le/Desktop/kivy-game-tutorial/flappy/.buildozer/android/app/images/pipe_bottom.png
assets/private.mp3: /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/.buildozer/android/app/images/pipe_top.png
assets/private.mp3: /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/.buildozer/android/app/using-kv/game.kv
assets/private.mp3: /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/.buildozer/android/app/using-kv/game.pyo
Traceback (most recent call last):
  File "build.py", line 508, in <module>
    make_package(args)
  File "build.py", line 357, in make_package
    subprocess.check_call([ANT, arg])
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1
# Command failed: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python build.py --name flappy --version 1.2.0 --package org.test.flappy --private /Users/subnetfile/Desktop/kivy-game-tutorial/flappy/.buildozer/android/app --sdk 14 --minsdk 8 --orientation landscape debug
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

Source: (StackOverflow)

Kivy 1.8 and Cython 0.21.2

Using Buildozer I get 12 times:

#error Do not use this file, it is the result of a failed Cython compilation.

And eventually:

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

According to the Kivy docs, I use Cython 0.21.2.

See the full log.

Any help would be very much appreciated!


Source: (StackOverflow)

"ImportError: Cannot import name spawnu" while building apk using kivy

I was building a simple android app using kivy using the below code:

from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.scatter import Scatter
from kivy.uix.floatlayout import FloatLayout

class TutorialApp(App):
    def build(self):
        f = FloatLayout()
        s = Scatter()
        l = Label(text="Hello!",
                  font_size=150)

        f.add_widget(s)
        s.add_widget(l)

        return f

if __name__ == "__main__":
    TutorialApp().run()

I am building this code into an apk using buildozer. I wrote

buildozer android debug

This gave the following error:

http://imgur.com/z9TJMhC

How can I rectify this error.


Source: (StackOverflow)

Buildozer: manually include an external API

I'd like to include an SDK library into the build that does not exist in PIP, or any public place on the Internet. I've read that this can be done manually. I put the SDK library in the root of my Kivy project. The development console finds this import just fine. The problem is with the deployment.

Looking at the buildozer.spec file I came across this:

# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
# requirements.source.kivy = ../../kivy

I have the SDK in a folder called sdk in the root of my project, hence I tried this:

requirements.source.sdk = sdk

It compiles without errors, but the application crashes when trying to import it.

How do I manually include an SDK library in to my APK?


Source: (StackOverflow)

Buildozer build error

I try to compile a basic code with buildozer. At first run it installs depencies and fail. Later runs it just fails. I am using ubuntu.

Traceback (most recent call last):
  File "build.py", line 509, in <module>
    make_package(args)
  File "build.py", line 357, in make_package
    subprocess.check_call([ANT, arg])
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1
# Command failed: /usr/bin/python build.py --name 'My Application' --version 1.2.0 --package org.test.myapp --private /home/abhigenie92/Desktop/test/.buildozer/android/app --sdk 14 --minsdk 8 --orientation sensor --window debug
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

Full output: http://paste.fedoraproject.org/261429/02155114/

TRIED THIS: Android compile error using buildozer

enter image description here


Source: (StackOverflow)

Python 2.7 urllib.urlretrieve unknown url type https

I previously ran into this error and after fixing it, I ran into this:

I/python  ( 7569):  Traceback (most recent call last):
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/app/main.py", line 102, in <module>
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/app/main.py", line 63, in IncarcaAfise
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 91, in urlretrieve
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 237, in retrieve
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 205, in open
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 356, in open_http
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 369, in http_error
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 632, in http_error_302
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 659, in redirect_internal
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 202, in open
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 214, in open_unknown
I/python  ( 7569):  IOError: [Errno url error] unknown url type: 'https'

The following (relevant) code was used:

import urllib
urllib.urlretrieve('https://dl.dropboxusercontent.com/u/95587456/Evenimente/1.jpg','/storage/emulated/0/Temp/1.jpg')

I tried replacing the 'https' with http, but it ran into the same error. Now, after looking a while on the internet, on forums and whatnot, I saw that people have recompiled Python with SSL support. However, I failed to find a guide that would explain how that is done. Also, if I am to recompile python, am I going to lose the libraries installed so far?

The operating system used is Ubuntu 14.04, with Python 2.7, and the application was compiled by buildozer (using Kivy) and ran on Android (from an APK). The APK has its internet permission set to true.


Source: (StackOverflow)

I Can't build buildozer for android

I'm trying to create an APK using Kivy and Buildozer. I'm doing the same as in the tutorial at http://kivy.org/docs/guide/packaging-android.html but i have errors, and i don't understand how to fix them. Please help. This is my error log:

BUILD FAILED
/home/oleg/.buildozer/android/platform/android-sdk-21/tools/ant/build.xml:649: The following error occurred while executing this line:
/home/oleg/.buildozer/android/platform/android-sdk-21/tools/ant/build.xml:655: Execute failed: java.io.IOException: Cannot run program "/home/oleg/.buildozer/android/platform/android-sdk-21/build-tools/19.1.0/aidl": error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at java.lang.Runtime.exec(Runtime.java:620)
    at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
    at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428)
    at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442)
    at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:628)
    at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
    at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
    at com.android.ant.AidlExecTask$AidlProcessor.process(AidlExecTask.java:102)
    at com.android.ant.MultiFilesTask.processFiles(MultiFilesTask.java:131)
    at com.android.ant.AidlExecTask.execute(AidlExecTask.java:203)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:435)
    at org.apache.tools.ant.Target.performTasks(Target.java:456)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
    at org.apache.tools.ant.Main.runBuild(Main.java:851)
    at org.apache.tools.ant.Main.startAnt(Main.java:235)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
    at java.lang.ProcessImpl.start(ProcessImpl.java:134)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 48 more

Total time: 1 second
o
assets/private.mp3: /home/oleg/Desktop/lol/.buildozer/android/platform/python-for-android/dist/myapp/private/lib/python2.7/lib-dynload/syslog.so
assets/private.mp3: /home/oleg/Desktop/lol/.buildozer/android/platform/python-for-android/dist/myapp/private/lib/python2.7/config/Setup
assets/private.mp3: /home/oleg/Desktop/lol/.buildozer/android/platform/python-for-android/dist/myapp/private/lib/python2.7/config/config.c
assets/private.mp3: /home/oleg/Desktop/lol/.buildozer/android/platform/python-for-android/dist/myapp/private/lib/python2.7/config/config.c.in
assets/private.mp3: /home/oleg/Desktop/lol/.buildozer/android/platform/python-for-android/dist/myapp/private/lib/python2.7/config/Makefile
assets/private.mp3: /home/oleg/Desktop/lol/.buildozer/android/platform/python-for-android/dist/myapp/private/lib/python2.7/config/Setup.local
assets/private.mp3: /home/oleg/Desktop/lol/.buildozer/android/platform/python-for-android/dist/myapp/private/lib/python2.7/config/Setup.config
assets/private.mp3: /home/oleg/Desktop/lol/.buildozer/android/platform/python-for-android/dist/myapp/private/lib/python2.7/config/install-sh
assets/private.mp3: /home/oleg/Desktop/lol/.buildozer/android/app/sitecustomize.pyo
assets/private.mp3: /home/oleg/Desktop/lol/.buildozer/android/app/main.pyo
Traceback (most recent call last):
  File "build.py", line 508, in <module>
    make_package(args)
  File "build.py", line 357, in make_package
    subprocess.check_call([ANT, arg])
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1
# Command failed: /usr/bin/python build.py --name 'first app' --version 1.0 --package org.test.myapp --private /home/oleg/Desktop/lol/.buildozer/android/app --sdk 14 --minsdk 8 --orientation landscape debug
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

Source: (StackOverflow)

buildozer -v android debug : Compile fails at fcntlmodule.c

I'm using Fedora-18 and while running the command "buildozer -v android debug" It hits the following error. How to resolve this ? thanks for any help.

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -c ./Modules/selectmodule.c -o Modules/selectmodule.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -c ./Modules/socketmodule.c -o Modules/socketmodule.o
./Modules/fcntlmodule.c: In function ‘all_ins’:
./Modules/fcntlmodule.c:568:5: error: ‘I_PUSH’ undeclared (first use in this function)
./Modules/fcntlmodule.c:568:5: note: each undeclared identifier is reported only once for each function it appears in
./Modules/fcntlmodule.c:569:5: error: ‘I_POP’ undeclared (first use in this function)
./Modules/fcntlmodule.c:570:5: error: ‘I_LOOK’ undeclared (first use in this function)
./Modules/fcntlmodule.c:571:5: error: ‘I_FLUSH’ undeclared (first use in this function)
./Modules/fcntlmodule.c:572:5: error: ‘I_FLUSHBAND’ undeclared (first use in this function)
./Modules/fcntlmodule.c:573:5: error: ‘I_SETSIG’ undeclared (first use in this function)
./Modules/fcntlmodule.c:574:5: error: ‘I_GETSIG’ undeclared (first use in this function)
./Modules/fcntlmodule.c:575:5: error: ‘I_FIND’ undeclared (first use in this function)
./Modules/fcntlmodule.c:576:5: error: ‘I_PEEK’ undeclared (first use in this function)
./Modules/fcntlmodule.c:577:5: error: ‘I_SRDOPT’ undeclared (first use in this function)
./Modules/fcntlmodule.c:578:5: error: ‘I_GRDOPT’ undeclared (first use in this function)
./Modules/fcntlmodule.c:579:5: error: ‘I_NREAD’ undeclared (first use in this function)
./Modules/fcntlmodule.c:580:5: error: ‘I_FDINSERT’ undeclared (first use in this function)
./Modules/fcntlmodule.c:581:5: error: ‘I_STR’ undeclared (first use in this function)
./Modules/fcntlmodule.c:582:5: error: ‘I_SWROPT’ undeclared (first use in this function)
./Modules/fcntlmodule.c:587:5: error: ‘I_SENDFD’ undeclared (first use in this function)
./Modules/fcntlmodule.c:588:5: error: ‘I_RECVFD’ undeclared (first use in this function)
./Modules/fcntlmodule.c:589:5: error: ‘I_LIST’ undeclared (first use in this function)
./Modules/fcntlmodule.c:590:5: error: ‘I_ATMARK’ undeclared (first use in this function)
./Modules/fcntlmodule.c:591:5: error: ‘I_CKBAND’ undeclared (first use in this function)
./Modules/fcntlmodule.c:592:5: error: ‘I_GETBAND’ undeclared (first use in this function)
./Modules/fcntlmodule.c:593:5: error: ‘I_CANPUT’ undeclared (first use in this function)
./Modules/fcntlmodule.c:594:5: error: ‘I_SETCLTIME’ undeclared (first use in this function)
./Modules/fcntlmodule.c:598:5: error: ‘I_LINK’ undeclared (first use in this function)
./Modules/fcntlmodule.c:599:5: error: ‘I_UNLINK’ undeclared (first use in this function)
./Modules/fcntlmodule.c:600:5: error: ‘I_PLINK’ undeclared (first use in this function)
./Modules/fcntlmodule.c:601:5: error: ‘I_PUNLINK’ undeclared (first use in this function)
make: *** [Modules/fcntlmodule.o] Error 1
make: *** Waiting for unfinished jobs....
./Modules/socketmodule.c: In function ‘socket_gethostbyname_ex’:
./Modules/socketmodule.c:3371:9: warning: variable ‘result’ set but not used [-Wunused-but-set-variable]
./Modules/socketmodule.c: In function ‘socket_gethostbyaddr’:
./Modules/socketmodule.c:3447:9: warning: variable ‘result’ set but not used [-Wunused-but-set-variable]
command failed: ./distribute.sh -m "kivy"

Source: (StackOverflow)

Kivy app (on android) crashes when attempting to use google directions api

I new to Kivy (and relatively new to Python) and I am having a problem getting UrlRequests to work. In particular, I am trying to use the google directions api in an App for android.

First of all, the code works (completely) when I run the main.py file through python. The app also successfully builds and deploys to my phone using buildozer. The app loads and runs right up to the point where you press a button to launch a urlrequest, at which point the app just closes.

So I believe the problem is this button. The full details of the button are somewhat unnecessary to explain now I think, but basically it uses a function (like below) several times to return the distance between places.

import urllib2

#the google api key
google_api_key = '...'

def distance_checker(origin, destination):
    # This function outputs the distance between two places in meters
    api_key = google_api_key
    url = 'https://maps.googleapis.com/maps/api/directions/json?origin='
    start = origin.replace(' ', '%20')
    end = destination.replace(' ', '%20')
    final_url = url + start + '&destination=' + end + '&mode=walking' + '&key=' + api_key
    json_obj = urllib2.urlopen(final_url)
    data = json.load(json_obj)

    return data['routes'][0]['legs'][0]['distance']['value']

In my buildozer.spec file I do have 'android.permissions = INTERNET' included.

I also had my app attempt to access google using a function of the form (submitted by user: 10flow, on Pinging servers in Python),

import os

def ping_function(self):
    hostname = "google.com" #example
    response = os.system("ping -c 1 " + hostname)

    #and then check the response...
    if response == 0:
        self.box.add_widget(Label(text=(hostname + ' is up!'), size_hint_y=None, height=40))
    else:
        self.box.add_widget(Label(text=(hostname + ' is down!'), size_hint_y=None, height=40))

For clarity, the 'box' used above is for a ScrollView widget. This function does work in the app in android (i.e. it does create a Label saying 'google.com is up!'). So this would lead me to believe that accessing the internet itself is not the problem: the problem is either using a google api, or the using of urllib2 (that make sense?).

I also wrote a function which does the url query using UrlRequest instead of urllib2, but that had the same problem in the end (works on linux, not on android).

So I imagine the problem is using google apis. And I think it has something got to do with adding 'google-play-services_lib/' as an android.library reference in the buildozer.spec file.

If what I have said so far makes sense, could anyone comment on the google api/google-play-services_lib issue? I'm really not that familiar with apis in general, and am somewhat out of my depth. Or perhaps this isn't the issue, and I have missed something obvious.

Anyway, thanks in advance.

EDIT

I think I have narrowed down the problem somewhat. I can use apis that do not require a key, and I cannot use apis that do need a key. Posts like How to get google map apikey in android lead me to believe I just need to add the google api key (in the case of the google directions api) to the android meta data in the buildozer.spec file. I have unsuccessfully tried several variations of the following,

# (list) Android application meta-data to set (key=value format)
android.meta_data = com.google.android.maps.v2.API_KEY=AI...

If anyone could tell me what I am doing wrong it would be very helpful! Thanks.


Source: (StackOverflow)

Buildozer failed to execute the last command error

Traceback (most recent call last):
  File "build.py", line 509, in <module>
    make_package(args)
  File "build.py", line 357, in make_package
    subprocess.check_call([ANT, arg])
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1
# Command failed: /usr/bin/python build.py --name 'My Application' --version 1.2.0 --package org.test.myapp --private /home/abhishek/Desktop/Code/.buildozer/android/app --sdk 14 --minsdk 8 --orientation sensor --window debug

I'm trying to build an APK using Kivy and Buildozer, and when I run "buildozer android debug," I receive the above error as a response.


Source: (StackOverflow)

Simple Kivy App Fails to Buildoze

I wrote a simple kivy app that replicates buttons

import kivy
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout






class ButtonApp(App):

    def add_button(self, none):
        button = Button(text='Press Me too!')
        button.bind(on_press=self.add_button)
        self.b.add_widget(button)


    def build(self):
        self.b = BoxLayout()
        button = Button(text="Press me!")
        button.bind(on_press=self.add_button)
        self.b.add_widget(button)
        return self.b


if __name__ == "__main__":

    ButtonApp().run()

but when I run buildozer android debug, I get the following error

# Android SDK found at /Users/mmalkin/.buildozer/android/platform/android-sdk-21
# Android NDK found at /Users/mmalkin/.buildozer/android/platform/android-ndk-r9c
# Command failed: /Users/mmalkin/.buildozer/android/platform/android-sdk-21/tools/android list sdk -u -e
# 
# Buildozer failed to execute the last command
# If the error is not obvious, please raise the log_level to 2
# and retry the latest command.
# In case of a bug report, please add a full log with log_level = 2

I've tried changing the directory to Macintosh HD, updating Java, and many other solutions suggested on this site. What am I doing wrong?


Source: (StackOverflow)

Error in building APK in KIVY

I'm using the Kivy Android VM with complete pre-requisite mentioned in their site.

Here is my reference: The Kivy Android Virtual Machine

On step 6 it says follow the read me file on desktop.

So the step on read me file, buildozer init on my project directory has no problem. Doing the buildozer android debug, it produces this error:

enter image description here

Thanks in advance for help! :)

UPDATE: log_level=2 applied

enter image description here


Source: (StackOverflow)

Python, Kivy, Buildozer: APK crashes with SymPy

As the title sais, I've made an .apk to run on my Android mobile. It runs perfectly on PC. As soon, as I take out all SymPy commands, it runs on Android too. I've mentioned the "sympy" in the buildozer.specs-file, and it's not giving any errors. But as soon, as the loading on my Android-screen is over, the App disappears. Does anyone know, if I have to do more, than mentioning the sympy in the .specs file?

ADB-Logcat: "ImportError: No module named unittest" I don't know, what "unittest" ist, and why it's trying to get imported.

Solved: I found unittest.py (google: "inurl:unittest.py") and saved it inside the project folder.


Source: (StackOverflow)