Repository navigation
Dimensions.get('window').height not consistent in Android 14 and Android 15 #47080
Copy link
Copy link
Closed
Labels
Description
Description
Hi React Native team
There seems to be issue with the latest Android 15 release,
The Dimensions.get('window').height seems not consistent in the model device Pixel6a , i think its same for other pixel devices which has latest android 15 recently
| Android 14 (pixel 6a - emulator) | Android 15 (pixel 6a - real device) |
|---|---|
![]() |
![]() |
I tried using the react native boiler plate which is running on 0.75.4
as you can see the numbers in the screenshot for height are different, so any idea whats causing the issue why Android 15 has different results from android 14, even if their model device is same?
Steps to reproduce
- create new project from via
npx react-native init projectnameand begin running it - Use two android version for this test , particularly use Android 14 Pixel 6A , and another Android 15 Pixel 6A
i think any pixel version will do - Add this text as the content <Text style={{ fontSize: 30 }}>HEIGHT: {Dimensions.get('window').height} and begin comparing the two
React Native Version
0.75.4
Affected Platforms
Runtime - Android
Output of npx react-native info
info Fetching system and libraries information...
System:
OS: macOS 14.2.1
CPU: (10) arm64 Apple M1 Pro
Memory: 104.83 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.17.1
path: ~/.nvm/versions/node/v18.17.1/bin/node
Yarn:
version: 3.6.4
path: /opt/homebrew/bin/yarn
npm:
version: 9.6.7
path: ~/.nvm/versions/node/v18.17.1/bin/npm
Watchman:
version: 2023.07.03.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.14.3
path: /Users/arnoldcamas/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.5
- iOS 17.5
- macOS 14.5
- tvOS 17.5
- visionOS 1.2
- watchOS 10.5
Android SDK:
API Levels:
- "28"
- "29"
- "30"
- "31"
- "32"
- "33"
- "34"
Build Tools:
- 29.0.2
- 30.0.2
- 30.0.3
- 31.0.0
- 32.0.0
- 33.0.0
- 33.0.1
- 34.0.0
System Images:
- android-28 | Google APIs ARM 64 v8a
- android-28 | Google ARM64-V8a Play ARM 64 v8a
- android-29 | Intel x86 Atom_64
- android-29 | Google APIs ARM 64 v8a
- android-29 | Google APIs Intel x86 Atom
- android-29 | Google Play ARM 64 v8a
- android-30 | Google APIs ARM 64 v8a
- android-30 | Google APIs Intel x86_64 Atom
- android-30 | Google Play ARM 64 v8a
- android-30 | Google APIs ATD ARM 64 v8a
- android-30 | Google APIs ATD Intel x86 Atom
- android-31 | Google APIs ARM 64 v8a
- android-31 | Google APIs Intel x86_64 Atom
- android-31 | Google Play ARM 64 v8a
- android-32 | Google APIs ARM 64 v8a
- android-33 | Google APIs ARM 64 v8a
- android-34 | Google Play ARM 64 v8a
- android-35 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2024.1 AI-241.18034.62.2412.12266719
Xcode:
version: 15.4/15F31d
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.10
path: /Users/arnoldcamas/Library/Java/JavaVirtualMachines/corretto-17.0.10/Contents/Home/bin/javac
Ruby:
version: 2.7.4
path: /Users/arnoldcamas/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.75.4
wanted: 0.75.4
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: Not found
newArchEnabled: false
Stacktrace or Logs
none
Reproducer
https://snack.expo.dev/@arnoldc/4dc13a
Screenshots and Videos
No response
Reactions are currently unavailable


Activity
arnoldc commentedon Oct 17, 2024
this below is the Android 15 (pixel 6a) - Emulator version

but still its same with physical device , but idk why android 14 and android 15 has different height but it same model??
kontea-dev commentedon Oct 17, 2024
Same for me on Pixel 6 API 34 vs Pixel 6 API 35
Using height from useWindowDimensions() :
Pixel 6 API 34 height => 841.5238.....
Pixel 6 API 35 height => 914.2857.....
arnoldc commentedon Oct 17, 2024
not sure but i think it was the bump of height in the bar found in the bottom of devices for pixel devices , idk 🤷 if im correct
I also use the hook
useWindowDimensionsheight value-> e.g const {height, width, scale, fontScale} = useWindowDimensions();
, and the differences is much bigger now , i think there is an issue with calculating the dimension for android 15?
any thoughts on this?
cortinico commentedon Oct 17, 2024
@alanleedev could you take a look at this one when you have a minute?
alanleedev commentedon Oct 18, 2024
@cortinico

This behavior is not well documented but seems like on Android 15 height for window and screen is returning the same.
Systems bars appear to be ignored.
Emulator screenshots. Left is Android 15 and right is Android 14 on same device type.
Looking into fixing this to match existing behavior.alanleedev commentedon Oct 18, 2024
Although we do not call this directly and is supposed to be deprecated since API 30 but there is some info in Display.getSize() documentation which may be relevant: https://developer.android.com/reference/android/view/Display#getSize(android.graphics.Point)
I guess this could be correct if forced edge-to-edge is enabled.
It does seem like same values is returned on Android 15 regardless of it is forced edge-to-edge or not.
Seems like it could be bit tricky to handle and not completely sure if this is something we should try to fix.
mahishdino commentedon Oct 19, 2024
What method could replace in place of Display.getSize() method ? If that is the case @alanleedev
arnoldc commentedon Oct 21, 2024
so it seems bug in the api of react-native?, if thats the findings as well
hmm what should be the workaround for the meantime
any suggestions?
thanks
alanleedev commentedon Oct 21, 2024
It is not a bug in react-native. It is actually how the Android API works currently. It behaves differently between Android 14 and Android 15. The question is should we do additional work on top of it to make it work like we expect it to. Doing this can get bit tricky is what I meant.
alanleedev commentedon Oct 21, 2024
@mahishdino @arnoldc We do not actually call Display.getSize() directly. I just found hints on what could be happening in its doc. The code that does the widow or screen height calculation is DisplayMetricsHolder.kt.
alanleedev commentedon Oct 28, 2024
We are discussion what we should do about this. Will update once we have direction.
20 remaining items
Fix Dimensions window values on Android < 15 (#47554)
Fix Dimensions window values on Android < 15 (#52481)
Fix Dimensions window values on Android < 15 (#52738)
alanleedev commentedon Sep 5, 2025
Note that previous PR was reverted and we still need the fix.
LucaL1fe commentedon Oct 1, 2025
WOW! The most easiest Fix. Thanks a lot!
androideveloper commentedon Oct 29, 2025
@alanleedev is there a planned fix for this? Is the current dimensions api still inconsistent?
SimpleCreations commentedon Nov 7, 2025
I see 3b185e4 has been included in a release, does this mean this issue can be closed?
neoncube2 commentedon Nov 10, 2025
@SimpleCreations No, the dimensions are still inconsistent.
Fix Dimensions window values on Android < 15 (react#53254)