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

build: add --android-target-sdk-version arg (defaults to android_api) #2686

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

SomberNight
Copy link
Contributor

Currently p4a has a variable named android_api (set by e.g. buildozer via the app.android.api config key). In AndroidManifest.xml, both compileSdkVersion and targetSdkVersion are set to android_api.

This PR allows setting the targetSdkVersion and compileSdkVersion independently, by adding a --android-target-sdk-version build arg.

compileSdkVersion is a compilation setting used by e.g. the NDK at build-time, while targetSdkVersion is just a field to set in the manifest, only used at runtime (mainly in the Java world). (see e.g. https://stackoverflow.com/a/26694276 )


note: my current use case is to set targetSdkVersion to higher than compileSdkVersion, as I am using an older NDK (r22b) that only supports compileSdkVersion<=30, but the google play store now requires targetSdkVersion>=31. Historically it has sometimes been the case that p4a was using an old NDK, and I had to use this trick once already a few years ago, for the same reason (but atm p4a is using a very new NDK, I am just having troubles rebasing my fork). Regardless, I believe setting the two parameters independently might have other use cases.

Currently p4a has a variable named `android_api` (set by e.g. buildozer via the `app.android.api` config key).
In `AndroidManifest.xml`, both `compileSdkVersion` and `targetSdkVersion` are set to `android_api`.

This PR allows setting the targetSdkVersion and compileSdkVersion independently, by adding a `--android-target-sdk-version` build arg.

`compileSdkVersion` is a compilation setting used by e.g. the NDK at build-time,
while `targetSdkVersion` is just a field to set in the manifest, only used at runtime (mainly in the Java world).
(see e.g. https://stackoverflow.com/a/26694276 )
@SomberNight
Copy link
Contributor Author

I have a corresponding patch for buildozer to allow setting this in buildozer.spec, but will wait for feedback here first.

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 added a commit to spesmilo/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 #8010

I am trying to upstream some relevant p4a and buildozer changes
in e.g. kivy/python-for-android#2686
@accumulator
Copy link
Contributor

bump

This would be great for extra flexibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants