From 4e0add4e5d5b449af6b726f79dda78624579d64d Mon Sep 17 00:00:00 2001 From: lufebe16 Date: Mon, 21 Nov 2022 16:33:21 +0100 Subject: [PATCH] Build support for android: - android support library replaced by androidx appcompat --- buildozer/buildozer.init | 8 -------- buildozer/buildozer.spec | 5 ++++- pysollib/kivy/androidperms.py | 4 +++- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/buildozer/buildozer.init b/buildozer/buildozer.init index d24a8643..40204f46 100755 --- a/buildozer/buildozer.init +++ b/buildozer/buildozer.init @@ -23,14 +23,6 @@ cp -a ../pysollib ${tmpdir} cp -a ../scripts ${tmpdir} cp -a ../pysol.py ${tmpdir} -if [ ! -f support-v4-24.1.1.aar ] -then - packageurl="https://maven.google.com/com/android/support/support-v4/24.1.1" - packagename="support-v4-24.1.1.aar" - wget -nv ${packageurl}/${packagename} -fi -cp -a support-v4-24.1.1.aar ${tmpdir} - cp -a main.py ${tmpdir} mkdir -p ${tmpdir}/data/images/cards/bottoms/trumps-only echo "" > ${tmpdir}/data/images/cards/bottoms/trumps-only/.keep diff --git a/buildozer/buildozer.spec b/buildozer/buildozer.spec index 2792eb3b..bf7d526c 100644 --- a/buildozer/buildozer.spec +++ b/buildozer/buildozer.spec @@ -180,7 +180,7 @@ android.api = 32 #android.add_src = # (list) Android AAR archives to add -android.add_aars = %(source.dir)s/support-v4-24.1.1.aar +#android.add_aars = # (list) Put these files or directories in the apk assets directory. # Either form may be used, and assets need not be in 'source.include_exts'. @@ -190,11 +190,14 @@ android.add_aars = %(source.dir)s/support-v4-24.1.1.aar # (list) Gradle dependencies to add #android.gradle_dependencies = +android.gradle_dependencies = + androidx.appcompat:appcompat:1.4.2 # (bool) Enable AndroidX support. Enable when 'android.gradle_dependencies' # contains an 'androidx' package, or any package from Kotlin source. # android.enable_androidx requires android.api >= 28 #android.enable_androidx = False +android.enable_androidx = True # (list) add java compile options # this can for example be necessary when importing certain java libraries using the 'android.gradle_dependencies' option diff --git a/pysollib/kivy/androidperms.py b/pysollib/kivy/androidperms.py index 6a2a468e..2cc78d74 100644 --- a/pysollib/kivy/androidperms.py +++ b/pysollib/kivy/androidperms.py @@ -13,6 +13,8 @@ except ImportError: # LB190927. # wait loop removed. (Implement it in external code if needed.) # LB191011. +# supportlib replaced by androidx.appcompat +# LB221121. class AndroidPerms(object): @@ -22,7 +24,7 @@ class AndroidPerms(object): self.PythonActivity = jnius.autoclass( 'org.kivy.android.PythonActivity') self.Compat = jnius.autoclass( - 'android.support.v4.content.ContextCompat') + 'androidx.core.content.ContextCompat') self.currentActivity = jnius.cast( 'android.app.Activity', self.PythonActivity.mActivity)