react-native-threads icon indicating copy to clipboard operation
react-native-threads copied to clipboard

[Android] Release mode is calling for .bundle instead of .jsbundle

Open joaom182 opened this issue 6 years ago • 4 comments

Crash java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unable to load script from assets 'threads/pre-load-data-worker.thread.bundle'. Make sure your bundle is packaged correctly or you're running a packager server.

screen shot 2018-07-28 at 11 29 18

joaom182 avatar Jul 28 '18 14:07 joaom182

You're right!

The issue is here: https://github.com/joltup/react-native-threads/blob/master/android/src/main/java/com/reactlibrary/RNThreadModule.java#L182

We need up update the code to look for a .jsbundle suffix rather than a .bundle suffix

Traviskn avatar Aug 23 '18 15:08 Traviskn

@Traviskn I was planing on using background threads and sharing them across multiple screens/activities, this seems like good project being inspired from the earlier two which are no longer maintained.

Coning to the issue, is changing .bundle to .jsbundle only change needed for this to work? If that is the case I would be haapy to raise a PR, otherwise too let me know how can I help here.

spidergears avatar Aug 29 '18 03:08 spidergears

yep that's the only change. I found that in our app we're just generating a .bundle file for android and a .jsbundle for iOS, but it would definitely be nice to make that more consistent

Traviskn avatar Sep 12 '18 18:09 Traviskn

This and the fact that the README states that the bundle should be generated with a .jsbundle is probably confusing a lot of newcomers who wouldn't have the reflex to look at the logcat. Is there a reason it is still not fixed (backwards compatibility ?) or is it just noone did a PR.

If it is just a PR, I can make one.

saalihou avatar Dec 24 '19 11:12 saalihou