withTheme not a function react native error - react-native

I actually don't know why is this happening. I have some others warning like,
"Error: Warning: AsyncStorage has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from"
I sharing my error log screenshot and package.json file below. Can anybody help me to get out?
{
"name": "eonbazar",
"displayName": "eonbazar",
"description": "MStore Pro - Complete React Native template for e-commerce",
"author": "InpireUI",
"version": "1.0.0",
"private": true,
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"setup": "./scripts/setup.sh",
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject",
"postinstall": "patch-package"
},
"dependencies": {
"#callstack/react-theme-provider": "^2.1.0",
"#material-ui/core": "^4.11.0",
"#material-ui/icons": "^4.9.1",
"#material-ui/styles": "^4.10.0",
"#react-native-community/async-storage": "^1.12.1",
"#react-native-community/masked-view": "0.1.10",
"#react-native-community/viewpager": "4.1.6",
"#react-native-firebase/app": "^8.4.6",
"#unimodules/core": "^5.5.1",
"#unimodules/react-native-adapter": "~5.6.0",
"api-ecommerce": "^0.0.36",
"axios": "^0.20.0",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-preset-env": "^1.7.0",
"base-64": "^1.0.0",
"by": "^0.2.3",
"core-js": "^3.6.5",
"create-react-context": "^0.3.0",
"css-select": "^3.1.0",
"currency-formatter": "^1.5.6",
"eslint": "^7.11.0",
"eslint-config-prettier": "^6.13.0",
"expo": "^39.0.3",
"expo-ads-admob": "~8.3.0",
"expo-ads-facebook": "~8.4.1",
"expo-analytics": "^1.0.16",
"expo-asset": "~8.2.0",
"expo-av": "~8.6.0",
"expo-constants": "~9.2.0",
"expo-facebook": "~9.0.0",
"expo-font": "~8.3.0",
"expo-google-app-auth": "^8.1.3",
"expo-google-sign-in": "~8.3.0",
"expo-linear-gradient": "~8.3.1",
"expo-localization": "~9.0.0",
"expo-web-browser": "~8.5.0",
"firebase": "7.24.0",
"grpc": "^1.24.3",
"html-entities": "^1.3.1",
"lodash": "^4.17.20",
"moment": "2.29.1",
"monet": "0.9.1",
"native-base": "^2.13.14",
"oauth-1.0a": "2.2.6",
"parse": "github:parse-community/Parse-SDK-JS#master",
"patch-package": "^6.2.2",
"path": "^0.12.7",
"postinstall-postinstall": "^2.1.0",
"prop-types": "^15.7.2",
"react": "^16.14.0",
"react-dom": "16.14.0",
"react-instantsearch": "^6.8.1",
"react-instantsearch-dom": "^6.8.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz",
"react-native-animatable": "1.3.3",
"react-native-app-intro-slider": "4.0.4",
"react-native-clean-form": "^0.5.0",
"react-native-collapsible": "1.5.3",
"react-native-confirmation-code-field": "^6.5.0",
"react-native-country-picker-modal": "^2.0.0",
"react-native-credit-card-input": "^0.4.1",
"react-native-dev-menu": "^4.0.2",
"react-native-drawer": "git+https://github.com/luyx2412/react-native-drawer.git",
"react-native-expandable-section-flatlist": "^1.2.2",
"react-native-fluid-slider": "^1.0.2",
"react-native-gesture-handler": "~1.8.0",
"react-native-keyboard-aware-scroll-view": "^0.9.3",
"react-native-keyboard-aware-scrollview": "^2.1.0",
"react-native-localization": "^2.1.6",
"react-native-masked-text": "1.13.0",
"react-native-modalbox": "2.0.2",
"react-native-paper": "4.2.0",
"react-native-parallax": "^0.3.0",
"react-native-radio-buttons": "^1.0.0",
"react-native-reanimated": "~1.13.1",
"react-native-render-html": "4.2.4",
"react-native-safe-area-view": "^1.1.1",
"react-native-screens": "~2.11.0",
"react-native-scrollable-tab-view": "^1.0.0",
"react-native-side-menu": "^1.1.3",
"react-native-snap-carousel": "^3.9.1",
"react-native-star-rating": "^1.1.0",
"react-native-swipe-list-view": "3.2.4",
"react-native-swiper": "^1.6.0",
"react-native-tab-view": "^2.15.2",
"react-native-web": "~0.14.2",
"react-native-webview": "^10.9.2",
"react-native-windows": "^0.63.5",
"react-navigation": "^4.4.2",
"react-navigation-header-buttons": "6.0.0",
"react-navigation-props-mapper": "^1.0.4",
"react-navigation-stack": "^2.8.4",
"react-navigation-tabs": "^2.9.2",
"react-proxy": "^1.1.8",
"react-redux": "7.2.1",
"reactotron-react-js": "^3.3.7",
"redux": "^4.0.5",
"redux-actions": "2.6.5",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0",
"required": "^1.0.0",
"reselect": "4.0.0",
"sentry-expo": "^3.0.2",
"styled-components": "^5.2.0",
"tcomb-form-native": "^0.6.20",
"urijs": "1.19.2",
"url": "^0.11.0",
"url-parse": "1.4.7",
"util": "0.12.3",
"uuid": "8.3.1",
"validate.js": "^0.13.1",
"wpapi": "^1.2.1"
},
"devDependencies": {
"#babel/types": "^7.12.1",
"babel-jest": "26.5.2",
"babel-plugin-transform-remove-console": "^6.9.4",
"babel-preset-expo": "^8.3.0",
"babel-preset-react-native": "4.0.1",
"jest": "26.5.3",
"reactotron-react-native": "5.0.0",
"reactotron-redux": "^3.1.3"
},
"keywords": [
"ecommerce"
],
"license": "ISC"
}

The error is misleading without more code or info, but I had a similar issue. Your problem may be the way withTheme is being imported #callstack/from react-theme-provider. Looking a the docs I had some success with changing the way I retrieved the function from the package. If you are importing it like this:
import { withTheme } from "#callstack/react-theme-provider";
Try instead to do the following:
import { createTheming } from '#callstack/react-theme-provider';
const { withTheme } = createTheming();
If you have a defaultTheme you can pass it as an argument like createTheming(defaultTheme);

Related

React Native Mobile Application Security Test

After archive react-native ios appication, I had test it on Immuniweb mobile application testing tool. I have got security issue given bellow.
EXPOSURE OF POTENTIALLY SENSITIVE DATA [DAST] [M2] [CWE-200]
Potentially sensitive or internal information is detected in the mobile application via tracing its system calls.
[POTENTIAL HEROKU API KEY FOUND]
We did not use HEROKU anyway.
This is my package.json contents.
{
"name": "",
"version": "0.0.1",
"private": true,
"scripts": {
"postinstall": "rn-nodeify --install fs,util,path,tls,stream,buffer,global,process --hack && patch-package",
"android": "ENVFILE=.env react-native run-android",
"start": "react-native start",
"test": "jest",
"lint": "eslint .",
"build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'"
},
"dependencies": {
"#gorhom/bottom-sheet": "^4.4.3",
"#invertase/react-native-apple-authentication": "^2.2.2",
"#react-native-async-storage/async-storage": "^1.17.9",
"#react-native-community/checkbox": "^0.5.12",
"#react-native-community/cli": "^8.0.5",
"#react-native-community/datetimepicker": "^6.3.2",
"#react-native-community/push-notification-ios": "^1.10.1",
"#react-native-masked-view/masked-view": "^0.2.6",
"#react-native-picker/picker": "^2.4.4",
"#react-navigation/bottom-tabs": "^6.3.2",
"#react-navigation/native": "^6.0.10",
"#react-navigation/stack": "^6.2.1",
"#rneui/base": "^0.0.0-edge.2",
"#rneui/themed": "^0.0.0-edge.2",
"#types/jest": "^29.0.0",
"asyncstorage-down": "^4.2.0",
"aws-iot-device-sdk": "^2.2.12",
"aws-sdk": "^2.1203.0",
"axios": "^0.27.2",
"buffer": "^4.9.1",
"global": "^4.4.0",
"jsonwebtoken": "^8.5.1",
"jwt-decode": "^2.2.0",
"lodash.clonedeep": "^4.5.0",
"lodash.get": "^4.4.2",
"lodash.isempty": "^4.4.0",
"lodash.max": "^4.0.1",
"lodash.min": "^4.0.1",
"lodash.omit": "^4.5.0",
"lodash.unionby": "^4.8.0",
"moment": "^2.29.4",
"patch-package": "^6.4.7",
"path-browserify": "0.0.0",
"process": "^0.11.0",
"react": "18.0.0",
"react-native": "^0.69.2",
"react-native-config": "^1.4.6",
"react-native-date-picker": "^4.2.5",
"react-native-device-info": "^10.0.2",
"react-native-encrypted-asyncstorage": "^2.1.3",
"react-native-flash-message": "^0.3.1",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "^2.4.2",
"react-native-iap": "^11.0.0-rc.7",
"react-native-modal-datetime-picker": "^14.0.0",
"react-native-pager-view": "^6.0.0",
"react-native-paper": "^4.12.4",
"react-native-picker-select": "^8.0.4",
"react-native-progress": "^5.0.0",
"react-native-push-notification": "^8.1.1",
"react-native-reanimated": "^2.13.0",
"react-native-safe-area-context": "^4.3.1",
"react-native-screens": "^3.15.0",
"react-native-svg": "^12.4.3",
"react-native-tab-view": "^3.1.1",
"react-native-vector-icons": "^9.2.0",
"react-native-webview": "^11.25.0",
"react-redux": "^7.2.2",
"readable-stream": "1.0.33",
"reanimated-bottom-sheet": "^1.0.0-alpha.22",
"redux": "^4.2.0",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"redux-saga": "^1.1.3",
"rn-swipe-button": "^1.3.7",
"save": "^2.4.0",
"stream": "^0.0.2",
"stream-browserify": "^1.0.0",
"toggle-switch-react-native": "^3.3.0",
"util": "~0.10.3",
"victory-native": "^36.5.3"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "7.13.8",
"#react-native-community/eslint-config": "1.1.0",
"babel-jest": "25.5.1",
"eslint": "^8.23.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"jest": "^28.1.1",
"metro-react-native-babel-preset": "^0.70.3",
"prettier": "^2.7.1",
"react-test-renderer": "18.0.0",
"rn-nodeify": "^10.3.0"
},
"jest": {
"preset": "react-native"
},
"rnpm": {
"assets": [
"./app/assets/fonts"
]
},
"react-native": {
"path": "path-browserify",
"_stream_transform": "readable-stream/transform",
"_stream_readable": "readable-stream/readable",
"_stream_writable": "readable-stream/writable",
"_stream_duplex": "readable-stream/duplex",
"_stream_passthrough": "readable-stream/passthrough",
"stream": "stream-browserify",
"tls": false,
"fs": "react-native-fs"
},
"browser": {
"path": "path-browserify",
"_stream_transform": "readable-stream/transform",
"_stream_readable": "readable-stream/readable",
"_stream_writable": "readable-stream/writable",
"_stream_duplex": "readable-stream/duplex",
"_stream_passthrough": "readable-stream/passthrough",
"stream": "stream-browserify",
"tls": false,
"fs": "react-native-fs"
}
}
I need help to overcome this security issue?

Upgrading from EXPO SDK 44 to 45. IOS doesn't work but android does

I have just upgraded EXPO SDK from 44 to 45.
The issues that I am having:
When I running the app on IOS the app is now super slow
It also has a strange box shadow that appears on the bottom of the screen.
Keyboard also keeps randomly poping up
The app works perfectly on android which is confusing to me. I haven't changed any of the code and on Expo SDK 44 everything was working.
What I have tried:
Downgrading all the react packages to their previous versions apart from react-native
Checking all API calls. In case there is a fetching issue.
These are all the packages that I am using:
{
"name": "iserve-app",
"version": "1.25.0",
"main": "index.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"prepare": "husky install",
"lint": "tsc --noemit && eslint --ext .js,.jsx,.ts,.tsx ./",
"prettier-format": "prettier --config .prettierrc '**/*.{json,js,jsx,ts,tsx,css,scss,md}' --write"
},
"dependencies": {
"#fortawesome/fontawesome": "^1.1.8",
"#fortawesome/fontawesome-free-solid": "^5.0.13",
"#fortawesome/fontawesome-svg-core": "^1.2.36",
"#fortawesome/free-solid-svg-icons": "^5.15.4",
"#fortawesome/react-native-fontawesome": "^0.2.7",
"#openspacelabs/react-native-zoomable-view": "^2.0.4",
"#react-native-async-storage/async-storage": "~1.17.3",
"#react-native-community/netinfo": "8.2.0",
"#reduxjs/toolkit": "^1.7.1",
"#sentry/react-native": "^3.2.11",
"#types/expo": "^33.0.1",
"#types/json-bigint": "^1.0.1",
"buffer": "^6.0.3",
"date-fns": "^2.28.0",
"decimal.js": "^10.3.1",
"dotenv": "^14.1.0",
"eslint": "7.28",
"exact-math": "^2.2.3",
"expo": "^45.0.0",
"expo-application": "~4.1.0",
"expo-asset": "~8.5.0",
"expo-barcode-scanner": "~11.3.0",
"expo-battery": "~6.2.0",
"expo-blur": "~11.1.0",
"expo-camera": "~12.2.0",
"expo-constants": "~13.1.1",
"expo-device": "~4.2.0",
"expo-media-library": "~14.1.0",
"expo-notifications": "~0.15.4",
"expo-permissions": "~13.2.0",
"expo-screen-orientation": "~4.2.0",
"expo-sensors": "~11.3.0",
"expo-splash-screen": "~0.15.1",
"expo-status-bar": "~1.3.0",
"expo-updates": "~0.13.4",
"intl": "^1.2.5",
"json-bigint": "^1.0.0",
"lottie-react-native": "5.0.1",
"moment": "^2.29.3",
"native-base": "^3.3.3",
"patch-package": "^6.4.7",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-native": "0.68.2",
"react-native-animated-loader": "^0.0.9",
"react-native-currency-input": "^1.0.1",
"react-native-device-detection": "^0.2.1",
"react-native-flash-message": "^0.2.1",
"react-native-gesture-handler": "~2.2.1",
"react-native-markdown-renderer": "^3.2.8",
"react-native-network-logger": "^1.12.0",
"react-native-pager-view": "5.4.15",
"react-native-safe-area-context": "4.2.4",
"react-native-segmented-control-tab": "^4.0.0",
"react-native-side-drawer": "^1.2.9",
"react-native-svg": "12.3.0",
"react-native-swipe-detect": "^1.0.10",
"react-native-tab-view": "^3.1.1",
"react-native-tableview-simple": "^4.3.1",
"react-native-toast-notifications": "^3.2.3",
"react-native-uuid": "^2.0.1",
"react-native-web": "0.17.7",
"react-redux": "^7.2.6",
"react-router-native": "^6.2.1",
"redux-persist": "^6.0.0",
"semantic-release-expo": "^2.2.3",
"sentry-expo": "^4.0.0",
"xmldom": "^0.6.0"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#commitlint/cli": "^16.0.2",
"#commitlint/config-conventional": "^16.0.0",
"#semantic-release/changelog": "^6.0.1",
"#semantic-release/git": "^10.0.1",
"#types/react": "^18.0.17",
"#types/react-native": "^0.69.5",
"#types/react-native-dotenv": "^0.2.0",
"#types/react-redux": "^7.1.22",
"#types/react-router-native": "^5.1.3",
"#typescript-eslint/eslint-plugin": "^5.9.1",
"#typescript-eslint/parser": "^5.9.1",
"babel-plugin-module-resolver": "^4.1.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"husky": "^7.0.4",
"prettier": "^2.5.1",
"react-native-dotenv": "^3.3.1",
"semantic-release": "^18.0.1",
"semantic-release-slack-bot": "^3.4.1",
"typescript": "~4.3.5"
},
"private": true
}
Box shadow that appears:

I have no ListView Component but it's still getting back the Invariant violation error in react native

I have no Component like ListView, Icon, Spinner, and others stuff, but it's still getting back the Invariant violation error in my react native project. Can anybody help me? I added my package.json file here. When I type "npm list" in my terminal I get some npm error like the image two. I'm not sure if this problem is happening for my image two errors.
{
"name": "eon-bazar",
"description": "MStore Pro - Complete React Native template for e-commerce",
"author": "InpireUI",
"version": "1.0.0",
"private": true,
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"setup": "./scripts/setup.sh",
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject",
"postinstall": "patch-package"
},
"dependencies": {
"#react-native-community/viewpager": "^4.1.6",
"#react-native-firebase/app": "^8.4.6",
"#unimodules/core": "^5.1.2",
"api-ecommerce": "^0.0.36",
"axios": "^0.18.0",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-preset-env": "^1.7.0",
"base-64": "^0.1.0",
"by": "^0.2.3",
"create-react-context": "^0.2.3",
"css-select": "^3.1.0",
"currency-formatter": "^1.4.2",
"eslint": "^3.14.1",
"eslint-config-prettier": "^6.13.0",
"expo": "^39.0.0",
"expo-ads-admob": "~8.3.0",
"expo-ads-facebook": "~8.4.0",
"expo-analytics": "^1.0.8",
"expo-asset": "~8.2.0",
"expo-av": "~8.6.0",
"expo-constants": "~9.2.0",
"expo-facebook": "~9.0.0",
"expo-font": "~8.3.0",
"expo-google-app-auth": "^7.0.0",
"expo-google-sign-in": "~8.3.0",
"expo-linear-gradient": "~8.3.0",
"expo-localization": "~9.0.0",
"expo-web-browser": "~8.5.0",
"firebase": "^7.9.0-0",
"grpc": "^1.24.3",
"html-entities": "^1.2.1",
"lodash": "4.17.11",
"moment": "2.24.0",
"monet": "0.9.0",
"native-base": "^2.13.14",
"oauth-1.0a": "1.0.1",
"parse": "github:parse-community/Parse-SDK-JS#master",
"patch-package": "^6.1.2",
"path": "^0.12.7",
"postinstall-postinstall": "^2.0.0",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-instantsearch": "^5.1.0",
"react-instantsearch-dom": "^5.7.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz",
"react-native-animatable": "1.3.2",
"react-native-app-intro-slider": "2.0.1",
"react-native-clean-form": "^0.5.0",
"react-native-collapsible": "1.4.0",
"react-native-country-picker-modal": "^0.7.1",
"react-native-credit-card-input": "^0.4.1",
"react-native-dev-menu": "^4.0.2",
"react-native-drawer": "git+https://github.com/luyx2412/react-native-drawer.git",
"react-native-expandable-section-flatlist": "^1.2.2",
"react-native-fluid-slider": "^1.0.2",
"react-native-gesture-handler": "~1.7.0",
"react-native-keyboard-aware-scroll-view": "^0.8.0",
"react-native-localization": "^2.1.6",
"react-native-masked-text": "1.11.1",
"react-native-modalbox": "1.7.1",
"react-native-paper": "2.15.0",
"react-native-parallax": "^0.3.0",
"react-native-radio-buttons": "^1.0.0",
"react-native-reanimated": "~1.13.0",
"react-native-render-html": "4.1.2",
"react-native-screens": "^2.11.0",
"react-native-scrollable-tab-view": "^1.0.0",
"react-native-side-menu": "^1.1.3",
"react-native-snap-carousel": "^3.6.0",
"react-native-star-rating": "^1.0.9",
"react-native-svg": "^5.5.1",
"react-native-svg-uri": "^1.2.3",
"react-native-swipe-list-view": "1.5.3",
"react-native-swiper": "^1.6.0-rc.3",
"react-native-web": "^0.13.18",
"react-native-windows": "^0.41.0",
"react-navigation": "^4.0.10",
"react-navigation-header-buttons": "2.2.0",
"react-navigation-props-mapper": "^0.4.0",
"react-navigation-stack": "^1.10.3",
"react-navigation-tabs": "^2.5.6",
"react-redux": "6.0.1",
"redux": "^4.0.0",
"redux-actions": "2.6.5",
"redux-persist": "^5.9.1",
"redux-thunk": "^2.3.0",
"required": "^1.0.0",
"reselect": "4.0.0",
"sentry-expo": "^2.0.1",
"styled-components": "^5.2.0",
"tcomb-form-native": "^0.6.13",
"urijs": "1.19.1",
"url": "^0.11.0",
"url-parse": "1.4.4",
"util": "0.11.1",
"uuid": "3.3.2",
"validate.js": "^0.12.0",
"wpapi": "^1.2.1"
},
"devDependencies": {
"babel-jest": "25.1.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"babel-preset-expo": "^8.3.0",
"babel-preset-react-native": "4.0.1",
"jest": "25.1.0",
"reactotron-react-native": "3.2.1",
"reactotron-redux": "3.1.0"
},
"keywords": [
"ecommerce"
],
"license": "ISC"
}

