While taking build on android emulator the build is getting failed every time by showing the following error , but showing build successful with error in emulator.Following is my package.json
{
"name": "AppReact",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.4.1",
"react-native": "^0.55.0"
},
"devDependencies": {
"babel-jest": "23.4.0",
"babel-preset-react-native": "5",
"jest": "23.4.1",
"react-test-renderer": "16.4.1"
},
"jest": {
"preset": "react-native"
}
}
Try to re-add babel preset.
yarn remove babel-preset-react-native
yarn add babel-preset-react-native@2.1.0
If you are using npm use this.
npm uninstall babel-preset-react-native
npm install babel-preset-react-native@2.1.0
Just change from
"babel-preset-react-native": "5",
to
"babel-preset-react-native": "4.0.0",
in package.json file and then just run
npm install
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.