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 dimensions set for key window" error after fresh 0.44.0 install #13758

Closed
EnriqueDev opened this issue May 3, 2017 · 43 comments
Closed

"No dimensions set for key window" error after fresh 0.44.0 install #13758

EnriqueDev opened this issue May 3, 2017 · 43 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@EnriqueDev
Copy link

EnriqueDev commented May 3, 2017

Description

After a fresh install of react native the following error appears on screen:

captura de pantalla 2017-05-03 a las 12 43 26

Reproduction Steps and Sample Code

  1. Install fresh project using: react-native init newProject
  2. Run on ios simulator: react-native run-ios

Additional Information

  • React Native version: 0.44.0
  • Platform: iOS
  • Development Operating System: MacOS Sierra
  • Dev tools: default
@jbreuer95
Copy link

+1

@andrii-yarmola
Copy link

same issue on run-android
win7

@NickJorgensen
Copy link

same here
react native 0.44.0
macOS 10.12 Sierra
xcode 8.3.2

The error does not show up when building "Release" on a device, only "Debug".

@choiway
Copy link

choiway commented May 3, 2017

+1

@Amurmurmur
Copy link

Sounds strange, but doesnt happen for me.
I use Dimensions lib and it runs just fine over couple of RN releases right from 0.39 up to 0.44.

@rawrmaan
Copy link
Contributor

rawrmaan commented May 3, 2017

Is it possible that any of you are using NavigationExperimental in your app? This module was removed in 0.44 and can cause this error if your app tries to require it.

@choiway
Copy link

choiway commented May 3, 2017

@rawrmaan This happens on a fresh install.

@andrii-yarmola
Copy link

andrii-yarmola commented May 3, 2017

@rawrmaan Not quite
in my case fresh app is working good,
i just installed "react-native-router-flux" with npm (so probably you are right)
and i got this error w/o code changes

just for Navigation issue:
aksonov/react-native-router-flux#1832

@jebrial
Copy link

jebrial commented May 3, 2017

Try closing terminal, deleting ios/build and run again. I had the same issue but now its working.

@hanih
Copy link

hanih commented May 3, 2017

try importing StaticContainer from react native

@hellomaya
Copy link

For the case of android, try close terminal, run npm cache clean and then by using new react-native-cli, which I removed react-native-cli from 0.42, and installed react-native-cli for 0.44, then run react-native run-android, worked for me.

@gotoAndBliss
Copy link

gotoAndBliss commented May 4, 2017

+1 Same issues. Fresh install.

iOS

@mattdufeu
Copy link

mattdufeu commented May 4, 2017

I had the same error on a brand new project. Turned out I had an old Package Manager running from a different project. Once I closed that, the fresh app worked after running react-native run-ios again.

@GetSource1234
Copy link

Same issue. Got it on Android

@itamarborges
Copy link

Just close terminal, open a new one, run npm cache clean, and run your project again. Boom, done!

@mrbrentkelly
Copy link
Contributor

mrbrentkelly commented May 5, 2017

Update 05/22/17: Turns out the underlying issue here for us was we were running 2 different versions of React Native... An included gradle dependancy was bumping our RN version up and our bundle was expecting a lower version.

On Android it seems to be an issue with using React Native v0.44.0 along with Android SDK Build Tools version 25.

If you downgrade to React Native 0.43.2 the issue goes away or alternatively if you downgrade your Android compileSdkVersion to 23 (and buildToolsVersion to 23.0.1) the issue also goes away.

Fix 1

In your app build.gradle change compile "com.facebook.react:react-native:+" to compile "com.facebook.react:react-native:0.43.2@aar"

OR

Fix 2

In your app build.gradle downgrade your SDK to target and compile against 23

compileSdkVersion 23
buildToolsVersion "23.0.1"
...
targetSdkVersion 23
...
compile "com.android.support:appcompat-v7:23.0.1"

@dcarrot2
Copy link

dcarrot2 commented May 5, 2017

We're seeing this on Android and our buildToolsVersion is 23.0.1 and our compileSdkVersion is 23.

@rkbhochalya
Copy link

rkbhochalya commented May 6, 2017

Got same issue with fresh install on android. I closed the old Package Manager running from a different project and it worked.

@cesarmal
Copy link

cesarmal commented May 6, 2017

