# Platform-specific

> "Works on desktop, breaks on the phone" — status bar, keyboard, permissions, BLE stub, density.

Source: https://crossfly.dev/docs/troubleshooting/platform-specific — CrossFly documentation. Full docs as one file: https://crossfly.dev/llms-full.txt

# Platform-specific

Behavior that only breaks on one target. Format: **symptom → cause → fix**.

## Android: content under the status bar
**Cause:** `difY` offset / status bar height not applied.
**Fix:** respect `DeviceConfig.statusbarHeight` in the top layout.
([Android](/docs/platforms/android))

## Virtual keyboard covers the focused field
**Cause:** the field isn't repositioned when the keyboard comes up.
**Fix:** adjust dependent on `Device.keyboardShift`/`keyboardHeight`.
(Ch. 6 — Events and Input)

## iOS: build fails (RoboVM)
**Cause:** toolchain/signing (macOS+Xcode, provisioning).
**Fix:** check the iOS launcher and the certificate/provisioning. ([iOS](/docs/platforms/ios))

## Device permissions denied (camera/GPS/storage)
**Cause:** permission not granted / not declared.
**Fix:** check `DeviceConfig.cameraAllowed`/`storageAllowed` and declare it in
`AndroidManifest.xml`/`Info.plist`; request it at runtime **before** bringing up the UI (delayed start on Android).
(Ch. 24)

## Bluetooth "does nothing"
**Cause:** in **core**, parts of BLE are a **skeleton over a cache** — the real radio lives in the
platform launchers.
**Fix:** test on a **real device**; confirm the target platform's implementation.
([Bluetooth BLE](/docs/data-and-services/device-bluetooth-ble))

## `FilePicker` / `IWebView` have no effect (or `WebContainer` on web)
**Cause:** skeletons/no concrete implementation on some targets; on **web** `createWebView()` returns
`null`.
**Fix:** check `!= null`/`Device.platform` and use an alternative (files in `Device.homeFolder`;
`PlatformUtils.instance.view(url)` on web). ([Native integration](/docs/platforms/native-integration))

## Colors/rendering differ across platforms
**Cause:** usually `Screen.scale`/density.
**Fix:** use **logical pixels** and `Relative`, never `Gdx.graphics` as a size reference.
([Responsiveness](/docs/best-practices/responsividade))

## See also
- [Build and Gradle](/docs/troubleshooting/build-gradle) · [Platform matrix](/docs/platforms/overview)