bundling failed: TypeError: Cannot read property 'bindings' of null at Scope.moveBindingTo

I've updated react native to 0.59.5 and am getting this error:
bundling failed: TypeError: Cannot read property 'bindings' of null
at Scope.moveBindingTo (/Users/ben/vepo/frontend/node_modules/#babel/traverse/lib/scope/index.js:864:13)
at convertBlockScopedToVar (/Users/ben/vepo/frontend/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:139:13)
at PluginPass.VariableDeclaration (/Users/ben/vepo/frontend/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:26:9)
at newFn (/Users/ben/vepo/frontend/node_modules/#babel/traverse/lib/visitors.js:193:21)
at NodePath._call (/Users/ben/vepo/frontend/node_modules/#babel/traverse/lib/path/context.js:53:20)
at NodePath.call (/Users/ben/vepo/frontend/node_modules/#babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (/Users/ben/vepo/frontend/node_modules/#babel/traverse/lib/path/context.js:88:12)
at TraversalContext.visitQueue (/Users/ben/vepo/frontend/node_modules/#babel/traverse/lib/context.js:118:16)
at TraversalContext.visitSingle (/Users/ben/vepo/frontend/node_modules/#babel/traverse/lib/context.js:90:19)
Ive seen solutions to upgrade babel-preset-react-native to 5.0.2. I've done that and it didn't work. Another solution was to use metro-react-native-babel-preset instead. That didn't work either. Another solution was to use #babel/preset-env. That didn't work either. I even commented out the code that the error is complaining about so I don't even know how it is giving the same error on that commented out line of code now...Any ideas?
package.json
{
"name": "vepo",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"rnpm": {
"assets": [
"./app/fonts"
]
},
"jest": {
"preset": "react-native",
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
"\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js"
}
},
"dependencies": {
"#babel/core": "^7.4.3",
"#babel/preset-env": "^7.4.3",
"babel-preset-react-native": "5.0.2",
"flow-typed": "^2.4.0",
"generator-rn-toolbox": "^2.2.0",
"imagemagick": "^0.1.3",
"immutable": "4.0.0-rc.9",
"list": "^2.0.15",
"metro-bundler": "^0.22.1",
"metro-react-native-babel-preset": "^0.53.1",
"native-base": "^2.3.3",
"prop-types": "^15.5.10",
"react": "16.8.3",
"react-native": "0.59.5",
"react-native-aws3": "^0.0.8",
"react-native-blur": "^3.1.3",
"react-native-check-box": "^2.1.0",
"react-native-communications": "^2.2.1",
"react-native-drawer": "^2.3.0",
"react-native-easy-toast": "^1.2.0",
"react-native-elements": "^0.19.1",
"react-native-fbsdk": "^0.8.0",
"react-native-gesture-handler": "1.0.12",
"react-native-git-upgrade": "^0.2.7",
"react-native-image-picker": "^0.26.7",
"react-native-interactable": "0.1.2",
"react-native-mail": "^3.0.2",
"react-native-maps": "^0.16.4",
"react-native-modal": "^2.3.2",
"react-native-modalbox": "^1.3.9",
"react-native-multiple-choice": "^0.0.8",
"react-native-navigation": "^1.1.100",
"react-native-off-canvas-menu": "^0.1.31",
"react-native-optimized-flatlist": "^1.0.1",
"react-native-redux-router": "^1.0.7",
"react-native-root-toast": "^3.0.2",
"react-native-select-multiple": "^1.0.3",
"react-native-side-menu": "^0.20.1",
"react-native-vector-icons": "^5.0.0",
"react-navigation": "3.0.8",
"react-navigation-tabs": "^1.0.1",
"react-redux": "^5.0.3",
"redux": "^3.6.0",
"redux-immutable": "^4.0.0",
"redux-observable": "^0.14.1",
"redux-thunk": "^2.3.0",
"reselect": "^3.0.0",
"rxjs": "^5.2.0",
"yarn": "^1.3.2",
"yoga": "^0.0.0"
},
"devDependencies": {
"adm-zip": "^0.4.11",
"babel-cli": "^6.26.0",
"babel-eslint": "^7.1.1",
"babel-plugin-module-resolver": "^2.7.0",
"babel-preset-flow": "^6.23.0",
"eslint": "^3.17.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-flowtype": "^2.30.3",
"eslint-plugin-jsx": "^0.0.2",
"eslint-plugin-react": "^6.10.0",
"eslint-plugin-react-native": "^2.3.1",
"flow-bin": "^0.75.0",
"plist": "^2.1.0",
"react-devtools": "^3.2.1",
"react-test-renderer": "~15.4.1",
"redux-devtools": "^3.3.2",
"remote-redux-devtools": "^0.5.7",
"remotedev-server": "^0.2.4",
"xcode": "^1.0.0"
}
}
.babelrc
{
"presets": ["#babel/preset-env"]
}
When I restarted my computer it worked.
code that worked:
.babelrc
{
"presets": ["module:metro-react-native-babel-preset"]
}
package.json
{
"name": "vepo",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"rnpm": {
"assets": [
"./app/fonts"
]
},
"jest": {
"preset": "react-native",
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
"\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js"
}
},
"dependencies": {
"#babel/core": "^7.4.3",
"#babel/preset-env": "^7.4.3",
"babel-preset-react-native": "5.0.2",
"flow-typed": "^2.4.0",
"generator-rn-toolbox": "^2.2.0",
"imagemagick": "^0.1.3",
"immutable": "4.0.0-rc.9",
"list": "^2.0.15",
"metro-bundler": "^0.22.1",
"metro-react-native-babel-preset": "^0.53.1",
"native-base": "2.12.1",
"prop-types": "^15.5.10",
"react": "16.8.3",
"react-native": "0.59.5",
"react-native-aws3": "^0.0.8",
"react-native-blur": "^3.1.3",
"react-native-check-box": "^2.1.0",
"react-native-communications": "^2.2.1",
"react-native-drawer": "^2.3.0",
"react-native-easy-toast": "^1.2.0",
"react-native-elements": "^0.19.1",
"react-native-fbsdk": "^0.8.0",
"react-native-gesture-handler": "1.0.12",
"react-native-git-upgrade": "^0.2.7",
"react-native-image-picker": "^0.26.7",
"react-native-interactable": "0.1.2",
"react-native-mail": "^3.0.2",
"react-native-maps": "^0.16.4",
"react-native-modal": "^2.3.2",
"react-native-modalbox": "^1.3.9",
"react-native-multiple-choice": "^0.0.8",
"react-native-navigation": "^1.1.100",
"react-native-off-canvas-menu": "^0.1.31",
"react-native-optimized-flatlist": "^1.0.1",
"react-native-redux-router": "^1.0.7",
"react-native-root-toast": "^3.0.2",
"react-native-select-multiple": "^1.0.3",
"react-native-side-menu": "^0.20.1",
"react-native-vector-icons": "^5.0.0",
"react-navigation": "3.0.8",
"react-navigation-tabs": "^1.0.1",
"react-redux": "^5.0.3",
"react-timer-mixin": "^0.13.4",
"redux": "^3.6.0",
"redux-immutable": "^4.0.0",
"redux-observable": "^0.14.1",
"redux-thunk": "^2.3.0",
"reselect": "^3.0.0",
"rxjs": "^5.2.0",
"yarn": "^1.3.2",
"yoga": "^0.0.0"
},
"devDependencies": {
"adm-zip": "^0.4.11",
"babel-cli": "^6.26.0",
"babel-eslint": "^7.1.1",
"babel-plugin-module-resolver": "^2.7.0",
"babel-preset-flow": "^6.23.0",
"eslint": "^3.17.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-flowtype": "^2.30.3",
"eslint-plugin-jsx": "^0.0.2",
"eslint-plugin-react": "^6.10.0",
"eslint-plugin-react-native": "^2.3.1",
"flow-bin": "^0.75.0",
"plist": "^2.1.0",
"react-devtools": "^3.2.1",
"react-test-renderer": "~15.4.1",
"redux-devtools": "^3.3.2",
"remote-redux-devtools": "^0.5.7",
"remotedev-server": "^0.2.4",
"xcode": "^1.0.0"
}
}

React Native app:bundleReleaseJsAndAssets Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option

When I run ./gradlew assembleRelease I get back this error:
Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
index.js: The 'decorators' plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean. If you are migrating from Babylon/Babel 6 or want to use the old decorators proposal, you should use the 'decorators-legacy' plugin instead of 'decorators'.
Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean. If you are migrating from Babylon/Babel 6 or want to use the old decorators proposal, you should use the 'decorators-legacy' plugin instead of 'decorators'.
I'm not using #Babel, but babel in my package.json file:
{
"name": "my-app",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"#ptomasroos/react-native-multi-slider": "0.0.12",
"firebase": "^5.1.0",
"javascript-time-ago": "^1.0.30",
"mobx": "^4.1.1",
"mobx-react": "^5.0.0",
"native-base": "^2.8.1",
"prop-types": "^15.6.2",
"protobufjs": "^6.8.8",
"react": "16.2.0",
"react-native": "^0.57.7",
"react-native-actionsheet": "^2.3.0",
"react-native-aws3": "0.0.8",
"react-native-axios": "^0.17.1",
"react-native-billing": "^2.9.1",
"react-native-card-stack-swiper": "^1.0.5",
"react-native-collapsible": "^0.10.0",
"react-native-cookies": "^3.2.0",
"react-native-datepicker": "^1.6.0",
"react-native-dropdownalert": "^3.5.0",
"react-native-elements": "^0.19.0",
"react-native-event-listeners": "^1.0.3",
"react-native-expandable-section-flatlist": "^1.0.3",
"react-native-fbsdk": "^0.8.0",
"react-native-fcm": "^16.0.0",
"react-native-floating-action": "^1.10.1",
"react-native-geocoding": "^0.3.0",
"react-native-gifted-chat": "^0.4.3",
"react-native-google-places-autocomplete": "^1.3.6",
"react-native-hide-show-password-input": "^1.0.7",
"react-native-image-crop-picker": "^0.19.3",
"react-native-image-picker": "^0.26.10",
"react-native-image-placeholder": "^1.0.14",
"react-native-instagram-login": "^1.0.7",
"react-native-keyboard-aware-scroll-view": "^0.4.4",
"react-native-keyboard-aware-scrollview": "^2.0.0",
"react-native-keyboard-spacer": "^0.4.1",
"react-native-linear-gradient": "^2.4.0",
"react-native-linkedin": "^1.3.1",
"react-native-localization": "^2.0.0",
"react-native-material-bottom-navigation": "^0.9.0",
"react-native-modal-datetime-picker": "^6.0.0",
"react-native-open-settings": "^1.0.1",
"react-native-pages": "^0.7.0",
"react-native-permissions": "^1.1.1",
"react-native-picker-select": "^5.1.0",
"react-native-popup-menu": "^0.12.4",
"react-native-pulse": "^1.0.6",
"react-native-scrollable-tab-view": "^0.8.0",
"react-native-share": "^1.0.26",
"react-native-simple-toast": "0.0.8",
"react-native-snap-carousel": "^3.7.2",
"react-native-splash-screen": "^3.0.6",
"react-native-star-rating": "^1.0.9",
"react-native-swipe-cards": "^0.1.1",
"react-native-swipe-list-view": "^1.0.7",
"react-native-swipeable-flat-list": "0.0.5",
"react-native-swipeout": "^2.3.3",
"react-native-switch": "^1.4.0",
"react-native-twitter-signin": "github:GoldenOwlAsia/react-native-twitter-signin#master",
"react-native-view-more-text": "^2.0.1",
"react-native-viewpager": "^0.2.13",
"react-navigation": "^1.0.3",
"rn-viewpager": "^1.2.9"
},
"devDependencies": {
"babel-jest": "22.2.2",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-react-native": "4.0.0",
"jest": "22.2.2",
"react-test-renderer": "16.2.0"
},
"jest": {
"preset": "react-native"
}
}
I finally solved this by installing this package: #babel/plugin-proposal-decorators and removing this one: babel-plugin-transform-decorators-legacy
And finally changing the plugins section of my .babelrc to this:
{
"presets": ["react-native"],
"plugins": [
["#babel/plugin-proposal-decorators", {"legacy": true}]
]
}