Fix native APK homes; add a native discovery probe

The native APK build no longer sets ANDROID_SDK_HOME beside
ANDROID_USER_HOME (AGP rejects the conflict). integration_test/
discovery_probe_test.dart runs the real Bonsoir discovery on a desktop
host and prints what the platform delivers.
This commit is contained in:
2026-11-09 12:42:05 +00:00
parent 0e16e6c9fe
commit 701fb98ef0
4 changed files with 110 additions and 2 deletions
+4 -2
View File
@@ -308,8 +308,10 @@ def build_apk_native(app, cache, flutter, sdk, arguments, runner=subprocess.run,
code = built // 60
signing = signing_dir()
env = {**os.environ, "ANDROID_HOME": sdk, "ANDROID_SDK_ROOT": sdk,
# The Android Gradle plugin reads debug.keystore from the user home it is given.
"ANDROID_USER_HOME": str(signing), "ANDROID_SDK_HOME": str(signing)}
# The Android Gradle plugin reads debug.keystore from this user home.
# ANDROID_SDK_HOME must not also be set: AGP rejects conflicting homes.
"ANDROID_USER_HOME": str(signing)}
env.pop("ANDROID_SDK_HOME", None)
command = [flutter, "build", "apk", "--release", *arguments,
f"--build-number={code}", f"--build-name=0.1.{code}"]
result = runner(command, cwd=str(app), env=env, capture_output=True, text=True)