When bundling js for React Native using ClojureScript I got the following error. It seems that node runs out of memory when bundling the javascript bundle. This is probably
I have found way to generate Signed APK in re-natal project.
For this we must edit file in node_modules/react-native/react.gradle
Change 84-th row in this file. From
commandLine(*nodeExecutableAndArgs, "node_modules/react-native/local-cli/cli.js", "bundle", "--platform", "android", "--dev", "${devEnabled}",
"--reset-cache", "--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir, *extraPackagerArgs)
To this
commandLine(*nodeExecutableAndArgs, "--max-old-space-size=4096", "node_modules/react-native/local-cli/cli.js", "bundle", "--platform", "android", "--dev", "${devEnabled}",
"--reset-cache", "--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir, *extraPackagerArgs)
To create production build you must use
lein prod-build
After compiling of ClojureScript use this commands:
cd android && ./gradlew assembleRelease
The generated APK can be found under android/app/build/outputs/apk/app-release.apk
, and is ready to be distributed.