React-native: Stuck on :app:bundleReleaseJsAndAssets - Mac OS

Created on 24 Sep 2016  路  13Comments  路  Source: facebook/react-native

Hello I'm using [email protected], everything works fine in development mode but when I'm triying to compile using ./gradlew assembleReleasese Im getting stuck on 90%

.... A lot of output

Executing task ':app:bundleReleaseJsAndAssets' (up-to-date check took 1.837 secs) due to:
  Output file /Users/innventto/Documents/projects/Conconcreto/bitacora/android/app/build/intermediates/res/merged/release/drawable-mdpi/node_modules_reactnative_libraries_customcomponents_navigationexperimental_assets_backicon.png has been removed.
  Output file /Users/innventto/Documents/projects/Conconcreto/bitacora/android/app/build/intermediates/res/merged/release/drawable-hdpi/node_modules_reactnative_libraries_customcomponents_navigationexperimental_assets_backicon.png has been removed.
  Output file /Users/innventto/Documents/projects/Conconcreto/bitacora/android/app/build/intermediates/res/merged/release/drawable-xxxhdpi/node_modules_reactnative_libraries_customcomponents_navigationexperimental_assets_backicon.png has been removed.
> Building 90% > :app:bundleReleaseJsAndAssets

Package.json

{
  "name": "App",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "react-native": "react-native",
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest",
    "dev-android": "ENVFILE=.env react-native run-android",
    "dev-ios": "ENVFILE=.env node node_modules/react-native/local-cli/cli.js run-android",
    "shake": "adb shell input keyevent KEYCODE_MENU",
    "build-android-release": "cd android && ./gradlew assembleRelease && cd ..",
    "clean-test": "sh ./scripts/run-test.sh"
  },
  "jest": {
    "setupFiles": [
      "node_modules/react-native/jestSupport/env.js"
    ],
    "preset": "jest-react-native",
    "verbose": true,
    "testPathIgnorePatterns": [
      "/node_modules/",
      "packager/react-packager/src/Activity/"
    ],
    "testRegex": "/__tests__/.*?\\.test\\.js$",
    "setupTestFrameworkScriptFile": "./__tests__/setup-jasmine-env.js"
  },
  "dependencies": {
    "moment": "^2.15.1",
    "react": "~15.3.1",
    "react-native": "~0.34.0",
    "react-native-action-button": "^2.0.3",
    "react-native-config": "0.0.8",
    "react-native-image-picker": "^0.22.5",
    "react-native-md-textinput": "^2.0.4",
    "react-native-signature-capture": "file:../react-native-signature-capture/",
    "react-native-simple-store": "^1.1.0",
    "react-native-vector-icons": "  ^2.1.0",
    "realm": "~0.14.3"
  },
  "devDependencies": {
    "babel-jest": "^15.0.0",
    "babel-plugin-transform-async-to-generator": "^6.8.0",
    "babel-preset-react-native": "^1.9.0",
    "eslint": "^3.4.0",
    "eslint-plugin-react": "^6.2.0",
    "eslint-plugin-react-native": "^2.0.0",
    "fetch-mock": "^5.1.1",
    "jasmine-reporters": "^2.2.0",
    "jest": "^15.1.1",
    "jest-react-native": "^15.0.0",
    "react-test-renderer": "^15.3.1",
    "test-realm": "https://github.com/alexsotocx/realm-test-js.git#master"
  },
  "engines": {
    "node": "~6.5.0",
    "npm": "~3.10.3"
  }
}

Another information

I ran the command below and it finished

react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output /Users/innventto/Documents/projects/Conconcreto/bitacora/android/app/build/intermediates/assets/release/index.android.bundle --assets-dest /Users/innventto/Documents/projects/Conconcreto/bitacora/android/app/build/intermediates/res/merged/release
Locked

Most helpful comment

I found the issue...
:app:bundleReleaseJsAndAssets was trying to bundle the default.realm* in the root folder generated from the tests in jest... So it was hanging there.

It couldn't decompile them or whatever. So i just deleted them and it worked again 馃憤

All 13 comments

I found the issue...
:app:bundleReleaseJsAndAssets was trying to bundle the default.realm* in the root folder generated from the tests in jest... So it was hanging there.

It couldn't decompile them or whatever. So i just deleted them and it worked again 馃憤

I Have the same issue :'( Building 93% > :app:bundleReleaseJsAndAssets never progress still gets stuck on Mac OS

@khalidahmada Do you solve your problem? I have the same issue

I have this issue. I am pretty sure it has to do with output images being put into the /android/app/main/src/res folder as when you delete some of those files then re-run it works. What would cause that?

Having the same issue on macOs 10.12.4

I was having the same problem, but as @alexsotocx mentioned, if you are using realm just deleted the folders default.realm* and realm-* from root and it should build.

Indeed as @aparedes , make sure you ignore the folders and files not needed inside the build.gradle or ignore them.

I'd say there should be an error message, not just a hang.

Hey @aparedes, do you just need to remove those default.realm* and realm-* files and it works? I tried that way but it still hangs there.

@dzuncoi, Yes, for me rm -r default.realm* && rm -r realm-* in the projects root worked.

To add to what's been said:

I started experiencing this "hang while trying to build APK" issue shortly after I started implementing jest tests for my React Native project. My project uses Realm.io realm-js database. I have tests that do database interactions, which cause realm runtime files (db, db manager, etc) to appear in the root of my RN project directory.

The command to build APK apparently finds these files and thinks they're to be included in APK and tries to do something with them. (I have zero understanding of what's going on with this, why, etc.)

Deleting all the Realm files from my RN project root directory clears the problem, and while :app:bundleReleaseJsAndAssets step still takes a long while to run it now _does_ eventually finish successfully for me.

Hi, I ran into this problem getting our Android app published, and ended up writing a medium article that addresses this and related issues.

https://medium.com/@paterw00t_17915/android-react-native-fastlane-working-with-multiple-build-types-a9a6641c5704

After deleting the realm files (with rm -r default.realm* && rm -r realm-*) from my RN root directory my build no longer gets stuck, however, it now crashes with the error unable to open path at default.realm. Did anyone else run into this problem? If yes, how were you able to fix it?

Closing the current window of terminal & again running the same command worked for me.

Was this page helpful?
0 / 5 - 0 ratings