re-natal icon indicating copy to clipboard operation
re-natal copied to clipboard

RN 57 lein prod-build crashes: "goog.global is not an Object."

Open CalderBot opened this issue 6 years ago • 7 comments

Running xcode 10.1, re-natal 0.10.0.

Steps to reproduce:

re-natal init testapp -i reagent6
lein prod-build
re-natal xcode
  • Now in the xCode window set the required build signing and run the project.
  • The app crashes on startup with: Exception: goog.global is not an Object. (evaluating '"StopIteration" in goog.global')

Any ideas? This does not happen in re-natal 0.9. Thanks!

CalderBot avatar Dec 17 '18 00:12 CalderBot

May be the same as the advanced-build issue https://github.com/drapanjanas/re-natal/issues/210

As mentioned there, the patch in https://github.com/drapanjanas/re-natal/issues/203 does not solve the problem.

CalderBot avatar Dec 24 '18 03:12 CalderBot

This is resolved by removing the ignores that were recently added to .babelrc. So the entire .babelrc should be:

{
  "presets": [
    "module:metro-react-native-babel-preset"
  ]
}

If someone wants to explain why the ignores were added (and why they cause a problem), please comment!

CalderBot avatar Jan 02 '19 20:01 CalderBot

This is resolved by removing the ignores that were recently added to .babelrc. So the entire .babelrc should be:

{
  "presets": [
    "module:metro-react-native-babel-preset"
  ]
}

If someone wants to explain why the ignores were added (and why they cause a problem), please comment!

It fixed goog.global is not an Object, however after removing ignores there is a new error ...

ReactNativeJS: undefined is not an object (evaluating 'this.__reactAutoBindPairs')
ReactNative: ReactInstanceManager.detachViewFromInstance()

ne1ro avatar Jan 31 '19 10:01 ne1ro

@CalderBot my npm stack blows if i remove ignores for .babelrc have you encountered that?

StankovicMarko avatar Apr 11 '19 10:04 StankovicMarko

@StankovicMarko Just retried (node v9.8.0, npm v5.6.0, xcode v10.2) and it worked fine for me. Sorry. Here were the steps:

Install:

re-natal init testapp -i reagent6
cd testapp

Fix .babelrc:

cat <<EOF > .babelrc
{
  "presets": [
    "module:metro-react-native-babel-preset"
  ]
}
EOF
lein prod-build
re-natal xcode

Then in xcode:

  1. add signing identities
  2. [OPTIONAL] product > scheme > edit scheme > Build Configuration > Run > change “Debug” to “Release”
  3. Build and Run the project (xcode play button)

CalderBot avatar Apr 11 '19 15:04 CalderBot

@CalderBot i am basically doing the same but with android and this is what i get https://github.com/drapanjanas/re-natal/issues/220 i even did example app out the box with steps in 220 issue but it still persists

Do you have any advice for me how to continue?

Is it possible to get code in such state where it would compile but apk is faulty?

StankovicMarko avatar Apr 11 '19 16:04 StankovicMarko

It helps a lot! Thank you!

kisakov avatar Apr 17 '19 05:04 kisakov