VM kivy for android (buildozer) not enough disk space?

1,103 views
Skip to first unread message

Dirk van der Linden

unread,
Sep 6, 2015, 5:34:19 PM9/6/15
to Kivy users support
I tried to use the VirtualBox 'buildozer.vdi' in order to deploy my kivy app to android.
In my first try, dozens of screen output showed 

tar: android-ndk-r9/prebuild: Cannot mkdir: No space left on device

I thought: 8 GB total disk space might be a little narrow for a machine having 'fresh' already 6.4 GB. So I tried to increase the size of the virtual box with the command 

VBoxManage modifyhd <absolute path including the name and extension> --resize 20480

When I created this box, Virtual box confirmed that this box has a size of 20 GB. So I gave my build a new try. I was very confused when the same messages "...no space left on device" showed up.

What is going wrong here? Is this a space issue on (virtual) hard disk level? Or does 'no space left on device' mean something else?

Thanks for your replies.
Dirk.

Andrei Sima

unread,
Sep 7, 2015, 3:08:36 AM9/7/15
to kivy-...@googlegroups.com
You need to modify Virtual Drive space.

"When I created this box, Virtual box confirmed that this box has a size of 20 GB. So I gave my build a new try".

Make sure that the disk space is also allocated.
There are a lot of how to do it on the www.

I personally booted the VM from USB with bootable GParted on it. 

Also you can install GParted on your VM, and explore things there. Thou you will not be able to modify 'primary' partition if the system loaded.

It is not quite easy but it can be done.
You might loose system snapshots but i do not think that this is an issue on your case since is a fresh install.

Hope it helps.


____________________
Andrei Sima
0723.223.883

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrei Sima

unread,
Sep 7, 2015, 3:13:01 AM9/7/15
to kivy-...@googlegroups.com
GParted:

Inline image 1

Also my VMBox is on a Mac machine. If you are on Win... might require additional tasks to be done.

____________________
Andrei Sima
0723.223.883

Dirk van der Linden

unread,
Sep 8, 2015, 1:29:21 PM9/8/15
to Kivy users support
I work on a Mac, too. Your tips were very helpful, I managed to get the space indeed allocated. 

Unfortunately, buildozer on the VM did not compile my kivy project. I started to make a vagrant lubuntu provision script in order to get a better overview on what exactly is installed on the Virtual Box. Once my vagrant is running, I will be happy to share it. But this is another discussion. This question is fully answered well. I might start another topic to get my lubuntu vagrant for kivy - android compiling with buildozer. Maybe I should read the 'how to contribute' section first.

Op maandag 7 september 2015 09:13:01 UTC+2 schreef Andrei Sima:

Andrei Sima

unread,
Sep 8, 2015, 2:18:29 PM9/8/15
to kivy-...@googlegroups.com
To see what is install in your VB you need to:

pip freeze -> this will show you the python packages installed (working on OS also) 

apt --installed list -> this will show you the packages installed via aptitude (NOT working on OS since os is missing a default package manager)

aptitude is a package manager as HomeBrew or MacPort do try to become on OS, but with the changes made to the OS from update to update or from version to version is quite hard to keep a consistency all over updates / versions :(. Very nasty habit Apple, very nasty.

Now as far as buildozer failing to compile the app the reasons are sooooooooo many.
From not giving right permissions to your app for android environment to missing version number and the list can go on.

Lucky Guess:

I just read about vagrant and as far as i understand is another virtual machine but lets say on steroids, as the youtube video is promising... that will not help with buildozer since is not platform dependent. Buildozer needs a few things but those things need to be setup in the right way, from cython version 0.21 (from cython i had the most head spinning issues ever) to pygame properly installed for example.

I will try vagrant since is promising some automation tasks. Can be helpful in a way.
Learned something new :) Thanks

What i guess you have is an issue with.... <something>.
<something> = a lot of stuff that can go wrong.
Wellcome to the compiling world. :). It will be fun in the end.

After installing VM fresh kivy box try to compile a simple app. A button or something. If this is working than the problem is elsewhere not in buildozer. 

If bulldozer instead of buildozer:
    bulldozer = buildozer 
    print 'too lazy to disable autocorrection %r' %(will be done in the future, maybe)

:)

____________________
Andrei Sima
0723.223.883

Dirk van der Linden

unread,
Sep 8, 2015, 3:51:35 PM9/8/15
to Kivy users support
Thanks again, I will really explore pip freeze and apt-installed list to learn about dependency versions, which ones fit and which ones don't.

I have two assumptions, but maybe they are not OK?

1) When my kivy project works in development ('python main.py' on ubuntu or 'kivy main.py' on mac), my kivy project is syntactically correct.
2) When my kivy project works on android with Kivy Launcher, is it also OK with android.

But maybe my 'conflict' is to be found in buildozer.spec. I got the error 

Error: Target id 'android-21' is not valid 

