Skip to content

Commit 85d1177

Browse files
npinaevclaude
andcommitted
Google Play: clearer error when apkeep delivers no artifact
Distinguish "no success marker + no artifact" (Google Play refused to deliver the app for the requested device profile - most commonly a CPU ABI mismatch, e.g. requesting an x86_64 emulator profile for an arm64-only app; also region/availability/acquisition) from the rare "success marker present but artifact missing" case, with actionable error messages for each. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d266ab2 commit 85d1177

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

mdast_cli/distribution_systems/google_play_apkeep.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ async def download_app(
111111
if proc.returncode != 0:
112112
raise RuntimeError(sanitized_output_text.strip() or 'apkeep returned non-zero exit code')
113113

114-
if f'{package_name} downloaded successfully!' not in output:
114+
success_marker_found = f'{package_name} downloaded successfully!' in output
115+
if not success_marker_found:
115116
logger.warning(f'Google Play - success marker not found in output, continuing artifact check (package: {package_name})')
116117

117118
split_dir = os.path.join(download_dir, package_name)
@@ -279,8 +280,26 @@ async def download_app(
279280
except Exception as ex:
280281
logger.debug(f'Google Play - failed to scan directory for candidates: {ex} (package: {package_name})')
281282

282-
logger.error(f'Google Play - artifact not found after successful download (package: {package_name})')
283-
raise RuntimeError('Google Play: download reports success but artifact not found')
283+
if not success_marker_found:
284+
# apkeep exited without printing the "downloaded successfully!" marker and produced no file.
285+
# This is how Google Play behaves when it refuses to deliver the APK for the requested
286+
# device profile: most commonly the app has no native build for the device's CPU ABI
287+
# (e.g. requesting an x86_64 emulator profile for an arm64-only app), but it can also mean
288+
# the app is unavailable for the account's region or is not acquired in its library.
289+
# Not a real download failure on our side.
290+
logger.error(f'Google Play - apkeep produced no success marker and no artifact; '
291+
f'Google Play did not deliver the app for the requested device profile '
292+
f'(likely CPU ABI/architecture mismatch, e.g. no x86_64 build for an arm64-only app; '
293+
f'or region/availability/acquisition) (package: {package_name})')
294+
raise RuntimeError(
295+
'Google Play: apkeep finished without a success marker and produced no artifact - '
296+
'Google Play did not deliver the app for the requested device profile. Most likely the app '
297+
'has no native build for the requested CPU ABI (e.g. requesting x86_64 for an arm64-only app); '
298+
'also check region/availability and that the app is acquired in the account library'
299+
)
300+
301+
logger.error(f'Google Play - success marker present but artifact not found (package: {package_name})')
302+
raise RuntimeError('Google Play: apkeep reported success but the artifact could not be located')
284303

285304

286305
def _ensure_dir_exists(path: str) -> None:

0 commit comments

Comments
 (0)