ReviewOS

craft-native/craft

fix(android): handle unavailable Play Services in location bridge

#191
Closed glennmichael123 opened this 10 days ago ·
10 days ago

Problem

Craft Android location uses FusedLocationProviderClient exclusively. On an AOSP emulator without valid Google Play Services, it logs SERVICE_INVALID and a getCurrentPosition request never resolves through the bridge.

Expected

When Play Services are unavailable, the bridge should either use an Android LocationManager fallback or reject the pending JavaScript request with a clear error and timeout. A pending location promise prevents the app from presenting a reliable recovery state.

Context

This was reproduced in a generated Craft app with geolocation enabled on an API 34 AOSP emulator. The Android bridge already has the required location permissions; the failure is the unavailable fused provider.

10 days ago

Implemented in 6b080f6. Android location now rejects immediately when Google Play Services is unavailable, applies a bounded one-shot timeout with cleanup, and refuses watches with a stable sentinel instead of leaving JavaScript pending. Verified through the Android builder tests, package build, full Zig/JS suite, and final head 7a16e82 where CI, SBOM, Binary Size, and Benchmark all succeeded.

Sign in to comment on this issue.