am building a react native app using expo workflow. am using expo SDK 49 and a peer dependency version of react native. i have finished developing my app and was testing for production. When running the app in a development build everything works fine it extremely fast and does what it is supposed to do. i tried to compile the app for production to do further tests and got a .aab file which is meant for deployment to the google app store but i wanted an APK that i can easily run on my phone, so i went to the expo docs and found some details on how to do it and indeed i got an APK file. no when i launch the app the logo on the splash screen displays then suddenly the app crashes and stops i have tried installing on multiple deviceses but still same issue. i then tried to see the logs from the phone using ADB and got this in the crash section of the log
--------- beginning of crash
10-05 16:25:46.505 **** **** F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x8 in tid **** (com.muswalo.eswap)
10-05 16:25:46.589 **** **** F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-05 16:25:46.589 **** **** F DEBUG : Build fingerprint: 'HONOR/STF-AL00/HWSTF:7.0/HUAWEISTF-AL00/C00B201:user/release-keys'
10-05 16:25:46.589 **** **** F DEBUG : Revision: '0'
10-05 16:25:46.589 **** **** F DEBUG : ABI: 'arm64'
10-05 16:25:46.589 **** **** F DEBUG : pid: ****, tid: ****, name: m.muswalo.eswap >>> com.muswalo.eswap <<<
10-05 16:25:46.589 **** **** F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
10-05 16:25:46.589 **** **** F DEBUG : x0 **** x1 **** x2 **** x3 ****
10-05 16:25:46.589 **** **** F DEBUG : x4 **** x5 **** x6 **** x7 ****
10-05 16:25:46.589 **** **** F DEBUG : x8 **** x9 **** x10 **** x11 ****
10-05 16:25:46.589 **** **** F DEBUG : x12 **** x13 **** x14 **** x15 ****
10-05 16:25:46.589 **** **** F DEBUG : x16 **** x17 **** x18 **** x19 ****
10-05 16:25:46.589 **** **** F DEBUG : x20 **** x21 **** x22 **** x23 ****
10-05 16:25:46.589 **** **** F DEBUG : x24 **** x25 **** x26 **** x27 ****
10-05 16:25:46.589 **** **** F DEBUG : x28 **** x29 **** x30 ****
10-05 16:25:46.589 **** **** F DEBUG : sp **** pc **** pstate ****
10-05 16:25:46.592 **** **** F DEBUG :
10-05 16:25:46.592 **** **** F DEBUG : backtrace:
10-05 16:25:46.592 **** **** F DEBUG : #00 pc **** /data/app/com.muswalo.eswap-1/lib/arm64/libreanimated.so
10-05 16:25:46.592 **** **** F DEBUG : #01 pc **** /data/app/com.muswalo.eswap-1/lib/arm64/libreanimated.so (_ZN10reanimated9Scheduler9triggerUIEv+****)
10-05 16:25:46.592 **** **** F DEBUG : #02 pc **** /data/app/com.muswalo.eswap-1/lib/arm64/libreanimated.so (_ZN8facebook3jni6detail13MethodWrapperIMN10reanimated16AndroidSchedulerEFvvEXadL_ZNS4_9triggerUIEvEES4_vJEE8dispatchENS0_9alias_refIPNS1_8JTypeForINS0_11HybridClassIS4_NS1_15BaseHybridClassEE8JavaPartENS0_7JObjectEvE11_javaobjectEEE+****)
10-05 16:25:46.592 **** **** F DEBUG : #03 pc **** /data/app/com.muswalo.eswap-1/lib/arm64/libreanimated.so (_ZN8facebook3jni6detail15FunctionWrapperIPFvNS0_9alias_refIPNS1_8JTypeForINS0_11HybridClassIN10reanimated16AndroidSchedulerENS1_15BaseHybridClassEE8JavaPartENS0_7JObjectEvE11_javaobjectEEEESE_vJEE4callEP7_JNIEnvP8_jobjectSH_+****)
10-05 16:25:46.592 **** **** F DEBUG : #04 pc **** /data/app/com.muswalo.eswap-1/lib/arm64/libreanimated.so (_ZN8facebook3jni6detail13MethodWrapperIMN10reanimated16AndroidSchedulerEFvvEXadL_ZNS4_9triggerUIEvEES4_vJEE4callEP7_JNIEnvP8_jobject+****)
10-05 16:25:46.592 **** **** F DEBUG : #05 pc **** /data/app/com.muswalo.eswap-1/oat/arm64/base.odex (offset ****)
Note: some device specifc information has been replaced with **
i would also like to add that i simulated the production environment using npx expo start –no-dev and npx expo start –no-dev –minify in which the app worked as expected. i have also tried making sure that all packages are up to date and have their peer dependecies.
Any advice all help will be appreciated as i have been suffering with this problem for past 4 days and the client am building for is on my kneck.
NOTE: am an intermediate dev
2
Answers
after a few days of fault finding it turns out the only things I needed to do was remove unused packages from the package.json file, particularly the react-reanimated lib which was not being used. after this the compilation was successful and the app is now running. thanks to everyone that helps. I would also encourage any person with the same problem or similar problem to use the ABD tool to run debugging on runtime when dealing with native modules like the reanimated lib.
You can manually open the android simulator(Android Studio) and open avd manager from the configure dropdown.
After that you will get the devices.
In the table go to the action column and then click on drop down button.
You will get one option(cold boot now), just click and then restart the application.
It should work after that !