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

[IOS / Android] Application crash in production (undefined is not an object (evaluating 'r.default')) #20213

Closed
mmamoyco opened this issue Jul 15, 2018 · 8 comments
Labels
Platform: Android Android applications. Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@mmamoyco
Copy link

mmamoyco commented Jul 15, 2018

Environment

React Native Environment Info:
System:
OS: macOS Sierra 10.12.6
CPU: x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 420.62 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.6.0 - /usr/local/bin/node
Yarn: 1.3.2 - /usr/local/bin/yarn
npm: 6.1.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 11.2, macOS 10.13, tvOS 11.2, watchOS 4.2
IDEs:
Android Studio: 3.1 AI-173.4819257
Xcode: 9.2/9C40b - /usr/bin/xcodebuild
npmPackages:
react: ^16.4.1 => 16.4.1
react-native: ^0.56.0 => 0.56.0
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7

Description

Only in production app fails (in debug all is ok). Application worked in production before upgrading react-native (0.49.5 -> 0.56.0)

2018-07-15 16:15:16.530348+0300 SCards[675:426085] refreshPreferences: HangTracerEnabled: 0
2018-07-15 16:15:16.530389+0300 SCards[675:426085] refreshPreferences: HangTracerDuration: 500
2018-07-15 16:15:16.530405+0300 SCards[675:426085] refreshPreferences: ActivationLoggingEnabled: 0 ActivationLoggingTaskedOffByDA:0
2018-07-15 16:15:17.013 [error][tid:com.facebook.react.JavaScript] undefined is not an object (evaluating 'r.default')
2018-07-15 16:15:17.014144+0300 SCards[675:426128] undefined is not an object (evaluating 'r.default')
2018-07-15 16:15:17.015 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: undefined is not an object (evaluating 'r.default')
2018-07-15 16:15:17.015369+0300 SCards[675:426116] Unhandled JS Exception: undefined is not an object (evaluating 'r.default')
2018-07-15 16:15:17.016 [error][tid:com.facebook.react.JavaScript] Module AppRegistry is not a registered callable module (calling runApplication)
2018-07-15 16:15:17.016212+0300 SCards[675:426128] Module AppRegistry is not a registered callable module (calling runApplication)
2018-07-15 16:15:17.019133+0300 SCards[675:426116] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: undefined is not an object (evaluating 'r.default')', reason: 'Unhandled JS Exception: undefined is not an object (evaluating 'r.default'), stack:
w@932:1604
<unknown>@962:683
c@2:809
<unknown>@961:302
c@2:809
<unknown>@451:436
c@2:809
<unknown>@348:199
c@2:809
<unknown>@310:254
c@2:809
<unknown>@309:231
c@2:809
<unknown>@12:77
c@2:809
i@2:381
global code@1250:8
'
*** First throw call stack:
(0x184453d38 0x183968528 0x100e4dd8c 0x100e4b804 0x18445b6a0 0x18433a820 0x18433f22c 0x100e61738 0x100ea6190 0x100ea5eec 0x1014fd49c 0x1014fd45c 0x10150c110 0x1015009a4 0x10150d104 0x101514100 0x18407efe0 0x18407ec30)
libc++abi.dylib: terminating with uncaught exception of type NSException
@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Jul 15, 2018
@kufufu9
Copy link

kufufu9 commented Jul 15, 2018

+1, same problem on 0.56.

TypeError: undefined is not an object (evaluating 'e.default')

at

const { width, height } = Dimensions.get('window');

But Dimensions is imported

@mmamoyco
Copy link
Author

@kufufu9 how do you find error cause?

@patrickkempff
Copy link
Contributor

How does your import statement look?

@mmamoyco
Copy link
Author

mmamoyco commented Jul 15, 2018

@patrickkempff I dont really know where to find the cause of problem, my index.js

import { AppRegistry } from 'react-native';
import App from './App';

AppRegistry.registerComponent('SCards', () => App);

@kufufu9
Copy link

kufufu9 commented Jul 15, 2018

@godofmadness I was found the cause on https://sentry.io/

@brunsy
Copy link

brunsy commented Jul 15, 2018

This also affects Android release builds (debug is ok)

@mmamoyco mmamoyco changed the title [IOS] Application crash in production (undefined is not an object (evaluating 'r.default')) [IOS / Android] Application crash in production (undefined is not an object (evaluating 'r.default')) Jul 16, 2018
@react-native-bot react-native-bot added the Platform: Android Android applications. label Jul 16, 2018
@ebaynaud
Copy link

ebaynaud commented Jul 16, 2018

Do you use react-navigation? This helped for me: aksonov/react-native-router-flux#3124 (comment)

@mmamoyco
Copy link
Author

issue related to react-navigation: aksonov/react-native-router-flux#3124

@facebook facebook locked as resolved and limited conversation to collaborators Jul 18, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

6 participants