Skip to content

No dimension set for key window (Android) #17971

Closed
@Taakn

Description

@Taakn

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS Sierra 10.12
Node: 8.4.0
Yarn: Not Found
npm: 5.5.1
Watchman: 4.9.0
Xcode: Xcode 8.3.3 Build version 8E3004b
Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
react: ^16.2.0 => 16.2.0
react-native: ^0.53.0 => 0.53.0

Steps to Reproduce

There are no simple steps to reproduce, providing a screenshot to show the error

Expected Behavior

The Android App is expected to launch correctly

Actual Behavior

The app worked fine on 0.49 and stopped working on android after upgrade to 0.53. The following error now appears when the debug android app is launched on actual device (Samsung S6). If I reload the app (shake and reload), it works fine.

I've seen similar errors on github but they seemed slightly different so creating new issue. I've tried a lot of different things to fix the problem (upgrading to latest react version, looking at similar issues online, etc.) but nothing works. I'd appreciate any pointers that you may have.

screenshot_20180205-105626

Reproducible Demo

The code that might be causing the error in android.index.bundle is as follows:

__d(function(e, s, i, l) {
    "use strict";
    var t = (s(49), s(68)),
        n = s(75),
        a = s(18),
        c = {},
        o = function() {
            function e() {
                babelHelpers.classCallCheck(this, e)
            }
            return babelHelpers.createClass(e, null, [{
                key: "set",
                value: function(e) {
                    if (e && e.windowPhysicalPixels) {
                        e = JSON.parse(JSON.stringify(e));
                        var s = e.windowPhysicalPixels;
                        e.window = {
                            width: s.width / s.scale,
                            height: s.height / s.scale,
                            scale: s.scale,
                            fontScale: s.fontScale
                        };
                        var i = e.screenPhysicalPixels;
                        e.screen = {
                            width: i.width / i.scale,
                            height: i.height / i.scale,
                            scale: i.scale,
                            fontScale: i.fontScale
                        }, delete e.screenPhysicalPixels, delete e.windowPhysicalPixels
                    }
                    babelHelpers.extends(c, e)
                }
            }, {
                key: "get",
                value: function(e) {
                    return a(c[e], "No dimension set for key " + e), c[e]
                }
            }]), e
        }();
    o.set(t.Dimensions), n.addListener("didUpdateDimensions", function(e) {
        o.set(e)
    }), i.exports = o
}, 74);
_

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions