Dimensions.get("window") returns incorrect width and height

:warning: Before you continue


Before submitting a bug report, please review our troubleshooting documentation at https://developer.amazon.com/docs/kepler-tv/troubleshoot-overview.html.

If you still want to file a bug report, please make sure to fill in all the details below and provide the necessary information.

NOTE: PLEASE ONLY REPORT A SINGLE BUG USING THIS TEMPLATE.
If you’re experiencing multiple issues, please file a separate report for each.


:backhand_index_pointing_right: Bug Description


1. Summary

Dimensions module is not working as expected. It is returning {width: 1920, height: 1080} even for a 4k TV with resolution of 3840 x 2160.
I also tested with setting kepler stick’s resolution to Auto and 2160p 60Hz and got the same results.

App Name:
App Link on Amazon Appstore (found through Developer Console → Actions column in App List → View on Amazon.com):

Bug Severity
Select one that applies

  • Impacts operation of app
  • Blocks current development
  • Improvement suggestion
  • Issue with documentation (If selected, please share the doc link and describe the issue)
  • Other

2. Steps to Reproduce

  1. Plug kepler stick to a 4k TV
  2. Set kepler stick’s video resolution to either Auto or to the highest resolution i.e. 2160p
  3. log the window’s dimensions to the console using Dimensions module.

3. Observed Behavior

Explain what actually happened, noting any discrepancies or malfunctions.

it returns incorrect resolution - `{width: 1920, height: 1080}`

4. Expected Behavior

Describe what you expected the SDK to do under normal operation.

It should return the correct resolution - `{width: 3840, height: 2160}`

4.a Possible Root Cause & Temporary Workaround

Fill out anything you have tried. If you don’t know, N/A is acceptable

NA

5. Logs or crash report

(Please make sure to provide relevant logs as attachment and share VPKG file with your Amazon contact)

For crash issues, please refer this guide for faster troubleshooting: https://developer.amazon.com/docs/kepler-tv/detect-crash.html.

  • App/Device Logs
  • Crash Logs
  • Crash Report
  • For issues with Kepler Studio Extension, please share log files from below folders:
     ~/.vscode/extensions/amazon.kepler-extension-<version>/ExtensionLogs
     ~/.vscode/extensions/amazon.kepler-ui-extension-<version>/ExtensionLogs
    

6. Environment

Please fill out the fields related to your bug below:

  • SDK Version: 0.20.2975
  • App State: Foreground
  • OS Information
    Please ssh into the device via kepler exec vda shelland copy the output from cat /etc/os-releaseinto the answer section below. Note, if you don’t have a simulator running or device attached kepler exec vda shell will respond with vda: no devices/emulators found
NAME="OS"
OE_VERSION="4.0.0"
OS_MAJOR_VERSION="1"
OS_MINOR_VERSION="1"
RELEASE_ID="2"
OS_VERSION="1.1"
BRANCH_CODE="VegaMainlineTvIntegration"
BUILD_DESC="OS 1.1 (VegaMainlineTvIntegration/4398)"
BUILD_FINGERPRINT="4.0.138086.0(3072cab629675a74)/4398N:user-external/release-keys"
BUILD_VARIANT="user-external"
BUILD_TAGS="release-keys"
BUILD_DATE="Fri Jul 25 09:06:08 UTC 2025"
BUILD_TIMESTAMP="1753434368"
VERSION_NUMBER="201010439850"

7. Example Code Snippet / Screenshots / Screengrabs

Include any relevant code or component setup in React Native that can help reproduce the bug.

import { Dimenstions } from 'react-native';

const {width, height} = Dimenstions.get("window");
console.log("Dimensions :: ", width, height)

:backhand_index_pointing_right: Playback Issues


If this is a playback issue, please provide your VPKG and/or content URL, any pre-conditions (like geo-location) [Share privately with your Amazon contact] , and let us know if it’s x86 or arm7.


<!-- Describe your playback issue if applicable -->

Please share the following details in addition:_

  • Player SDK: [Bitmovin, Shaka, ...]
  • Player SDK Version: [e.g. 1.23]
    • Audio Codecs: [AAC, ...]
    • Video Codecs: [h.264, mp4]
    • Manifest Types: [m3u8, dash, etc ..]

Q: Would you like to be contacted to share your latest VPKG compiled with latest SDK:

[Y/N] [Share privately with your Amazon contact]

Q: VPN or Login needed to verify functionality in VPKG?

[Y/N] [Share privately with your Amazon contact]

Q: If applicable, please provide your media/content url
If this is created dynamically, tokenized, etc please provide a way for us to access it

[N/A or Content / Media Url for testing] [Share privately with your Amazon contact]

Q: Are there any special headers required to reproduce the issue you are facing?

[N/A or Insert Headers]

Additionally please provide the following if possible
Provide Screenshots / Screengrabs / Logs. Please include as much information as you can that will help debug.

<!-- Answer here if applicable --> 

:backhand_index_pointing_right: Additional Context


Any Additional Context you would like to provide?
Add any other relevant information, such as recent updates to the SDK, dependencies, or device OS that may affect the bug.

<!-- Answer here if applicable  --> 

Hi @Chandraprakash_Sutha ,

Thank you for your patience.

Our team have tried to reproduce the issue using the sample Kepler app and have added this code:-

const windowWidth = Dimensions.get('window').width;  
const windowHeight = Dimensions.get('window').height;  
const screenWidth = Dimensions.get('screen').width;  
const screenHeight = Dimensions.get('screen').height;

console.log('windowWidth =', windowWidth);  
console.log('windowHeight =', windowHeight);  
console.log('screenWidth =', screenWidth);  
console.log('screenHeight =', screenHeight); 

By using this we tired to record the size of the visible Application window & size of the device’s screen.
and, in this case we could see that the application is covering the entire available screen of the device.

Aug 06 15:31:11.938511 firestick-8f540c3da9440752 local0.info keplersampleapp[14778]: 642951850 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] 'windowWidth =', 1920
Aug 06 15:31:11.938695 firestick-8f540c3da9440752 local0.info keplersampleapp[14778]: 642951850 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] 'windowWidth =', 1920
Aug 06 15:31:11.938903 firestick-8f540c3da9440752 local0.info keplersampleapp[14778]: 642951850 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] 'windowHeight =', 1080
Aug 06 15:31:11.939051 firestick-8f540c3da9440752 local0.info keplersampleapp[14778]: 642951850 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] 'windowHeight =', 1080
Aug 06 15:31:11.939183 firestick-8f540c3da9440752 local0.info PuffinApp[1358]: 8419 I PuffinApp:[e:5c] AliasController:getSingletonAlias:aliasIndex=0
Aug 06 15:31:11.939229 firestick-8f540c3da9440752 local0.info keplersampleapp[14778]: 642951850 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] 'screenWidth =', 1920
Aug 06 15:31:11.939365 firestick-8f540c3da9440752 local0.info keplersampleapp[14778]: 642951850 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] 'screenWidth =', 1920
Aug 06 15:31:11.939545 firestick-8f540c3da9440752 local0.info keplersampleapp[14778]: 642951850 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] 'screenHeight =', 1080
Aug 06 15:31:11.939699 firestick-8f540c3da9440752 local0.info keplersampleapp[14778]: 642951850 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] 'screenHeight =', 1080 

We want to check with you if you are checking the Application window or Device screen size?

Here are the properties you can use to verify the Application window size and Device screen size.

window ->  Size of the visible Application window.
screen -> Size of the device's screen.

Please let us know if this helps.

Thanks,
Rohit

Hi @Chandraprakash_Sutha,

Were you able to check above comment?

Further to this, our team has also tried below sample code and unable to reproduce this issue.

import {Dimensions} from '@amzn/react-native-kepler';
import React from 'react';
import {StyleSheet, Text, View} from 'react-native';
export const App = () => {
  const windowWidth=Dimensions.get('window').width;
  const windowHeight=Dimensions.get('window').height;
  const screenWidth=Dimensions.get('screen').width;
  const screenHeight=Dimensions.get('screen').height;
  const physicalWidth=Dimensions.get('physical').width;
  const physicalHeight=Dimensions.get('physical').height;
  const deviceWidth=Dimensions.get('window').width;  return (
    <View style={{flex:1, backgroundColor:'#eee'}}>
      <Text style={styles.text}>windowWidth = {windowWidth}</Text>
      <Text style={styles.text}>windowHeight = {windowHeight}</Text>
      <Text style={styles.text}>screenWidth = {screenWidth}</Text>
      <Text style={styles.text}>screenHeight = {screenHeight}</Text>
      <Text style={styles.text}>physicalWidth = {physicalWidth}</Text>
      <Text style={styles.text}>physicalHeight = {physicalHeight}</Text>
      <Text style={styles.text}>deviceWidth = {deviceWidth}</Text>
    </View>
  );
}
const styles = StyleSheet.create({ text: { fontSize:24 } }); 

Regards,
Siva

HI @Amz_Rsk @Siva_Prakash Sorry for not resonding earlier.
We tried with both “window” and “screen”, both were not giving us correct values. However, I am not sure if the bug is still there in the latest release as we are now using kepler-graphics library in place of Dimensions module, which is working fine for us.

Regards,
Chandra.

Hi @Chandraprakash_Sutha,

Thank you for the update. Glad to know that kepler-graphics helped your use case. We will pass on this feedback to the concerned team and update Dimensions if needed.

Regards,
Siva