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.

Unable to run release in android

See original GitHub issue

Hello

I’m trying to run my build in release mode for Android but the app keeps crashing, my plan is to run native code that I have made in C++ which works fine when I call it in debug mode. In release mode I get:

 --------- beginning of crash
2018-11-21 14:00:30.768 15410-15451/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
    Process: com.kulascope, PID: 15410
    java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unable to load script from assets 'threads/..worker.thread.bundle'. Make sure your bundle is packaged correctly or you're running a packager server.
        at com.facebook.react.bridge.DefaultNativeModuleCallExceptionHandler.handleException(DefaultNativeModuleCallExceptionHandler.java:22)
        at com.facebook.react.devsupport.DisabledDevSupportManager.handleException(DisabledDevSupportManager.java:170)

This comes even though if I take out the native call and only do a simple post message inside the worker.thread.js which is the name of my worker. I followed the simpleExample structure but it seems to be an issue there as well.

I have my worker.thread.bundle inside project/android/app/src/main/assets/threads/ and worker.thread.js in my project folder. I ran the command sudo node node_modules/react-native/local-cli/cli.js bundle --dev false --assets-dest ./android/app/src/main/res/ --entry-file worker.thread.js --platform android --bundle-output ./android/app/src/main/assets/threads/worker.thread.bundle

I’m running react-native: 0.55.2 react-native-threads: 0.0.13 I use this version in relation to this bug

What am I doing wrong ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

5reactions
nickymagiccommented, Feb 1, 2019

When you initialize your thread object with new Thread('path/to/thread') the path should be different in release and development mode. In development mode, path to thread should be relative to file in which thread is initialized, for example new Thread('../../index.thread.js'). But in release mode, when you initialize thread, application is looking for your assets/thread folder as root. So you need to initialize your threads with new Thread('index.thread.js').

0reactions
ingvisocommented, Feb 13, 2019

@nickymagic this solved this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't run Android application in release build - Stack Overflow
Can't run Android application in release build · 1. try to build it with minifyEnabled false , if it builds then your proguard...
Read more >
Troubleshoot known issues with Android Emulator
This page lists known issues, workarounds, and troubleshooting tips for the Android Emulator. If you encounter an issue not listed here or ...
Read more >
Cannot Run on an Android Device - RAD Studio
Troubleshooting: Cannot Run on an Android Device · Open the SDK Manager and verify that the value of the Adb location field is...
Read more >
Android Studio — How to fix it. Android Studio 3.x.x - Medium
These two issues (#1 and #2)seem to appear like bugs. The reason behind is either the code does not compile or Android Studio...
Read more >
flutter can't run on release mode but on debug mode ... - GitHub
4 [√] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at C:\Users\bright\AppData\Local\Android\sdk • ...
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