Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No dimension set for key window (Android) #17971

Closed
Taakn opened this issue Feb 13, 2018 · 1 comment
Closed

No dimension set for key window (Android) #17971

Taakn opened this issue Feb 13, 2018 · 1 comment
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@Taakn
Copy link

Taakn commented Feb 13, 2018

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);
_
@Taakn
Copy link
Author

Taakn commented Feb 19, 2018

Closing the issue. In the end turned out to be an index.bundle.android file that wasn't being updated. This fixed the issue:
react-native bundle --platform android --dev true --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

Then release build failed due to the following issue on some components:
#16567

@Taakn Taakn closed this as completed Feb 19, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Feb 19, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Feb 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants