IOS release build crashes: TypeError: n.render is not a function. (In 'n.render()', 'n.render' is undefined) React Native 0.56

天涯浪子 提交于 2021-01-29 10:11:34

问题


I have recently upgraded to react native 0.56 . I have been getting a lot of errors but I have fixed most of it. But now When I try to run the app in release mode I get this js error .

2019-05-01 11:45:00.625 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: TypeError: n.render is not a function. (In 'n.render()', 'n.render' is undefined)

This error is located at:
    in n
dyld_image_header_containing_address(0x10ba6d27d)
dladdr(0x10fcc329b, 0x7f823a8ad560)
dladdr(0x10da4f735, 0x7f823a8ad580)
dladdr(0x10ba3d6b2, 0x7f823a8ad5a0)
dladdr(0x10ba3a40c, 0x7f823a8ad5c0)
dladdr(0x10fcca11c, 0x7f823a8ad5e0)
dladdr(0x10fcc75b5, 0x7f823a8ad600)
dladdr(0x10fcc7a06, 0x7f823a8ad620)
dladdr(0x10ba50cde, 0x7f823a8ad640)
dladdr(0x10ba96a95, 0x7f823a8ad660)
dladdr(0x10ba96813, 0x7f823a8ad680)
dladdr(0x111f655d1, 0x7f823a8ad6a0)
dladdr(0x111f6663e, 0x7f823a8ad6c0)
dladdr(0x111f6db47, 0x7f823a8ad6e0)
dladdr(0x111f6e7c0, 0x7f823a8ad700)
dladdr(0x111f788b8, 0x7f823a8ad720)
dladdr(0x11231563c, 0x7f823a8ad740)
dladdr(0x112315435, 0x7f823a8ad760)
dlsym_internal(0x7f823a875030, _FSURLBeginResourcePropertyCacheAccess)
  dlsym_internal(0x7f823a875030, _FSURLBeginResourcePropertyCacheAccess) ==> 0x13223940a
dlsym_internal(0x7f823a875030, _FSURLSetResourcePropertyForKey)
  dlsym_internal(0x7f823a875030, _FSURLSetResourcePropertyForKey) ==> 0x132236e00
dlsym_internal(0x7f823a875030, _FSURLEndResourcePropertyCacheAccess)
  dlsym_internal(0x7f823a875030, _FSURLEndResourcePropertyCacheAccess) ==> 0x132239517
dyld_image_header_containing_address(0x10b9be832)
dyld_image_header_containing_address(0x10fcc3801)
libc++abi.dylib: terminating with uncaught exception of type NSException

This occurs both when building through react-native run-ios --configuration Release and through Xcode (with Release configuration). Debug works fine.

React-native version: 0.56 React version: 16.4.1 Xcode version 10.1


回答1:


NeverMind. I solved it by fixing my removing babel.config.js and fixing my .babelrc file to

{
  "env": {
    "development": {
      "presets": ["react-native", "@babel/preset-flow"],
      "plugins": [
        ["@babel/plugin-proposal-decorators", { "legacy": true }],
        [
          "@babel/plugin-transform-runtime",
          {
            "helpers": true,
            "regenerator": false
          }
        ]
      ]
    },
    "production": {
      "presets": ["react-native", "@babel/preset-flow"],
      "plugins": [
        ["@babel/plugin-proposal-decorators", { "legacy": true }],
        "transform-remove-console"
      ]
    }
  }
}


来源:https://stackoverflow.com/questions/55930747/ios-release-build-crashes-typeerror-n-render-is-not-a-function-in-n-render

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!