Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android build: bump targetSdkVersion from 30 to 31 #8010

Closed

Conversation

SomberNight
Copy link
Member

Re the Android build, this PR bumps the targetSdkVersion from 30 to 31, and upgrades the sdk tools used.
(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.

This was split from the more ambitious #8002, which also tried to rebase the forks.

@SomberNight
Copy link
Member Author

The kivy app builds successfully, but the qml app fails - during compilation of qt5:

Android NDK: Found platform level in /home/user/wspace/electrum/.buildozer_qml/android/platform/build-arm64-v8a/build/bootstrap_builds/qt5/project.properties. Setting APP_PLATFORM to android-31.
Android NDK: android-31 is above the maximum supported version android-30. Choose a supported API level or set APP_PLATFORM to "latest".
/opt/android/android-ndk-r22b/build/core/setup-app-platform.mk:101: *** Android NDK: Aborting.    .  Stop.

It looks like NDK r22b might only support targeting up to sdk 30:

$ cat /opt/android/android-ndk-r22b/meta/platforms.json 
{
  "min": 16,
  "max": 30,
  "aliases": {
    "20": 19,
    "25": 24,
    "J": 16,
    "J-MR1": 17,
    "J-MR2": 18,
    "K": 19,
    "L": 21,
    "L-MR1": 22,
    "M": 23,
    "N": 24,
    "N-MR1": 24,
    "O": 26,
    "O-MR1": 27,
    "P": 28,
    "Q": 29,
    "R": 30
  }
}

I am confused though. I don't understand why the kivy app builds successfully in that case...


I will try setting different values for compileSdkVersion and targetSdkVersion:
https://github.com/kivy/python-for-android/blob/11322742d0c9d3d2b7b4642110c911b394425ee1/pythonforandroid/bootstraps/common/build/templates/build.tmpl.gradle#L32

@SomberNight SomberNight marked this pull request as draft October 10, 2022 20:46
SomberNight added a commit to SomberNight/electrum that referenced this pull request Oct 14, 2022
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
@SomberNight
Copy link
Member Author

I have bumped only the targetSdkVersion in 0efc881, but kept the compileSdkVersion at 30.
I believe this should satisfy the requirements of google play, but this is only a workaround until we can bump the NDK version.

@SomberNight SomberNight mentioned this pull request Oct 30, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant