From 6b004f9778a312fed6908bceef605e4ef8c1efe9 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Mon, 7 Jan 2019 19:55:28 +0100 Subject: [PATCH] enforce p4a --ndk-api to respect minimum api set in buildozer.spec. Fixes #772 --- buildozer/targets/android.py | 2 ++ buildozer/targets/android_new.py | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 6f7dfb0..aa12e67 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -737,6 +737,8 @@ class TargetAndroid(Target): self.android_api)), ("--minsdk", config.getdefault('app', 'android.minapi', self.android_minapi)), + ("--ndk-api", config.getdefault('app', 'android.minapi', + self.android_minapi)), ] is_private_storage = config.getbooldefault( 'app', 'android.private_storage', True) diff --git a/buildozer/targets/android_new.py b/buildozer/targets/android_new.py index 325b9d4..e21f491 100644 --- a/buildozer/targets/android_new.py +++ b/buildozer/targets/android_new.py @@ -73,10 +73,14 @@ class TargetAndroidNew(TargetAndroid): if local_recipes: options.append('--local-recipes') options.append(local_recipes) - available_modules = self._p4a( - "create --dist_name={} --bootstrap={} --requirements={} --arch {} {}".format( + config = self.buildozer.config + self._p4a( + ("create --dist_name={} --bootstrap={} --requirements={} " + "--ndk-api {} " + "--arch {} {}").format( dist_name, self._p4a_bootstrap, requirements, - self.buildozer.config.getdefault('app', 'android.arch', "armeabi-v7a"), " ".join(options)), + config.getdefault('app', 'android.minapi', self.android_minapi), + config.getdefault('app', 'android.arch', "armeabi-v7a"), " ".join(options)), get_stdout=True)[0] def get_dist_dir(self, dist_name):