Linked Questions

Popular Questions

Since I upgraded my project to react-native: 0.58.4 I can't build an android version anymore.

My package.json:

{
  "name": "project",
  "version": "1.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "lint": "eslint app --fix",
    "test": "jest",
    "postinstall": "cd node_modules/react-native/React/..; exec ./scripts/ios-install-third-party.sh"
  },
  "dependencies": {
    "axios": "^0.16.1",
    "babel-preset-react-native": "^4.0.1",
    "moment": "^2.18.1",
    "react": "16.8.1",
    "react-native": "0.58.4",
    "react-native-blur": "^3.2.2",
    "react-native-camera": "^1.10.1",
    "react-native-datepicker": "^1.7.2",
    "react-native-extended-stylesheet": "^0.11.1",
    "react-native-fetch-blob": "^0.10.8",
    "react-native-fs": "^2.13.3",
    "react-native-i18n": "^2.0.15",
    "react-native-image-crop-picker": "^0.22.0",
    "react-native-keyboard-aware-scroll-view": "^0.6.0",
    "react-native-linear-gradient": "^2.4.0",
    "react-native-looped-carousel": "^0.1.13",
    "react-native-maps": "^0.21.0",
    "react-native-maps-super-cluster": "^1.4.1",
    "react-native-pdf": "^3.0.17",
    "react-native-photo-view": "^1.5.2",
    "react-native-qrcode": "^0.2.6",
    "react-native-qrcode-scanner": "^1.1.0",
    "react-native-rate": "^1.1.2",
    "react-native-router-flux": "^4.0.0-beta.31",
    "react-native-scrollable-tab-view": "^0.8.0",
    "react-native-snap-carousel": "^3.6.0",
    "react-native-star-rating": "^1.0.8",
    "react-native-swipe-list-view": "^1.3.1",
    "react-native-vector-icons": "6.0.2",
    "react-native-wkwebview-reborn": "^1.20.0",
    "react-navigation": "^2.17.0",
    "react-redux": "5.0.7",
    "redux": "^3.7.2",
    "redux-devtools-extension": "^2.13.5",
    "redux-thunk": "^2.3.0"
  },
  "devDependencies": {
    "@babel/cli": "^7.2.3",
    "@babel/core": "^7.2.2",
    "@babel/plugin-proposal-class-properties": "^7.3.0",
    "@babel/plugin-proposal-decorators": "^7.3.0",
    "@babel/plugin-transform-runtime": "^7.2.0",
    "@babel/preset-env": "^7.3.1",
    "axios-mock-adapter": "^1.16.0",
    "babel-eslint": "^10.0.1",
    "babel-jest": "24.1.0",
    "enzyme": "^3.8.0",
    "enzyme-adapter-react-16": "^1.6.0",
    "enzyme-to-json": "^3.3.4",
    "eslint": "^4.16.0",
    "eslint-plugin-react": "^7.8.2",
    "eslint-plugin-react-native": "^3.2.1",
    "jest": "^24.1.0",
    "metro-react-native-babel-preset": "^0.51.1",
    "mockdate": "^2.0.2",
    "moxios": "^0.4.0",
    "react-dom": "16.8.1",
    "react-native-i18n": "^2.0.15",
    "react-native-mock": "^0.3.1",
    "react-native-mock-render": "^0.1.2",
    "react-test-renderer": "16.5.2",
    "redux-mock-store": "^1.5.3",
    "sinon": "^6.1.4"
  },
  "jest": {
    "preset": "react-native",
    "setupTestFrameworkScriptFile": "<rootDir>/testsconfig.js",
    "snapshotSerializers": [
      "./node_modules/enzyme-to-json/serializer"
    ],
    "transformIgnorePatterns": [
      "node_modules/(?!(jest-)?react-native|react-navigation|react-native-fetch-blob)"
    ],
    "collectCoverage": true,
    "coverageReporters": [
      "lcov"
    ]
  }
}

my .babelrc

{
  "presets": [
    "module:metro-react-native-babel-preset",
    "module:react-native",
    "@babel/env"
  ],
  "plugins": [
    [
      "@babel/plugin-proposal-decorators",
      {
        "legacy": true
      }
    ]
  ]
}

When I try to react-native run-android I get this error:

index.android.js: Plugin/Preset files are not allowed to export objects, only functions. In /../node_modules/react-native/Libraries/react-native/react-native-implementation.js

I already tried the following things to resolve this:

rm -rf node_modules/ && npm install

rm -fr $TMPDIR/metro

also have found several issues here or on github where this problem is stated, but no solution worked for me.

Does anyone has some idea how I can solve this? I don't really want to downgrade react-native to 0.55.X or something like that.

Thanks Mike

Related Questions