1

I receive this error after running ./gradlew assembleRelease:

    Plugin/Preset files are not allowed to export objects, only functions.
 In C:\..\node_modules\babel-preset-expo\index.js

    :app:bundleReleaseJsAndAssets FAILED

    **FAILURE: Build failed with an exception.**

This is what I have in package.json file:

{
  "name": "Mascota24",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "babel-preset-stage-0": "^6.24.1",
    "react-test-renderer": "16.3.1"
  },
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "test": "jest"
  },
  "jest": {
    "preset": "react-native"
  },
  "dependencies": {
    "@babel/preset-react": "^7.0.0-beta.53",
    "babel-preset-env": "^1.7.0",
    "babel-preset-expo": "^4.0.0",
    "babel-preset-react": "^6.24.1",
    "babel-preset-react-native": "^2.1.0",
    "babel-preset-react-native-stage-0": "^1.0.1",
    "react": "16.3.1",
    "react-native": "^0.56.0",
    "react-native-circle-checkbox": "^0.1.6",
    "react-native-modal": "^6.4.0",
    "react-native-phone-call": "^1.0.7",
    "react-navigation": "^2.6.2",
    "react-redux": "^5.0.7",
    "redux-thunk": "^2.3.0"
  }
}

And this is .babelrc file:

{
  "presets": ["babel-preset-expo"],
  "env": {
    "development": {
      "plugins": ["transform-react-jsx-source"]
    }
  }
}

I've followed almost every post here related with this and none of them helped me :( Thanks for any help

Vahid Boreiri
  • 3,418
  • 1
  • 19
  • 34
Guille
  • 370
  • 2
  • 7
  • 21
  • Add you error please – HpDev Jul 12 '18 at 18:34
  • @ashutoshpandey the error is: "Plugin/Preset files are not allowed to export objects, only functions. In C:\..\node_modules\babel-preset-expo\index.js :app:bundleReleaseJsAndAssets FAILED **FAILURE: Build failed with an exception.**" – Guille Jul 12 '18 at 18:45
  • let me check now – HpDev Jul 12 '18 at 18:48
  • did you run any update command – HpDev Jul 12 '18 at 18:53
  • 1
    https://stackoverflow.com/questions/51210574/create-react-native-app-plugin-preset-files-are-not-allowed-to-export-objects Check this link aroudn – HpDev Jul 12 '18 at 18:55
  • i run "npm update" as part of the possible solutions i found, but before that it wasn't working neither... – Guille Jul 12 '18 at 18:55
  • can you check above link – HpDev Jul 12 '18 at 18:58
  • i checked, i changed the version to "react-native": "^0.55" but still the same :( – Guille Jul 12 '18 at 19:01
  • wait.., the error changed, now it's "Unable to resolve module `redux` from `C:\Users\Digital\Mascota24\store.js`: Module `redux` does not exist in the Haste module map" – Guille Jul 12 '18 at 19:06
  • 1
    Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/174906/discussion-between-ashutosh-pandey-and-guille). – HpDev Jul 12 '18 at 19:08
  • Look in this issue https://stackoverflow.com/questions/51210574/create-react-native-app-plugin-preset-files-are-not-allowed-to-export-objects Check this link it work for you . – HpDev Jul 12 '18 at 19:13
  • 1
    Look in this issue https://stackoverflow.com/questions/51210574/create-react-native-app-plugin-preset-files-are-not-allowed-to-export-objects Check this link it work for you . – HpDev Jul 12 '18 at 19:13

1 Answers1

0

Thanks to @ashutosh pandey for the help, I changed react-native version to:

"react-native": "^0.55"

Then I installed redux and could generate the .apk! :D

Vahid Boreiri
  • 3,418
  • 1
  • 19
  • 34
Guille
  • 370
  • 2
  • 7
  • 21