Does this relate to the following line in buildozer.spec?

# (int) Android SDK version to use

android.sdk = 21


I took this buildozer.spec from a older version of my project which succesfully compiled about a month ago. Does this mean that this version 21 became meanwhile obsolete?


My draft vagrant provision (automatic installation of dependencies) is as follows:


add-apt-repository ppa:kivy-team/kivy

apt-get update

apt-get -y install python-kivy

apt-get install kivy-examples

find / -iname "kivy-examples"

apt-get -y install python-pip

apt-get -y install python-setuptools

pip install buildozer

apt-get install zlib1g-dev

apt-get -y install git

pip install Cython==0.21.2


It stops at the last command, and fails to install cython. More concretely, message: fatal error: pyconfig.h: No such file or directory


Is there a conflict with Cython 0.21.2 and any of the other dependencies above?


Dirk van der Linden.


Op dinsdag 8 september 2015 20:18:29 UTC+2 schreef Andrei Sima:

Andrei Sima

unread,
Sep 9, 2015, 3:07:26 AM9/9/15
to kivy-...@googlegroups.com
Hy,

1. Why SDK21?
Do you need to access the latest blow and whistles sensors snick snack stuff that BTW 90% of device users have no idea that they have?
Are you developing for the latest devices, and you need to access all of the above?

SDK 20 works very good for me.
And if i am not mistaken Cyton 0.21 has some issues with SDK21 and i do not know if that is fixed yet.


2. Cython issue.
If Cython installed you need to purge first (delete)

sudo pip uninstall Cython
sudo pip install Cython == 0.21 (i don not have 0.21.2, did not even touch it. 0.21 it works fine  for me ) 

!!!! Cython needs root privilege to be installed !!!!

Also i have setup my environment dir structure as following:

~/                                                              -> home directory
buildozer dir                                           -> is where i compile my apps

andoidSDKNDK dir                             -> is where i keep android related packages (sdk, ndk, api)

   |-> android-ndk-r9c                          -> downloaded from google developer

   |-> android-sdk-linux                       -> same as above
             [............]

                 |-> platforms                        -> in here i put needed API (19 in my case)

                 |-> build-tools                      -> here i have the SDK (20.0.0)

.python4android/python-for-android   -> cloned from git (i have no idea why i have setup this folder as an invisible one)

You can set-up this manually or choose to use Android SDK Manager to download them

Those i set up because if you delete the .buildozer form home dir, buildozer script will download them again next time when you will compile, and can take some time to do so.

Also in buildozer.spec file i have pointed to those:
android.ndk_path = ~/andoidSDKNDK/android-sdk-linux        -> yes is a typo there back when i have created the folder, and this is a good example of head spinning WHY IS NOT WORKING, because my first spec file was pointing to androidSDKNDK :) one typo can ruin your day.
see attached file for more info.

#
# Android specific
#
section


If the app is working on all platforms except Android... then it is a problem in compiling it.

Attached a spec file that i use to build and app for my kids, in order to teach them colors, shapes, animals and numbers, in english for the moment. German is next :).





____________________
Andrei Sima
0723.223.883

buildozer.spec

Dirk van der Linden

unread,
Sep 10, 2015, 3:27:43 PM9/10/15
to Kivy users support
Tanks a lot for your help. I think your approach in storing the dependencies locally has on top of speed also the advantage that you can control whether you want to try an update of (one or more of) these dependencies or not. 
Since I don't have them locally yet, I need to download them, and I think there is something wrong with it. I finally used your buildozer.spec in stead of mine, and got the same error as Jack Miao , who posted in this support group a few hours ago the issue 

"
Packages missing: cython 
It might break the compilation, except if you installed thoses packages manually.
...
"
I am sure this issue will be addressed one of these days, and then I will store the set of versions how you did as you described, in order to keep a working buildozer setup!

Dirk van der Linden

Op woensdag 9 september 2015 09:07:26 UTC+2 schreef Andrei Sima:

Jacob Cui

unread,
Dec 21, 2015, 7:43:57 AM12/21/15
to Kivy users support
Here is my example of using gparted to resize the partition size:

On your Mac:
VBoxManage modifyhd ~/Downloads/Buildozer/Buildozer.vdi --resize 10240
 (Note)  This changes the disk image's disk size to 10GB 

VM:
sudo swapoff /dev/sda5
 (Note) This is because current disk partitions are as: [partition 1][swap][newly added disk space] To resize partition 1(mount point for /), we need to delete the swap partition first. And delete the extend partition which contains this swap partition. 
   
sudo apt-get gparted
Then run gparted as root:
  sudo gparted

I haven't re-created the swap partition, all seems fine so far.

qua non

unread,
Dec 21, 2015, 1:21:29 PM12/21/15
to kivy-...@googlegroups.com
Folks we already have the script for building a new vm online. 


--
Reply all
Reply to author
Forward
0 new messages