react-native Cannot get property 'packageName' on null object

react-native打包安卓apk的时候,报错Cannot get property 'packageName' on null object
完全没有头绪,研究了半天才发现竟然是因为package.json里面scripts自定了命令导致的
无法理解为何会影响安卓打包并且报错packageName null
还好找到原因了

"scripts": {
    "start": "react-native start",
    "dev": "react-native ***",
    "test": "jest",
    "lint": "eslint ."
  },

文中的"dev": "react-native *", 为自定了命令,会导致这个错误,删除即可

你可能感兴趣的:(react.js,前端,android,react-native)