When running the xample project (npm install -> react-native run-ios), the app launches but immediately crashes with the error:
Run example app as usual, get this error:
Unhandled JS Exception: TypeError: methods.forEach is not a function. (In 'methods.forEach', 'methods.forEach' is undefined)
Also, I am able to build the project successfully in Xcode, but still get this error immediately after the app actually launches. A quick search through both the Xcode project and the JS files reveals no references to "methods.forEach" that I could find. Also, I should add that I was able to add gifted chat to my own project with no issues, so it only happens with the example project. Any idea why this is happening?
我也遇到这个问题了,后来解决了:
你可能run了多个项目,run 当前的项目的时候 确保 上一个项目 的npm start 是关闭的
Google translate of @wangdetong's comment because it helped me.
I have encountered this problem, and later resolved:
You may run a number of projects, run the current project to ensure that the last project npm start is closed
I had another project on a later version of react-native whose packager was still running. Killing that and re-running the project fixed this problem for me.
@wangdetong Comments in English helps more people. Thanks. Your comment helped me, too.
Most helpful comment
Google translate of @wangdetong's comment because it helped me.
I had another project on a later version of react-native whose packager was still running. Killing that and re-running the project fixed this problem for me.