我有这个react-native项目,并且在过去2个月中运行良好,但是现在我在非调试模式下在android上运行构建时遇到了“属性描述应该和对象”错误。它在调试模式下和IOS上都能很好地工作。可以请人指导吗?这是我的package.json
尝试将redux降级到4.0.0并将babel的分辨率放入package.json中,但没有任何效果,错误仍然存在。
"react-native": "0.58.4",
"react-native-action-picker": "^1.0.2",
"react-native-base64": "0.0.2",
"react-native-cli": "^2.0.1",
"react-native-color-palette": "^2.0.2",
"react-native-confirmation-code-input": "^1.0.4",
"react-native-customized-image-picker": "^0.1.5",
"react-native-vector-icons": "^6.6.0",
"react-navigation": "^2.14.2",
"react-redux": "^6.0.1",
"redux": "^4.0.1",
"redux-logger": "^3.0.6",
"redux-persist": "^5.10.0",
"redux-promise": "^0.6.0",
"redux-thunk": "^2.3.0",
```[Here's the error screen][1]
[1]: https://i.stack.imgur.com/KkUVq.png
答案 0 :(得分:1)
更新npm。 redux 4.0.4为我工作
答案 1 :(得分:0)
我在redux中遇到了同样的错误,我解决了。
只需转到: node_modules / redux / lib / redux.js
并替换行:
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(arguments[i], key));
对此:
var descriptor = Object.getOwnPropertyDescriptor(arguments[i], key);
if (descriptor) {
Object.defineProperty(target, key, descriptor);
}