# bundleReleaseJsAndAssets fails with error "bundle.getAssets is not a function"

**URL:** <https://discuss.bitrise.io/t/bundlereleasejsandassets-fails-with-error-bundle-getassets-is-not-a-function/4378>\
**Category:** Builds\
**Tags:** react-native\
**Created:** [March 6, 2018, 1:27am UTC](https://discuss.bitrise.io/t/bundlereleasejsandassets-fails-with-error-bundle-getassets-is-not-a-function/4378 "2018-03-06T01:27:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![james\_gestier](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@james\_gestier](https://discuss.bitrise.io/u/james_gestier)\
**Post date:** [March 6, 2018, 1:27am UTC](https://discuss.bitrise.io/t/bundlereleasejsandassets-fails-with-error-bundle-getassets-is-not-a-function/4378/1 "2018-03-06T01:27:10Z")

</div>

# Bitrise Build Issue Report

Trying to build Android react-native release build and it is failing on the bundleReleaseJsAndAssets step with the error.

bundle.getAssets is not a function

## Environment:

Hybrid (Xamarin, Ionic, …) on macOS, includes Visual Studio for Mac, Stable channel

Which build Step causes the issue and which version of the step?

Gradle Runner v 1.8.3

## Reproducibility

- _Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build)_ : NO
- _Does a rebuild without caches help? (You can remove the `Cache:Pull` and `Cache:Push` steps temporarily to not to use the cache, or [you can delete all the caches on the `Settings` tab of the app](http://devcenter.bitrise.io/caching/about-caching/#downloading-and-deleting-caches)._ : NO
- _Does the issue happen sporadically, or every time?_ : YES
- _Does upgrading the build Step to the latest version help?_ : NO
- _When did the issue start?_ : Since started using BitRise

### Local reproduction

_Can it be reproduced on your own Mac/PC by following our [local debug guide](http://discuss.bitrise.io/t/how-to-debug-your-build-locally-it-works-on-my-mac-pc-but-not-on-bitrise-io/392)? Please follow at least the first section (“Testing with a full clean git clone”) to make sure to test the state of the code what [bitrise.io](http://bitrise.io) will get when it does a git clone in the clean environment! If possible please note which sections you tried._

### Local reproduction: Linux / Android (docker based) stack builds

_Can it be reproduced by running the build locally, after doing a new git clone of the repository into the `/tmp` directory and running the build from there with the Bitrise CLI ( [https://www.bitrise.io/cli](https://www.bitrise.io/cli) )? If no, can it be reproduced with Docker (using the same docker images / environment we use on [bitrise.io](http://bitrise.io))? Related guide: [http://devcenter.bitrise.io/docker/run-your-build-locally-in-docker/](http://devcenter.bitrise.io/docker/run-your-build-locally-in-docker/) ._

## Build log

```auto
Starting process 'command 'node''. Working directory: /Users/vagrant/git Command: node node_modules/react-native/local-cli/cli.js bundle --platform android --dev false --reset-cache --entry-file index.android.js --bundle-output /Users/vagrant/git/android/app/build/intermediates/assets/release/index.android.bundle --assets-dest /Users/vagrant/git/android/app/build/intermediates/res/merged/release
Successfully started process 'command 'node''
Scanning folders for symlinks in /Users/vagrant/git/node_modules (18ms)
Scanning folders for symlinks in /Users/vagrant/git/node_modules (43ms)
Loading dependency graph, done.
warning: the transform cache was reset.
bundle: start
bundle: finish
bundle: Writing bundle output to: /Users/vagrant/git/android/app/build/intermediates/assets/release/index.android.bundle
bundle: Done writing bundle output
bundle.getAssets is not a function
:app:bundleReleaseJsAndAssets FAILED
:app:bundleReleaseJsAndAssets (Thread[main,5,main]) completed. Took 2 mins 54.285 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'node'' finished with non-zero exit value 1
* Try:
Run with --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:bundleReleaseJsAndAssets'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
	at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
	at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
	at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
	at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
	at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
	at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
	at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
	at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
	at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
	at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
	at org.gradle.internal.Factories$1.create(Factories.java:22)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
	at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
	at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
	at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
	at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
	at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
	at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
	at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
	at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
	at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
	at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
	at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
	at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
	at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:239)
	at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:212)
	at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
	at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
	at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:205)
	at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
	at org.gradle.launcher.Main.doAction(Main.java:33)
	at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
	at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
	at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
	at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
	at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: org.gradle.process.internal.ExecException: Process 'command 'node'' finished with non-zero exit value 1
	at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:367)
	at org.gradle.process.internal.DefaultExecAction.execute(DefaultExecAction.java:31)
	at org.gradle.api.tasks.AbstractExecTask.exec(AbstractExecTask.java:54)
	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
	at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:228)
	at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
	at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
	at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:621)
	at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:604)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
	... 60 more
BUILD FAILED

```

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [March 6, 2018, 5:32pm UTC](https://discuss.bitrise.io/t/bundlereleasejsandassets-fails-with-error-bundle-getassets-is-not-a-function/4378/2 "2018-03-06T17:32:13Z")

</div>

Hi @james_gestier,

Can you please copy paste the related build’s [bitrise.io](http://bitrise.io) URL?

Additionally, can you please try the local repro mentioned in the report:

> Can it be reproduced on your own Mac/PC by following our local debug guide? Please follow at least the first section (“Testing with a full clean git clone”) to make sure to test the state of the code what [bitrise.io](http://bitrise.io) will get when it does a git clone in the clean environment! If possible please note which sections you tried.

---

<div class="post-metadata">

**Author:** ![james\_gestier](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@james\_gestier](https://discuss.bitrise.io/u/james_gestier)\
**Post date:** [March 6, 2018, 9:54pm UTC](https://discuss.bitrise.io/t/bundlereleasejsandassets-fails-with-error-bundle-getassets-is-not-a-function/4378/3 "2018-03-06T21:54:34Z")

</div>

Hi @viktorbenei-x1,

Here is the URL.

[https://www.bitrise.io/build/eccbb7554dee6bdf](https://www.bitrise.io/build/eccbb7554dee6bdf)

I can run the same gradlew command locally and it works but haven’t done a completely fresh clone. Will give that a try.

---

<div class="post-metadata">

**Author:** ![james\_gestier](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@james\_gestier](https://discuss.bitrise.io/u/james_gestier)\
**Post date:** [March 7, 2018, 10:46pm UTC](https://discuss.bitrise.io/t/bundlereleasejsandassets-fails-with-error-bundle-getassets-is-not-a-function/4378/4 "2018-03-07T22:46:57Z")

</div>

Doing a fresh Git clone and running ./gradlew assembleRelease from the android folder works fine on my local machine. The only difference I can see is that locally I have my keystore file in the android/app folder but the bitRise build is failing before even getting to the APK signing step.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [March 8, 2018, 4:10pm UTC](https://discuss.bitrise.io/t/bundlereleasejsandassets-fails-with-error-bundle-getassets-is-not-a-function/4378/5 "2018-03-08T16:10:37Z")

</div>

> [@james\_gestier](#):
>
> The only difference I can see is that locally I have my keystore file in the android/app folder but the bitRise build is failing before even getting to the APK signing step.

That’s a good lead!

Can you try to remove the keystore file and then run `./gradlew assembleRelease` again and let us know if you get the same error?

---

<div class="post-metadata">

**Author:** ![james\_gestier](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@james\_gestier](https://discuss.bitrise.io/u/james_gestier)\
**Post date:** [March 9, 2018, 12:41am UTC](https://discuss.bitrise.io/t/bundlereleasejsandassets-fails-with-error-bundle-getassets-is-not-a-function/4378/6 "2018-03-09T00:41:34Z")

</div>

I don’t get the same error. The bundleReleaseJsAndAssets step works correctly locally but I get an error when it tries to sign the APK (which is expected as the keystore file is missing). Putting the keystore file back and it all works correctly locally.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [March 12, 2018, 6:15pm UTC](https://discuss.bitrise.io/t/bundlereleasejsandassets-fails-with-error-bundle-getassets-is-not-a-function/4378/7 "2018-03-12T18:15:27Z")

</div>

I wonder if this might be a Node/ReactNative version issue? 🤔

Did you try it on another Stack?

If that wouldn’t help, can you please enable Support Access on the app’s Settings tab, so that we can look into its config?

You can also Remote Desktop / VNC into the build VM ([https://gist.github.com/viktorbenei/c6d4fe1e68de739dbb5f4f15de76b9db](https://gist.github.com/viktorbenei/c6d4fe1e68de739dbb5f4f15de76b9db)) and see if you can figure out what causes this issue.

---

<div class="post-metadata">

**Author:** ![chromeriver](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@chromeriver](https://discuss.bitrise.io/u/chromeriver)\
**Post date:** [March 1, 2019, 1:51am UTC](https://discuss.bitrise.io/t/bundlereleasejsandassets-fails-with-error-bundle-getassets-is-not-a-function/4378/8 "2019-03-01T01:51:50Z")

</div>

I’m experiencing the same issue. Did you ever resolve this?

---

<div class="post-metadata">

**Author:** ![bitce](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/bitce/32/1639_2.png) [@bitce](https://discuss.bitrise.io/u/bitce)\
**Post date:** [March 1, 2019, 11:39am UTC](https://discuss.bitrise.io/t/bundlereleasejsandassets-fails-with-error-bundle-getassets-is-not-a-function/4378/9 "2019-03-01T11:39:06Z")

</div>

Hi @chromeriver, can you please send us a build URL?
