Cannot read property 'forEach' of undefined

Every time when i publish my ReactNative App Expo getting below error.
Building iOS bundle
Building Android bundle
Building JavaScript bundle [=====================================================================================] 100%Finished building JavaScript bundle in 1563ms.
Finished building JavaScript bundle in 1288ms.
Analyzing assets
Finished building JavaScript bundle in 7428ms.
Finished building JavaScript bundle in 6584ms.
Uploading assets
No assets to upload, skipped.
Processing asset bundle patterns:

  • D:\MobileApp\assets*
    *Cannot read property 'forEach' of undefined*

please help me to fix this issue.

below is my App.json

{
  "expo": {
    "sdkVersion": "32.0.0",
    "icon": "./assets/android-icon.png",
    "slug": "testapp",
    "loading": {
      "hideExponentText": true,
      "backgroundImage": "./assets/Default@2x~iphone~comany.png"
    },
    "orientation": "portrait",
    "primaryColor": "#cccccc",
    "packagerOpts": {
      "assetExts": [
        "ttf"
      ]
    },
    "androidStatusBarColor": "#334393",
    "androidStatusBar": {
      "barStyle": "light-content",
      "backgroundColor": "#334393"
    },
    "assetBundlePatterns": [
      "assets/*"
    ],
    "splash": {
      "image": "./assets/Default@2x~iphone~comany.png",
      "backgroundColor": "#FEF9B0"
    },
    "ios": {
      "bundleIdentifier": "com.app.test"
    },
    "android": {
      "package": "com.app.test"
    },
    "name": "Test App",
    "version": "2.5.0",
    "platforms": [
      "android",
      "ios"
    ],
    "description": ""
  }
}

Can you share your package.json file, as well?

This is my package.json

{
  "name": "NativebaseKitchenSink",
  "version": "2.5.0",
  "private": true,
  "devDependencies": {
    "babel-eslint": "7.2.3",
    "babel-preset-expo": "^5.0.0",
    "eslint": "4.4.1",
    "eslint-plugin-flowtype": "2.35.0",
    "eslint-plugin-import": "2.7.0",
    "eslint-plugin-jsx-a11y": "6.0.2",
    "eslint-plugin-prettier": "2.1.2",
    "eslint-plugin-react": "7.1.0",
    "eslint-plugin-react-native": "3.0.1",
    "flow-bin": "0.52.0",
    "flow-typed": "2.1.5",
    "husky": "0.14.3",
    "jest": "20.0.4",
    "jest-expo": "32.0.0",
    "prettier": "1.5.3",
    "react-native-scripts": "1.11.1",
    "react-test-renderer": "16.2.0"
  },
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "eject": "expo eject"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@expo/vector-icons": "9.0.0",
    "color": "1.0.3",
    "expo": "32.0.0",
    "lodash": "4.13.1",
    "moment": "2.13.0",
    "native-base": "2.11.0",
    "react": "16.5.0",
    "react-native": "0.57.0",
    "react-native-animatable": "^1.3.2",
    "react-native-barcode-builder": "^1.0.5",
    "react-native-config": "^0.11.7",
    "react-native-easy-grid": "^0.2.1",
    "react-native-image-header-scroll-view": "^0.10.1",
    "react-native-open-maps": "^0.3.3",
    "react-native-phone-call": "^1.0.9",
    "react-native-root-toast": "^3.0.2",
    "react-native-scrollable-tab-view": "^0.10.0",
    "react-native-sectioned-multi-select": "^0.6.5",
    "react-native-vector-icons": "^6.4.2",
    "react-navigation": "3.3.0"
  }
}

You’ll need to make some changes to your package.json file, we list the changes in every release notes (here is the one for the SDK you’re using)

Also, this Github issue deals with the same problem- always google your issue first to see if someone has already found a fix! :+1:

Thank you @charliecruzan . Finally Fixed the issue,

i did below changes in package.json.

 "dependencies": {
    "@expo/vector-icons": "9.0.0",
    "color": "1.0.3",
    "expo": "^32.0.0",
    "lodash": "4.13.1",
    "moment": "2.13.0",
    "native-base": "2.11.0",
    "react": "16.5.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
    "react-native-animatable": "^1.3.2",
    "react-native-barcode-builder": "^1.0.5",
    "react-native-config": "^0.11.7",
    "react-native-easy-grid": "^0.2.1",
    "react-native-image-header-scroll-view": "^0.10.1",
    "react-native-open-maps": "^0.3.3",
    "react-native-phone-call": "^1.0.9",
    "react-native-root-toast": "^3.0.2",
    "react-native-scrollable-tab-view": "^0.10.0",
    "react-native-sectioned-multi-select": "^0.6.5",
    "react-native-vector-icons": "^6.4.2",
    "react-navigation": "^3.0.9"
  }
1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.