…or Google Play
Play Console blocked the 2.2.0 review with "Required hardware feature
declarations are restricting your app's availability" for
android.hardware.screen.portrait and android.hardware.wifi (Phone,
Tablet, Desktop, Android XR). Neither is declared anywhere; Play infers
both as required:
- screen.portrait from `orientation: 'portrait'`, which locks
MainActivity to portrait;
- wifi from the ACCESS_WIFI_STATE permission that
@react-native-community/netinfo adds.
Both predate 2.1.0, so this is Play's newer check, not a regression.
A new config plugin declares both with android:required="false" (plus
tools:replace so a library can't OR it back to required). An explicit
declaration stops Play inferring the feature, so the portrait lock and
the permission stay while the install restriction goes. Checked with
`expo prebuild --platform android`: the generated manifest carries both
<uses-feature> entries and the tools namespace.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015YMpaaKrSMPdcrBZg2i498
Why
Play Console blocked the 2.2.0 release from being sent for review:
We don't declare either feature anywhere. Google Play infers both, and treats both as required:
screen.portraitorientation: 'portrait'inapp.config.ts, which locksMainActivityto portraitwifiACCESS_WIFI_STATEpermission that@react-native-community/netinfoaddsBoth were in place before 2.1.0, so this is Play's newer availability check, not a 2.2.0 regression. The Wirex Android SDK's manifest declares no features or permissions.
What
New plugin,
plugins/withOptionalHardwareFeatures.js. It declares both features withandroid:required="false". An explicit declaration stops Play inferring the feature, so:It also sets
tools:replace="android:required", so a library that declares either feature as required can't merge it back to required. It adds thetoolsnamespace the override needs, followingwithMlkitVisionDependencies.Registered in
app.config.ts, with a comment beside the entry.Following increase app availability, the app needs neither feature. It works over any network, and on a device without a portrait screen Android shows the portrait layout letterboxed.
Checked
expo prebuild --platform androidproduces a manifest with:google-services.json, and the generatedandroid/folder was removed afterwards.app.config.ts.plugins/*.jsin this repo: the existingwithMlkitVisionDependencies.jsfails the same way, with "could not find plugin @typescript-eslint". That's a config gap, not this file.After merge
The config change probably also changes the iOS fingerprint, so expect a new iOS 2.2.0 build too.
Generated by Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit