undefined is not a function(evaluating ‘_iterator[typeof Symbol === “function”?Symbol.iterator:”@@iterator”]()’)

undefined is not a function(evaluating ‘_iterator[typeof Symbol === “function”?Symbol.iterator:”@@iterator”]()’)

 

This is how I solved the above infamous problem in my react-native app. I am putting this here as a future reference for myself, hope this will help others along the way. As you will see, I got this error while I was trying to install react-native-charts-wrapper on my react-native application.

Note: I also saw react-native-svg-charts project but it seemed like “wrapper” project is more popular, plus, there could be some maintenance problems with react-native-svg-charts projects in the future as the author stated in the GitHub page:

Now, to the solution (with some useful links):

  • npm view react-native  versions  –json (check the current react-native version)
  • npm install r[email protected]  (update react-native version to fix the babel symbol problem since JSC version was to be updated in react-native 0.59.)
    (https://github.com/facebook/react-native/issues/15902)
    (https://github.com/immutable-js/immutable-js/issues/1305)
  • npm install [email protected] –save (install the required react version for the updated react-native version)
  • npm install [email protected]^0.5.1 –save
  • react-native link react-native-charts-wrapper (sometimes fails. if that happens, unlink and link again)
  • Then this happens –> Could not get unknown property ‘mergeResourcesProvider’ for object of type com.android.build.gradle.internal.api.ApplicationVariantImpl.
    • Do this to fix it: (https://github.com/facebook/react-native/issues/23516)
      • In gradle-wrapper.properties change distributionUrl to distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
      • and in root build.gradle file change gradle classpath to this: classpath ‘com.android.tools.build:gradle:3.3.0’
  • npm i
  • react-native run-android

Hope this helps.
Good Luck,
Serdar