Skip to content

Commit

Permalink
add check on aidl / 64 bits platform, and refer on installation instr…
Browse files Browse the repository at this point in the history
…uctions if it can't be runned.

Closes #228
  • Loading branch information
tito committed Oct 4, 2015
1 parent 3fc3c63 commit 04e3530
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 8 deletions.
24 changes: 24 additions & 0 deletions buildozer/targets/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def _install_android_sdk(self):
self.buildozer.file_rename(unpacked, sdk_dir,
cwd=self.buildozer.global_platform_dir)
self.buildozer.info('Android SDK installation done.')

return sdk_dir

def _install_android_ndk(self):
Expand Down Expand Up @@ -401,6 +402,8 @@ def _install_android_packages(self):
if ver and ver > v_build_tools:
self._android_update_sdk(self._build_package_string('build-tools',
ver))
# 2.bis check aidl can be runned
self._check_aidl(v_build_tools)

# 3. finally, install the android for the current api
android_platform = join(self.android_sdk_dir, 'platforms',
Expand All @@ -413,9 +416,30 @@ def _install_android_packages(self):

self.buildozer.info('Android packages installation done.')


self.buildozer.state[cache_key] = cache_value
self.buildozer.state.sync()

def _check_aidl(self, v_build_tools):
self.buildozer.debug('Check that aidl can be executed')
v_build_tools = self._read_version_subdir(
self.android_sdk_dir, 'build-tools')
aidl_cmd = join(self.android_sdk_dir, 'build-tools', str(v_build_tools), 'aidl')
self.buildozer.checkbin('Aidl', aidl_cmd)
_, _, returncode = self.buildozer.cmd(aidl_cmd, break_on_error=False, show_output=False)
if returncode != 1:
self.buildozer.error('Aidl cannot be executed')
if sys.maxint > 2 ** 32:
self.buildozer.error('')
self.buildozer.error('You might have missed to install 32bits libs')
self.buildozer.error('Check http://buildozer.readthedocs.org/en/latest/installation.html')
self.buildozer.error('')
else:
self.buildozer.error('')
self.buildozer.error('In case of a bug report, please add a full log with log_level = 2')
self.buildozer.error('')
raise BuildozerException()

def install_platform(self):
cmd = self.buildozer.cmd
self.pa_dir = pa_dir = join(self.buildozer.platform_dir,
Expand Down
26 changes: 18 additions & 8 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Installation
============

Buildozer itself doesn't depend on any library, and works on Python 2.7 and >=
3.3. Depending the platform you want to target, you might need more tools
installed. Buildozer tries to give you hints or tries to install few things for
3.3. Depending the platform you want to target, you might need more tools
installed. Buildozer tries to give you hints or tries to install few things for
you, but it doesn't cover every situation.

First, install the buildozer project with::
Expand All @@ -13,24 +13,34 @@ First, install the buildozer project with::
Targeting Android
-----------------

If you target Android, you must install at least Cython, few build libs, and a
Java SDK. Some binaries of the Android SDK are still in 32 bits, so you need
If you target Android, you must install at least Cython, few build libs, and a
Java SDK. Some binaries of the Android SDK are still in 32 bits, so you need
few 32bits libraries available::

Android on Ubuntu 12.04 (64bit)
Android on Ubuntu 14.10 (64bit)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

sudo pip install --upgrade cython
sudo apt-get install build-essential ccache git ia32-libs python2.7 python2.7-dev openjdk-7-jdk unzip zlib1g-dev
sudo pip install --upgrade cython==0.21
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install build-essential ccache git lib32z1 lib32z1-dev python2.7 python2.7-dev openjdk-7-jdk unzip zlib1g-dev

Android on Ubuntu 13.10 (64bit)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

sudo pip install --upgrade cython
sudo pip install --upgrade cython==0.21
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install build-essential ccache git ia32-libs libncurses5:i386 libstdc++6:i386 python2.7 python2.7-dev openjdk-7-jdk unzip zlib1g-dev zlib1g:i386

Android on Ubuntu 12.04 (64bit)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

sudo pip install --upgrade cython==0.21
sudo apt-get install build-essential ccache git ia32-libs python2.7 python2.7-dev openjdk-7-jdk unzip zlib1g-dev

0 comments on commit 04e3530

Please sign in to comment.