Repository: beeware/briefcase
Pull request #2260 (2025-04-26 22:43:57)

Bump Android commandline tools from 12.0 to 19.0
## Changes
- Use latest (v19.0) version of Android's commandline tools
- This will cause Briefcase to install this version of commandline tools alongside v12.0

## Notes
- They're really moving through the versions it seems now...
![image](https://github.com/user-attachments/assets/cf1c5ea6-27bd-4181-b991-e60b46b46074)

## PR Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
- [x] All new features have been tested
- [X] All new features have been documented
- [X] I have read the **CONTRIBUTING.md** file
- [X] I will abide by the code of conduct


rmartin16: hmm....so in the middle of testing this, I started getting this error:

```
[helloworld] Building Android APK...

> Configure project :app
Warning: Python version 3.12 may have fewer packages available. If you experience problems, try switching to version 3.8.

> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :app:extractDebugPythonBuildPackages UP-TO-DATE
> Task :app:generateDebugPythonRequirements FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateDebugPythonRequirements'.
> Couldn't find Python. See https://chaquo.com/chaquopy/doc/current/android.html#buildpython

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 459ms
2 actionable tasks: 1 executed, 1 up-to-date
Building... errored

Error while building project.
```

I don't think this issue is related to these changes....but I'm also not sure why this is happening.

Nonetheless, can you please verify this new version is working for you?
freakboy3742: @rmartin16 Worked for me first time... not sure what happened in your run. Being unable to find Python is an odd one... any ideas @mhsmith?

Patch:
diff --git a/changes/2258.feature.rst b/changes/2258.feature.rst
new file mode 100644
index 00000000..6a2fa361
--- /dev/null
+++ b/changes/2258.feature.rst
@@ -0,0 +1,1 @@
+The Flatpak runtimes for new projects were updated. ``org.gnome.Platform`` will now default to 47; and ``org.kde.Platform`` will now default to 6.9.
diff --git a/changes/2259.removal.rst b/changes/2259.removal.rst
new file mode 100644
index 00000000..d15cb671
--- /dev/null
+++ b/changes/2259.removal.rst
@@ -0,0 +1,1 @@
+Java JDK 17.0.15+6 is now used to package Android apps. Use ``briefcase upgrade java`` to update your Briefcase-installed JDK instance to this version.
diff --git a/changes/2260.feature.rst b/changes/2260.feature.rst
new file mode 100644
index 00000000..b395ae13
--- /dev/null
+++ b/changes/2260.feature.rst
@@ -0,0 +1,1 @@
+Android packages are now built using version 19.0 of Android's Command-line Tools; this version will be automatically installed at first use.
diff --git a/docs/reference/platforms/android/gradle.rst b/docs/reference/platforms/android/gradle.rst
index 2b0016be..fc312d0d 100644
--- a/docs/reference/platforms/android/gradle.rst
+++ b/docs/reference/platforms/android/gradle.rst
@@ -37,7 +37,7 @@ If you have an existing install of the Android SDK, it will be used by Briefcase
 if the ``ANDROID_HOME`` environment variable is set. If ``ANDROID_HOME`` is not
 present in the environment, Briefcase will honor the deprecated
 ``ANDROID_SDK_ROOT`` environment variable. Additionally, an existing SDK install
-must have version 12.0 of Command-line Tools installed; this version can be
+must have version 19.0 of Command-line Tools installed; this version can be
 installed in the SDK Manager in Android Studio.
 
 Packaging format
diff --git a/src/briefcase/bootstraps/pyside6.py b/src/briefcase/bootstraps/pyside6.py
index 6af04083..e77f4609 100644
--- a/src/briefcase/bootstraps/pyside6.py
+++ b/src/briefcase/bootstraps/pyside6.py
@@ -148,7 +148,7 @@ linuxdeploy_plugins = [
     def pyproject_table_linux_flatpak(self):
         return """\
 flatpak_runtime = "org.kde.Platform"
-flatpak_runtime_version = "6.7"
+flatpak_runtime_version = "6.9"
 flatpak_sdk = "org.kde.Sdk"
 """
 
diff --git a/src/briefcase/bootstraps/toga.py b/src/briefcase/bootstraps/toga.py
index f86d0955..2c013b58 100644
--- a/src/briefcase/bootstraps/toga.py
+++ b/src/briefcase/bootstraps/toga.py
@@ -192,7 +192,7 @@ linuxdeploy_plugins = [
     def pyproject_table_linux_flatpak(self):
         return """\
 flatpak_runtime = "org.gnome.Platform"
-flatpak_runtime_version = "47"
+flatpak_runtime_version = "48"
 flatpak_sdk = "org.gnome.Sdk"
 """
 
diff --git a/src/briefcase/integrations/android_sdk.py b/src/briefcase/integrations/android_sdk.py
index 2d942e79..e0ea3fe4 100644
--- a/src/briefcase/integrations/android_sdk.py
+++ b/src/briefcase/integrations/android_sdk.py
@@ -60,10 +60,10 @@ class AndroidSDK(ManagedTool):
     name = "android_sdk"
     full_name = "Android SDK"
 
-    # Latest version for Command-Line Tools download as of May 2024
+    # Latest version for Command-Line Tools download as of May 2025
     # **Be sure the gradle.rst docs stay in sync with version updates here**
-    SDK_MANAGER_DOWNLOAD_VER = "11076708"
-    SDK_MANAGER_VER = "12.0"
+    SDK_MANAGER_DOWNLOAD_VER = "13114758"
+    SDK_MANAGER_VER = "19.0"
 
     def __init__(self, tools: ToolCache, root_path: Path):
         super().__init__(tools=tools)
diff --git a/src/briefcase/integrations/java.py b/src/briefcase/integrations/java.py
index e363ec7d..b6e3c19c 100644
--- a/src/briefcase/integrations/java.py
+++ b/src/briefcase/integrations/java.py
@@ -19,8 +19,8 @@ class JDK(ManagedTool):
 
     # Latest OpenJDK as of January 2025: https://adoptium.net/temurin/releases/
     JDK_MAJOR_VER = "17"
-    JDK_RELEASE = "17.0.14"
-    JDK_BUILD = "7"
+    JDK_RELEASE = "17.0.15"
+    JDK_BUILD = "6"
     JDK_INSTALL_DIR_NAME = f"java{JDK_MAJOR_VER}"
 
     def __init__(self, tools: ToolCache, java_home: Path):


Test patch:
diff --git a/tests/commands/new/test_build_gui_context.py b/tests/commands/new/test_build_gui_context.py
index ca753998..03cb3318 100644
--- a/tests/commands/new/test_build_gui_context.py
+++ b/tests/commands/new/test_build_gui_context.py
@@ -206,7 +206,7 @@ linuxdeploy_plugins = [
 """,
         pyproject_table_linux_flatpak="""\
 flatpak_runtime = "org.gnome.Platform"
-flatpak_runtime_version = "47"
+flatpak_runtime_version = "48"
 flatpak_sdk = "org.gnome.Sdk"
 """,
         pyproject_table_windows="""\
@@ -491,7 +491,7 @@ linuxdeploy_plugins = [
 """,
         pyproject_table_linux_flatpak="""\
 flatpak_runtime = "org.kde.Platform"
-flatpak_runtime_version = "6.7"
+flatpak_runtime_version = "6.9"
 flatpak_sdk = "org.kde.Sdk"
 """,
         pyproject_table_windows="""\
diff --git a/tests/integrations/android_sdk/conftest.py b/tests/integrations/android_sdk/conftest.py
index 7a3a683d..863ac133 100644
--- a/tests/integrations/android_sdk/conftest.py
+++ b/tests/integrations/android_sdk/conftest.py
@@ -10,8 +10,8 @@ from briefcase.integrations.java import JDK
 from briefcase.integrations.subprocess import Subprocess
 
 # current versions of Android SDK Manager
-SDK_MGR_VER = "12.0"
-SDK_MGR_DL_VER = "11076708"
+SDK_MGR_VER = "19.0"
+SDK_MGR_DL_VER = "13114758"
 
 
 @pytest.fixture
diff --git a/tests/integrations/java/conftest.py b/tests/integrations/java/conftest.py
index 7f0301ad..bec1828b 100644
--- a/tests/integrations/java/conftest.py
+++ b/tests/integrations/java/conftest.py
@@ -6,8 +6,8 @@ from briefcase.integrations.base import ToolCache
 from briefcase.integrations.file import File
 from briefcase.integrations.subprocess import Subprocess
 
-JDK_RELEASE = "17.0.14"
-JDK_BUILD = "7"
+JDK_RELEASE = "17.0.15"
+JDK_BUILD = "6"
 
 
 @pytest.fixture