Skip to content

Commit ae22a7e

Browse files
committed
android build: bump targetSdkVersion from 30 to 31
The google play store will require 31, starting 2022-11 (next month). A few commits are cherry-picked onto our forks of p4a and buildozer from upstream, but the forks are not rebased. Note that the compileSdkVersion is kept at 30, only the targetSdkVersion is bumped 30->31. closes spesmilo#8010 I am trying to upstream some relevant p4a and buildozer changes in e.g. kivy/python-for-android#2686
1 parent 3bd4eec commit ae22a7e

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

contrib/android/Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ ENV ANDROID_SDK_BUILD_TOOLS_VERSION="30.0.3"
5555
ENV ANDROID_SDK_HASH="d71f75333d79c9c6ef5c39d3456c6c58c613de30e6a751ea0dbd433e8f8b9cbf"
5656
ENV ANDROID_SDK_TOOLS_ARCHIVE="commandlinetools-linux-${ANDROID_SDK_TOOLS_VERSION}_latest.zip"
5757
ENV ANDROID_SDK_TOOLS_DL_URL="https://dl.google.com/android/repository/${ANDROID_SDK_TOOLS_ARCHIVE}"
58-
ENV ANDROID_SDK_MANAGER="${ANDROID_SDK_HOME}/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_HOME}"
58+
ENV ANDROID_SDK_MANAGER="${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_HOME}"
5959

6060
# download and install Android SDK
6161
RUN curl --location --progress-bar \
@@ -64,7 +64,6 @@ RUN curl --location --progress-bar \
6464
&& echo "${ANDROID_SDK_HASH} ${ANDROID_SDK_TOOLS_ARCHIVE}" | sha256sum -c - \
6565
&& mkdir --parents "${ANDROID_SDK_HOME}" \
6666
&& unzip -q "${ANDROID_SDK_TOOLS_ARCHIVE}" -d "${ANDROID_SDK_HOME}" \
67-
&& mv "${ANDROID_SDK_HOME}/cmdline-tools" "${ANDROID_SDK_HOME}/tools" \
6867
&& rm -rf "${ANDROID_SDK_TOOLS_ARCHIVE}"
6968

7069
# update Android SDK, install Android API, Build Tools...
@@ -83,7 +82,7 @@ RUN yes | ${ANDROID_SDK_MANAGER} --licenses > /dev/null
8382
RUN ${ANDROID_SDK_MANAGER} "platforms;android-30" > /dev/null && \
8483
${ANDROID_SDK_MANAGER} "build-tools;${ANDROID_SDK_BUILD_TOOLS_VERSION}" > /dev/null && \
8584
${ANDROID_SDK_MANAGER} "extras;android;m2repository" > /dev/null && \
86-
chmod +x "${ANDROID_SDK_HOME}/tools/bin/avdmanager"
85+
chmod +x "${ANDROID_SDK_HOME}/cmdline-tools/bin/avdmanager"
8786

8887
# download ANT
8988
ENV APACHE_ANT_VERSION="1.9.4"
@@ -166,7 +165,7 @@ RUN cd /opt \
166165
&& git remote add sombernight https://github.com/SomberNight/buildozer \
167166
&& git fetch --all \
168167
# commit: from branch sombernight/electrum_20210421
169-
&& git checkout "d570116e88184b0eca0c6b59a25edd49d977da23^{commit}" \
168+
&& git checkout "6f03256e8312f8d1e5a6da3a2a1bf06e2738325e^{commit}" \
170169
&& python3 -m pip install --no-build-isolation --no-dependencies --user -e .
171170

172171
# install python-for-android
@@ -177,7 +176,7 @@ RUN cd /opt \
177176
&& git remote add accumulator https://github.com/accumulator/python-for-android \
178177
&& git fetch --all \
179178
# commit: from branch sombernight/electrum_20210421d
180-
&& git checkout "4535a333f9928e894caedefc4f746f9c6a0dc50f^{commit}" \
179+
&& git checkout "1187e179aed6fddb19bf026274ff69903d3b04b2^{commit}" \
181180
&& python3 -m pip install --no-build-isolation --no-dependencies --user -e .
182181

183182
# build env vars

contrib/android/buildozer_kivy.spec

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,13 @@ fullscreen = False
7474
# (list) Permissions
7575
android.permissions = INTERNET, CAMERA, WRITE_EXTERNAL_STORAGE
7676

77-
# (int) Android API to use (targetSdkVersion AND compileSdkVersion)
77+
# (int) Android API to use (compileSdkVersion)
7878
# note: when changing, Dockerfile also needs to be changed to install corresponding build tools
7979
android.api = 30
8080

81+
# (int) Android targetSdkVersion
82+
android.target_sdk_version = 31
83+
8184
# (int) Minimum API required. You will need to set the android.ndk_api to be as low as this value.
8285
android.minapi = 21
8386

@@ -157,6 +160,10 @@ android.manifest.launch_mode = singleTask
157160
# note: can be overwritten by APP_ANDROID_ARCH env var
158161
#android.arch = armeabi-v7a
159162

163+
# (int) overrides automatic versionCode computation (used in build.gradle)
164+
# this is not the same as app version and should only be edited if you know what you're doing
165+
# android.numeric_version = 1
166+
160167
# (list) Android application meta-data to set (key=value format)
161168
#android.meta_data =
162169

contrib/android/buildozer_qml.spec

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,13 @@ fullscreen = False
8383
# (list) Permissions
8484
android.permissions = INTERNET, CAMERA, WRITE_EXTERNAL_STORAGE
8585

86-
# (int) Android API to use (targetSdkVersion AND compileSdkVersion)
86+
# (int) Android API to use (compileSdkVersion)
8787
# note: when changing, Dockerfile also needs to be changed to install corresponding build tools
8888
android.api = 30
8989

90+
# (int) Android targetSdkVersion
91+
android.target_sdk_version = 31
92+
9093
# (int) Minimum API required. You will need to set the android.ndk_api to be as low as this value.
9194
android.minapi = 21
9295

@@ -169,6 +172,10 @@ android.manifest.launch_mode = singleTask
169172
# note: can be overwritten by APP_ANDROID_ARCH env var
170173
#android.arch = armeabi-v7a
171174

175+
# (int) overrides automatic versionCode computation (used in build.gradle)
176+
# this is not the same as app version and should only be edited if you know what you're doing
177+
# android.numeric_version = 1
178+
172179
# (list) Android application meta-data to set (key=value format)
173180
#android.meta_data =
174181

0 commit comments

Comments
 (0)