Building the NDK with API 27 support

165 views
Skip to first unread message

Richard Larkin

unread,
Aug 16, 2018, 6:07:34 PM8/16/18
to crystax-ndk
Hi

Please could someone advise me on how to build the the Crystax DNK with support for API 27. I have tried to follow the instructions as outlined below, but without success. This post probably contains too much information, but rather too much that too little.

Thanks in advance. Any assistance or advice is much appreciated.

## Introduction

I am a core dev for the Kivy project. We are trying to build the Crystax NDK to support APU 27 so we can build APK's that pass the required APU level for submission to the Play Store. Kivy uses the buildozer sister-project to build the APK, which in turn uses the Cyrstax NDK to package Python3 builds.

## Background resources

Google Announces API requirement: https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html?m=1

Kivy project: https://github.com/kivy/kivy

Buildozer: https://github.com/kivy/buildozer

## Build enironment

OS: Xubuntu 16.04
Python 3.5/2.7
Crystax version: 10.3.2

## Status

We can currently building using Python3.5 and the Crystax NDK 10.3.2 building against API 17. This works. When we try using API 27, after copying the "platform/android-22" to "platform/android-27" folders from the "android-ndk-16b" package into the "crystax-ndk-10.3.2/platforms/" folder, but this build fails with:

    /home/kivy/Android/crystax-ndk-10.3.2/sources/python/3.5/include/python/Python.h:25:19: fatal error: stdio.h: No such file or directory   
compilation terminated.

    Full error log: https://gist.github.com/Zen-CODE/54451f82c1f64d75afe4c38cdb45a60b


We suspect the failure is caused by the missing sysroots, as we have just copied these folders in. The NDK probably needs to be built with them included?

## Progress

1. Building the APK following instructions here: https://www.crystax.net/android/ndk

All the dependencies listed for ubuntu 14.04 are in place and OpenJDK 8 is installed and the default.

command: \curl -sSL https://www.crystax.net/download/ndk-crystax-r10-build.sh | /bin/bash
Output: https://gist.github.com/Zen-CODE/f5536dc28151a1e3d201c3da773991b1

This fails with a "Build error" that does not indicate how to correct the problem.

2. Following the instructions for building the NDK posted here:

    https://github.com/crystax/android-platform-ndk.

All the listed dependendies have been installed. We then do:

    git clone https://github.com/crystax/android-platform-ndk
   
    cd android-platform-ndk

    repo init -u https://android.googlesource.com/platform/manifest -b master-ndk

This command seems to succeed and we have a .repo subfolder. No furher instruction is given as to how to link the .repo content with the crystax build? So on we go.

    python checkbuild.py

Gives the error 'file not found': https://gist.github.com/Zen-CODE/07a5f04650c234aeddc8c5b590a07a16

    python3 checkbuild.py

Gives the error "ImportError: No module named 'adb'". But we are unable to install adb for python3. The online documnentation indicates it is not yet Python3 compliant.

So how to progress? It is really important that we support API 27 otherwise we will be unable to upload APK's to the play store.

Thanks
Richard

Reply all
Reply to author
Forward
0 new messages