7

My Android react native is working fine for debug builds, but after building the signed release apk with: cd android && ./gradlew assembleRelease then it always crashes on startup. The file size of the APK looks pretty similar to the debug one (not a huge difference). Here is the error from logcat. (I have checked the other stackoverflow issues on release ask problems but could not find a solution. I have also tried 'gradle clean' build).

React-native version 0.44

01-17 14:08:13.694 E/UncaughtException: java.lang.RuntimeException: Error calling AppRegistry.runApplication
                                        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
                                        at android.os.Handler.handleCallback(Handler.java:751)
                                        at android.os.Handler.dispatchMessage(Handler.java:95)
                                        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
                                        at android.os.Looper.loop(Looper.java:154)
                                        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:208)
                                        at java.lang.Thread.run(Thread.java:762)
                                     Caused by: com.facebook.jni.CppException: Could not get BatchedBridge, make sure your bundle is packaged correctly
                                        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
                                        at android.os.Handler.handleCallback(Handler.java:751) 
                                        at android.os.Handler.dispatchMessage(Handler.java:95) 
                                        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) 
                                        at android.os.Looper.loop(Looper.java:154) 
                                        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:208) 
                                        at java.lang.Thread.run(Thread.java:762) 
01-17 14:08:13.922 E/AndroidRuntime: FATAL EXCEPTION: mqt_js
                                 Process: com.challengesolutions.lifeapp, PID: 9250
                                 java.lang.RuntimeException: Error calling AppRegistry.runApplication
                                     at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
                                     at android.os.Handler.handleCallback(Handler.java:751)
                                     at android.os.Handler.dispatchMessage(Handler.java:95)
                                     at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
                                     at android.os.Looper.loop(Looper.java:154)
                                     at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:208)
                                     at java.lang.Thread.run(Thread.java:762)
                                  Caused by: com.facebook.jni.CppException: Could not get BatchedBridge, make sure your bundle is packaged correctly
                                     at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
                                     at android.os.Handler.handleCallback(Handler.java:751) 
                                     at android.os.Handler.dispatchMessage(Handler.java:95) 
                                     at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) 
                                     at android.os.Looper.loop(Looper.java:154) 
                                     at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:208) 
                                     at java.lang.Thread.run(Thread.java:762) 

Thanks for the help!

Dave Hurst
  • 101
  • 4
  • I think the problem is in the `AppRegistry`. Please check your code again. and link your AppRegistry properly. – Sathish Sundharam Jan 18 '18 at 05:34
  • Hey @SathishSundharam - thanks for the comment. So the AppRegistry runs perfectly fine in debug using: AppRegistry.registerComponent('lifepoints', () => MainApp); and then: class MainApp extends React.Component Any other ideas how I can check the AppRegistry crash for release? – Dave Hurst Jan 18 '18 at 06:56
  • Hi @Dave - this link may help you..have a look at this [Click here](https://stackoverflow.com/questions/38870710/error-could-not-get-batchedbridge-make-sure-your-bundle-is-packaged-properly). – Sathish Sundharam Jan 18 '18 at 07:28
  • Hi @SathishSundharam I have been gone through with the given link but it is for debug version not for the release version. I am facing same issue with the release version. any help would be appreciated. – SilentKiller Feb 13 '18 at 10:01
  • 2
    Hi @DaveHurst, did you manage to solve this? I am facing the same problem here – Matthieu Feb 05 '19 at 14:50

0 Answers0