After reading all the commentaries I and trying different solutions, I got this 5 points. Maybe they are helpful for someone else.

  1. The fresh app worked for me;
  2. After installing react-native-router-flux, the issue came out - like @andrii-yarmola said;
  3. I had others projects on the same machine - with different library versions. But the solution given by @rkbhochalya and @mattdufeu did not work for me;
  4. It happened with iOS and Android;
  5. Only after rebooting the machine - MacOSX - the issue was gone.

@rkbhochalya
Copy link

rkbhochalya commented May 6, 2017

You can also try clearing cache:

watchman watch-del-all && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache

or if you have yarn installed:

watchman watch-del-all && rm -rf node_modules/ && npm cache clean && yarn install && npm start -- --reset-cache

@rkbhochalya
Copy link

Also close all package manager terminal windows running from different projects.

@willgvfranco
Copy link

@rkbhochalya clearing cache resolves. thanks.

@TechSnake
Copy link

Same issue at fresh project.Closing terminal and clearing cache didnt work.I am totally stuck.target sdk 22
I

@JINGTINGWU
Copy link

I get the same error on Android 6 with React Native v0.44.0,I downgrade RN version to v0.43.0, it is work.

@aleygues
Copy link

@rkbhochalya clearing cache also resolves. thanks!

@garthenweb
Copy link

npm start -- --reset-cache was working for me!

@Sxiaobai
Copy link

Sxiaobai commented May 24, 2017

@NickJorgensen Have you worked out any approach to solve the problem? Only when release can have this mistake

@Sxiaobai
Copy link

@rkbhochalya Only when release can have this mistake Can you solve it

@toropanov
Copy link

+1 Same error

@nonameolsson
Copy link

I had the same problem but thanks to the comments I managed to solve it.

I upgraded to:
"react": "16.0.0-alpha.6",
"react-native": "0.44.2",

After that:
rm -rf $TMPDIR/react-* && watchman watch-del-all && npm cache clean
rm -rf node_modules
npm install

That solved it.

@luco
Copy link

luco commented Jun 6, 2017

+1
This is a pain.

@gadfil
Copy link

gadfil commented Jun 12, 2017

+1
on device all fine
on emulator same error

@avogel3
Copy link

avogel3 commented Jun 13, 2017

+1
Deleting watchman cache and reinstalling node modules still does not fix the error for me

Update:

After running react-native upgrade, setting new versions of react and react-native, and updating the rest of my dependencies, I was able to resolve this and other errors. I realize this will not solve everyone's issue, but figured it would be worth it to post.

Here's some of the versions for my packages.

  • npm 5.0.3
  • node 7.10.0
  • react 16.0.0-alpha.6
  • react-native 0.44.0
  • react-native-router-flux 3.40.0
  • react-native-vector-icons 4.0

@nullptrx
Copy link

node v7.10.0 was working for me, but node v8.0.0+ was not.

@karl-gustav
Copy link

Just running react-native upgrade fixed it for me

@nonameolsson
Copy link

I got this problem again, but this time

rm -rf $TMPDIR/react-* && watchman watch-del-all && npm cache clean
rm -rf node_modules
npm install

didn't help.

After a while the project started again, but I have no idea of why!

@nigelnindo
Copy link

I run into this on iOS, when I switched react native versions. I think it happens due to stale react native binaries. Cleaning the project and running the build in Xcode solved it for me.

@roch2810
Copy link

Close all terminal
run npm cache clean
and after you can run your project with react-native run-ios
worked for me

@woxiangxin7779
Copy link

For the case of android, try close terminal,then run react-native run-android, worked for me.

@dereknex
Copy link

if you got issue with Debug build, you can fix it as above.
if you got issue with Release build, you need regenerate main.jsbundle by react-native bundle --minify --dev false --assets-dest ./ios --entry-file index.ios.js --platform ios --bundle-output ios/main.jsbundle.

@aforty
Copy link
Contributor

aforty commented Oct 18, 2017

I'm getting this on 0.49.0 in iOS but only in the Release build. Appears to be a timing issue as it happens randomly. Any work-around on this?

//edit Running react-native-git-upgrade did it for me. Great work on that one!

@samthui
Copy link

samthui commented Dec 6, 2017

Mine is solved after downgrading npm from @5 to @4.6.1

@ShamarYarde
Copy link

If none of the above solutions helped, it could be that you misspelt window with a capital W. It should in all lower case letters.

@HouLinguo HouLinguo mentioned this issue May 16, 2018
3 tasks
@facebook facebook locked as resolved and limited conversation to collaborators Sep 28, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Sep 28, 2018
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