question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React native doesn't build Android release. Hangs at bundleReleaseJsAndAssets

See original GitHub issue

Description

Upgraded to 0.43.1 and tried running ./gradlew assembleRelease to generate my Android build apk

It just hangs at usually 91…95% for ever.

image of hang

Reproduction Steps and Sample Code

Do the required signing for the apk and the various tasks in the gradle files explained here : https://facebook.github.io/react-native/docs/signed-apk-android.html

Go to Android folder and run ./gradlew assembleRelease

for reference, i added some helper scripts in my package.json

//top of package.json
//...
"droid:assr": "cd android && ./gradlew assembleRelease && cd ..",
"droid:rel": "react-native run-android --variant=release",
//...
//rest of package.json

Neither react-native run-android --variant=release or ./gradlew assembleRelease works.

Solution

Building from android-studio with gradle works, but it skips bundleReleaseJsAndAssets so it makes the app crash instantly.

Additional Information

  • React Native version: 0.43.1
  • Platform: Android (Haven’t tried buiding the release build on iOS yet)
  • Development Operating System: MacOS
  • Dev tools: Mainly coding in vscode, used android-studio(2.3.1) to try to workout around the problem (no success)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:11

github_iconTop GitHub Comments

10reactions
Hindenescommented, Jun 26, 2017

Had the same issue, but I managed to fix it.

For me, the problem was that I use Realm in my tests, and I didn’t remove the generated realm files after a test run. Removing all Realm files fixed it (rm -rf default.realm* && rm -rf realm-*).

4reactions
kulorcommented, Jul 31, 2017

I’ve just found a workaround to my particular problem; removing the realm-object-server directory unblocks the bundleReleaseJsAndAssets step

Read more comments on GitHub >

github_iconTop Results From Across the Web

React native bundlle js stuck - Stack Overflow
When I run react-native run-android --variant=Release or any other variant I defined in build.gradle I got stuck on Building 91% ...
Read more >
Troubleshooting build errors and crashes - Expo Documentation
A reference for troubleshooting build errors and crashes when using EAS Build. ... build/app/node_modules/@react-native-async-storage/async-storage/android/ ...
Read more >
bundleReleaseJsAndAssets during Android release builds is ...
[Solved]-bundleReleaseJsAndAssets during Android release builds is taking infinite time-React Native. Search. score:0. $ .\gradlew wrapper --gradle-version ...
Read more >
Bundling React Native during Android release builds
* and bundleReleaseJsAndAssets). * These basically call `react-native bundle` with the correct arguments during the Android build * cycle. By ...
Read more >
Fixing React-Native android release build - wesionaryTEAM
Fixing React-Native android release build Android release build crashes on launch but works fine on a development mode. couldn't find DSO to load: ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found